[PR #829] [MERGED] fix: fixes path issues on windows #807

Closed
opened 2026-02-25 23:35:32 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/829
Author: @Monirzadeh
Created: 1/28/2024
Status: Merged
Merged: 2/5/2024
Merged by: @fmartingr

Base: masterHead: fix-test-in-windows


📝 Commits (10+)

  • b67aef4 return corrent path in windows with usiing path lib
  • ac8433c ci: run tests in windows and macos too
  • 2a94c26 avoid testing mysql/psql in windows and macos
  • 95e0319 windows & macos matrix
  • 1737a89 disable gotestfmt
  • 0f65bfc replace which in shell script
  • f12ff1e handle error in test db removal
  • 1e3a5ac fix expected path baseed on platform
  • aa10509 add leading seprator
  • 89d9599 Merge branch 'fix-file-not-serve-in-windows' into fix-test-in-windows

📊 Changes

12 files changed (+241 additions, -449 deletions)

View changed files

📝 .github/workflows/_test.yml (+37 -3)
📝 Makefile (+1 -1)
📝 internal/config/config_test.go (+2 -12)
📝 internal/core/ebook_test.go (+39 -34)
📝 internal/core/processing_test.go (+36 -43)
📝 internal/database/database_test.go (+103 -2)
📝 internal/database/mysql_test.go (+4 -118)
📝 internal/database/pg_test.go (+4 -117)
📝 internal/database/sqlite_test.go (+6 -112)
📝 internal/http/routes/frontend.go (+2 -2)
📝 internal/testutil/shiori.go (+5 -2)
📝 scripts/test.sh (+2 -3)

📄 Description

This PR try to fix failed test in windows and fix #822
TODO:

  • thumb path fix
  • serve frontend files in windows and pass style css test in frontpage_test.go for windows.
  • failed to create destination dir file does not exist.
    • everywhere we us WriteFile this test failed in windows. core test failed because of that.
    • maybe this is a false negative. i can pass that with some change and manual testing work fine in windows too. i should be sure about that. (pass a not absolute path for temp in unit test and it work fine)
      for example change this two line
      github.com/go-shiori/shiori@84e5b09c4c/internal/core/ebook_test.go (L25-L26)
      to this and test will pass
  • The process cannot access the file because it is being used by another process.
tempDir := "tmpdir"
dstDir := "dstdir"
  • cleanup the code and unify variable names

Fixes #829
Fixes #824
Fixes #823
Close #827
Close #822


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/829 **Author:** [@Monirzadeh](https://github.com/Monirzadeh) **Created:** 1/28/2024 **Status:** ✅ Merged **Merged:** 2/5/2024 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `fix-test-in-windows` --- ### 📝 Commits (10+) - [`b67aef4`](https://github.com/go-shiori/shiori/commit/b67aef4367ad379ef1c0aee634c9a8f7919c9d1d) return corrent path in windows with usiing path lib - [`ac8433c`](https://github.com/go-shiori/shiori/commit/ac8433c182505226587b9f9858fcfb41d01459e5) ci: run tests in windows and macos too - [`2a94c26`](https://github.com/go-shiori/shiori/commit/2a94c26583f1d52c8906b579c5b7427f4b819d79) avoid testing mysql/psql in windows and macos - [`95e0319`](https://github.com/go-shiori/shiori/commit/95e03199e9947f02593ea671642a0744ae5f65e0) windows & macos matrix - [`1737a89`](https://github.com/go-shiori/shiori/commit/1737a893e26d2efd1e6de4ba88cb018b04ef8d22) disable gotestfmt - [`0f65bfc`](https://github.com/go-shiori/shiori/commit/0f65bfcb96c8d8376dda0ae60dc1dc42688ffaf7) replace which in shell script - [`f12ff1e`](https://github.com/go-shiori/shiori/commit/f12ff1e0948b0126f1c2c89e0d5fb73f6534bfa1) handle error in test db removal - [`1e3a5ac`](https://github.com/go-shiori/shiori/commit/1e3a5ac968bf7071bf6f63cc177a8f0f92079c9c) fix expected path baseed on platform - [`aa10509`](https://github.com/go-shiori/shiori/commit/aa1050977bf8d6430225a6b833ef152f2c3016f6) add leading seprator - [`89d9599`](https://github.com/go-shiori/shiori/commit/89d95995228f94bdbc005db2017916188edbdfd5) Merge branch 'fix-file-not-serve-in-windows' into fix-test-in-windows ### 📊 Changes **12 files changed** (+241 additions, -449 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/_test.yml` (+37 -3) 📝 `Makefile` (+1 -1) 📝 `internal/config/config_test.go` (+2 -12) 📝 `internal/core/ebook_test.go` (+39 -34) 📝 `internal/core/processing_test.go` (+36 -43) 📝 `internal/database/database_test.go` (+103 -2) 📝 `internal/database/mysql_test.go` (+4 -118) 📝 `internal/database/pg_test.go` (+4 -117) 📝 `internal/database/sqlite_test.go` (+6 -112) 📝 `internal/http/routes/frontend.go` (+2 -2) 📝 `internal/testutil/shiori.go` (+5 -2) 📝 `scripts/test.sh` (+2 -3) </details> ### 📄 Description This PR try to fix failed test in windows and fix #822 TODO: - [x] thumb path fix - [x] serve frontend files in windows and pass style css test in` frontpage_test.go` for windows. - [x] `failed to create destination dir file does not exist.` - everywhere we us `WriteFile` this test failed in windows. core test failed because of that. - maybe this is a false negative. i can pass that with some change and manual testing work fine in windows too. i should be sure about that. (pass a not absolute path for temp in unit test and it work fine) for example change this two line https://github.com/go-shiori/shiori/blob/84e5b09c4c9944fc881ad6e1c6a5224b6fa07e42/internal/core/ebook_test.go#L25-L26 to this and test will pass - [x] `The process cannot access the file because it is being used by another process.` - it happen in golang 1.20 for record https://github.com/golang/go/issues/51442 and review later - `TestReadDotEnv` everywhere we use `os.RemoveAll` ``` tempDir := "tmpdir" dstDir := "dstdir" ``` - [x] cleanup the code and unify variable names Fixes #829 Fixes #824 Fixes #823 Close #827 Close #822 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:35:32 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#807
No description provided.