Windows test failures in MockFileSystem.Walk due to path separator
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
cmd/importDir_test.go の Walk メソッドと、TestImportDirectory および TestFindSpecificationFilesWithFS で使われるフィクスチャを読む。go test -v ./cmd -run "TestImportDirectory|TestFindSpecificationFilesWithFS" を実行し、Windows でルート配下のフィクスチャパスがどのように照合されるかを確認する。モックの walk がフィクスチャファイルを見つけ、両方のテストが Windows で成功すれば完了。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The directory import tests fail on Windows because MockFileSystem.Walk uses the operating system's path separator to match child paths, while the mock filesystem fixtures use forward slashes.
In cmd/importDir_test.go, the Walk method contains this check:
if path == root || strings.HasPrefix(path, root+string(filepath.Separator)) {
For a root path of /test, the prefix is /test/ on Linux, which matches fixture paths such as /test/openapi.yaml.
On Windows, filepath.Separator is \, so the prefix becomes /test\. This does not match the forward-slash fixture paths, causing the mock filesystem to skip child files.
Steps to reproduce
On Windows, run:
go test -v ./cmd -run "TestImportDirectory|TestFindSpecificationFilesWithFS"
Actual behavior
Seven subtests fail across TestImportDirectory and TestFindSpecificationFilesWithFS.
The directory import tests report:
no specification files found in directory: /test
The file-discovery tests return no matching specification files, even though the fixtures contain them.
Expected behavior
MockFileSystem.Walk should traverse fixture paths consistently across operating systems, and the affected tests should pass on Windows.
Context
The current .github/workflows/build-verify.yml workflow runs tests on Ubuntu, so these Windows-specific test failures are not caught by the existing CI workflow. The project also builds Windows binaries.
Possible fix
Normalize the paths consistently before checking whether a fixture is under the requested root, so the mock filesystem's path matching does not depend on the host operating system.
Microcks version or git rev
Reproduced on Windows amd64 with Go 1.27.0. The exact repository commit SHA used for the reproduction can be added if available.
Install method
Not applicable. This issue concerns Go unit tests for the CLI's mock filesystem.
Additional information
The issue affects test infrastructure rather than the production directory-import implementation. The fix should preserve the existing import behavior while making the mock filesystem portable across operating systems.
- 主要言語
- Go
- スター
- 59
- フォーク
- 74
- 平均マージ
- 4日 8時間
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microcks/microcks-cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microcks/microcks-cli#608 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microcks/microcks-cli#606 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microcks/microcks-cli#598 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug: microcks login ignores the --config flag and always modifies default config対応中かも @aryarathoree が 3 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microcks/microcks-cli#594 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
Wrong link to test results対応中かも @SajanBisht が 3 日前に担当しました。 オープンcomponent/cli keep-open kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microcks/microcks-cli#589 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
microcks/microcks-cli の issue をすべて見る
似ている issue
-
bug from-studio
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
esengine/DeepSeek-Reasonix#14868 ·
メンテナーはふだん 1 日以内に返信
-
Install notes print "Camunda REST API: https://" without a host when global.host is set対応中かも @irisfield が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
camunda/camunda-platform-helm#7790 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: zot exits with code 0 when it can't start対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
project-zot/zot#4636 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
keyxmakerx/Chronicle#1911 ·
メンテナーはふだん 1 日以内に返信
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/postgresql pkg:oci/postgresql?repos...64&tag=16.15-main-amd64 pkg:oci/postgresql?repos...64&tag=16.15-main-arm64 risk:low state:open
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
l3montree-dev/devguard#3282 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信