-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paths on windows get mangled #16
Comments
How exactly are you calling tasty-silver? Can you add a minimal, working example which reproduces the problem? |
#! /usr/bin/env stack
-- stack --resolver lts-13.4 script
import Test.Tasty.Silver
import Test.Tasty.Silver.Interactive
main = defaultMain $
goldenVsFile
"Verify the world"
"approved.txt"
"recived.txt"
(writeFile "recived.txt" "Hello World\n") The error is triggerd when you have a golden file "approved.txt" that does not contain the approved recived text.
|
Looks like the paths are passed to A quick&dirty fix is probably just escaping backslashes by doubling them. I will see what I can do. |
I pushed a fix to https://github.com/phile314/tasty-silver/tree/fix_shell_escape . This is untested, as I do not have any Windows systems. Any chance you can test that branch? |
What do I do to test the changes? |
I just hit the OP when trying to run the Agda testsuite under cygwin. (After a maybe naive attempt for a Windows CI failed: https://github.com/agda/agda/runs/3450560107?check_suite_focus=true.)
A way forward would be multi-platform CI to make sure |
The testsuite fails but does not display diffs. tasty-silver might not yet be portable, see phile314/tasty-silver#16
I am not using tasty-silver personally much any longer, so I am unlikely to investigate this further. Sorry. I am happy to merge PRs and make new releases if necessary, but don't expect anything beyond that. I am also happy to give maintainer access if anybody is interested. |
@phile314 Because Agda depends on tasty-silver, I am happy to become co-maintainer, here and on hackage (https://hackage.haskell.org/package/tasty-silver/maintainers/). I'll likely be conservative (maintaining buildability, CI, fixing critical issues). |
Sounds good to me, I will add you as co-maintainer here and and on hackage :-) |
* [ fix #5302 ] make 'cabal test' work for part of the test-suite 'cabal test' will run only the tests defined by 'agda-tests' * [ #5302 ] CI: work around haskell/cabal#7577 An attempt to get `cabal test` to run after *installing* Agda rather than just building it. * [ #5302 ] disable latex-tests for `cabal test` Mainly for CI, so that we do not have to install LaTeX. * [ #5302 ] disable compiler-stdlib tests for `cabal test` Do not work out of the box, need installation of the stdlib (for `Everything.agda`). * [ #5302 ] CI: `cabal test` also on macOS and Windows * [ #5302 ] `cabal test` macOS: work around haskell/cabal#7209 Cabal removes lower-case vowels from package names on macOS, see haskell/cabal#7209. Thus Agda might be just Agd in error messages reporting source locations. * [ #5302 ] giving up on `cabal test` under Windows The testsuite fails but does not display diffs. tasty-silver might not yet be portable, see phile314/tasty-silver#16 * [ #5302 ] fix the alert printed by `cabal test` Correct reference is `v1-install` in `cabal v1-install --run-tests`. * PR #5536: final polishing
A multi-platform CI is now in place (ee8e237, horray!), but we need to populate the |
I can now reproduce the problem on the Windows CI: https://github.com/phile314/tasty-silver/runs/3527085480?check_suite_focus=true#step:8:12 |
I found out that the indirection via "sh" is to blame, e.g.: tasty-silver/Test/Tasty/Silver/Interactive.hs Line 203 in e910c06
If arguments are not concatenated together as string but passed individually to "git" , the mangling does not happen.In this specific instance, the sh -c wrapper seems superfluous so it is easy to fix. There are other instances where the output is piped into less , this will be less direct to fix:tasty-silver/Test/Tasty/Silver/Interactive.hs Line 230 in e910c06
|
This is WIP for debugging purposes, requires the self-tests to be run in interactive mode.
Slashes are accepted as path separator also under Windows, so maybe this hack is sufficient to fix the problem with name mangling that occurs with backslashes in filenames passed to "sh".
This is WIP for debugging purposes, requires the self-tests to be run in interactive mode.
Slashes are accepted as path separator also under Windows, so maybe this hack is sufficient to fix the problem with name mangling that occurs with backslashes in filenames passed to "sh".
This is WIP for debugging purposes, requires the self-tests to be run in interactive mode.
Slashes are accepted as path separator also under Windows, so maybe this hack is sufficient to fix the problem with name mangling that occurs with backslashes in filenames passed to "sh".
…lling By checking for the existence of external tools like sh, git, less (also wdiff, colordiff) we are trying to make tasty-silver more portable. (E.g. to Windows.)
Use the abstractions from System.Process to invoke a shell; should be more portable.
Automatically accepting tests in batch mode isn't a good idea, see: #31 (comment) So we revert to the previous behavior: interactive tests will fail if EOI is reached.
This is WIP for debugging purposes, requires the self-tests to be run in interactive mode.
Slashes are accepted as path separator also under Windows, so maybe this hack is sufficient to fix the problem with name mangling that occurs with backslashes in filenames passed to "sh".
…lling By checking for the existence of external tools like sh, git, less (also wdiff, colordiff) we are trying to make tasty-silver more portable. (E.g. to Windows.)
Use the abstractions from System.Process to invoke a shell; should be more portable.
Automatically accepting tests in batch mode isn't a good idea, see: #31 (comment) So we revert to the previous behavior: interactive tests will fail if EOI is reached.
Fix released in version 3.3. |
* [ fix #5302 ] make 'cabal test' work for part of the test-suite 'cabal test' will run only the tests defined by 'agda-tests' * [ #5302 ] CI: work around haskell/cabal#7577 An attempt to get `cabal test` to run after *installing* Agda rather than just building it. * [ #5302 ] disable latex-tests for `cabal test` Mainly for CI, so that we do not have to install LaTeX. * [ #5302 ] disable compiler-stdlib tests for `cabal test` Do not work out of the box, need installation of the stdlib (for `Everything.agda`). * [ #5302 ] CI: `cabal test` also on macOS and Windows * [ #5302 ] `cabal test` macOS: work around haskell/cabal#7209 Cabal removes lower-case vowels from package names on macOS, see haskell/cabal#7209. Thus Agda might be just Agd in error messages reporting source locations. * [ #5302 ] giving up on `cabal test` under Windows The testsuite fails but does not display diffs. tasty-silver might not yet be portable, see phile314/tasty-silver#16 * [ #5302 ] fix the alert printed by `cabal test` Correct reference is `v1-install` in `cabal v1-install --run-tests`. * PR #5536: final polishing
I get this error for a very simple test
It seams like all the "\" are gone and that it cant find the correct file.
The text was updated successfully, but these errors were encountered: