Windows test failures in MockFileSystem.Walk due to path separator
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 82/100
Rechercherichtung
Lies die Methode Walk in cmd/importDir_test.go und die Fixtures, die von TestImportDirectory und TestFindSpecificationFilesWithFS verwendet werden. Führe go test -v ./cmd -run "TestImportDirectory|TestFindSpecificationFilesWithFS" aus; prüfe, wie Fixture-Pfade unterhalb des Stammverzeichnisses unter Windows abgeglichen werden. Fertig ist die Aufgabe, wenn der Mock-Walk die Fixture-Dateien findet und beide Tests unter Windows bestehen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Go
- Sterne
- 59
- Forks
- 74
- Ø Merge
- 4 T. 8 Std.
- Gemergte PRs (30 T.)
- 23
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microcks/microcks-cli
-
bug: microcks test get swallows test failure details and operation results in text output modeOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
microcks/microcks-cli#608 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
microcks/microcks-cli#606 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
microcks/microcks-cli#598 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug: microcks login ignores the --config flag and always modifies default configEvtl. vergeben @aryarathoree hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
microcks/microcks-cli#594 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Wrong link to test resultsEvtl. vergeben @SajanBisht hat das vor 4 Tagen übernommen. Offencomponent/cli keep-open kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
microcks/microcks-cli#589 · 4 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in microcks/microcks-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
docs(prompts): IF BLOCKED workflow-scope branch says to comment on the issue on jira/local trackersOffenagent-butler-finding bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
jordansmall/spindrift#6238 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug from-studio
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
esengine/DeepSeek-Reasonix#14868 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Install notes print "Camunda REST API: https://" without a host when global.host is setEvtl. vergeben @irisfield hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
camunda/camunda-platform-helm#7790 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
wso2/agent-manager#2220 ·
Maintainer antworten meist innerhalb von 1 Tag