Windows test failures in MockFileSystem.Walk due to path separator
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 82/100
Direção de pesquisa
Leia o método Walk em cmd/importDir_test.go e os fixtures usados por TestImportDirectory e TestFindSpecificationFilesWithFS. Execute go test -v ./cmd -run "TestImportDirectory|TestFindSpecificationFilesWithFS"; verifique como os caminhos dos fixtures são comparados sob a raiz no Windows. O trabalho estará concluído quando o mock de walk encontrar os arquivos fixture e os dois testes passarem no Windows.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Go
- Estrelas
- 59
- Forks
- 74
- Merge médio
- 5d 4h
- PRs com merge (30d)
- 25
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microcks/microcks-cli
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
microcks/microcks-cli#598 ·
Mantenedores costumam responder em até 1 dia
-
bug: microcks login ignores the --config flag and always modifies default configTalvez já em andamento @aryarathoree assumiu há 2 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
microcks/microcks-cli#594 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
-
Wrong link to test resultsTalvez já em andamento @SajanBisht assumiu há 12 dias. Abertacomponent/cli keep-open kind/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
microcks/microcks-cli#589 · 4 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Default configuration path falls back to the current directory when the home directory cannot be determinedTalvez já em andamento @Sarthak-Shreshtha01 assumiu há 16 dias. Abertacomponent/cli kind/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
microcks/microcks-cli#583 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug: YAML parse error in config is silently swallowed, login overwrites all other contextsTalvez já em andamento @Sarthak-Shreshtha01 assumiu há 21 dias. Abertacomponent/cli kind/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
microcks/microcks-cli#572 · 6 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de microcks/microcks-cli
Issues semelhantes
-
area:web p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Lets-Parley/Parley#912 ·
Mantenedores costumam responder em até 1 dia
-
enhancement help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Git-Hospital/githealthcheck#61 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
afreidah/s3-orchestrator#1824 ·
Mantenedores costumam responder em até 1 dia
-
Type: Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
projectdiscovery/notify#569 ·
-
internal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia