Windows test failures in MockFileSystem.Walk due to path separator
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
Direzione di ricerca
Leggi il metodo Walk in cmd/importDir_test.go e i fixture usati da TestImportDirectory e TestFindSpecificationFilesWithFS. Esegui go test -v ./cmd -run "TestImportDirectory|TestFindSpecificationFilesWithFS"; controlla come vengono confrontati i percorsi dei fixture sotto la radice su Windows. Il lavoro è completato quando la mock walk trova i file fixture ed entrambi i test passano su Windows.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 59
- Fork
- 74
- Merge medio
- 5g 17h
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microcks/microcks-cli
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
microcks/microcks-cli#598 ·
I maintainer di solito rispondono entro 1 giorno
-
bug: microcks login ignores the --config flag and always modifies default configForse già presa @aryarathoree l’ha presa 3 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
microcks/microcks-cli#594 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Wrong link to test resultsForse già presa @SajanBisht l’ha presa 3 giorni fa. Apertacomponent/cli keep-open kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
microcks/microcks-cli#589 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Default configuration path falls back to the current directory when the home directory cannot be determinedForse già presa @Sarthak-Shreshtha01 l’ha presa 17 giorni fa. Apertacomponent/cli kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microcks/microcks-cli#583 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug: YAML parse error in config is silently swallowed, login overwrites all other contextsForse già presa @Sarthak-Shreshtha01 l’ha presa 22 giorni fa. Apertacomponent/cli kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microcks/microcks-cli#572 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microcks/microcks-cli
Issue simili
-
automation doc-healer documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
tsukumogami/tsuku#2804 ·
I maintainer di solito rispondono entro 1 giorno
-
Anthropic /v1/messages: only the last thinking block of an assistant message is keptForse già presa @Shayan12456 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ollama/ollama#19415 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
raised-by:verifier
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
medici-finance/assay#5039 ·
I maintainer di solito rispondono entro 1 giorno
-
metax CheckHealth reads Status.Capacity, so unhealthy Metax-GPU nodes are never cleaned upForse già presa @barbierajput378-pixel l’ha presa oggi. Apertakind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Project-HAMi/HAMi#3343 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno