-
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
Setup CI to run tests on Windows #164
Comments
@dcastro I will try to run bats on my windows machine first, to see how bad things are, and then will try to learn how to add github actions. Am I right that windows machine will be hosted not on buildkite but on GitHub? |
@dcastro that's what I gotv when simply run
"Funny" thing is that I can not reproduce that, and now I see question marks or some codes instead of some non-ascii symbols. I think maybe we should disable progress bar and output coloring (as in #185) by default on Windows using conditional compilation - this is working in vscode but not in standard porwershell or cmd, where output contains many lines like this:
Interesting fact: if I launch GHCi in cmd, coloring works normally, so maybe we could fix it Also symbols ✓, ➥ and ⛀ (which we use for reports) are displayed as questionmarks anywhere (even in vscode terminal), and when I try to print them in GHCi, I see this old message
|
I learned how to run bats inside so called Git Bash (mingw) , which looks like the only way to run them on windows, and almost all test s are failed, but for expected reasons 1: slashes in messages
(Did not tested advanced things with relative links, i.e. #165 yet) We want that tests to pass, so I think that we should always use By the way, coloring and progress bar are displayed correctly in this shell, I think we can recommend it to xrefcheck-windows users since it comes with git. Also I think that I will need to discover how to launch it in github-actions |
Actually, |
Problem: we are not testing behavior of xrefcheck on Windows Solution: test locally and add workflow to run golden and tasty tests on CI via github-actions windows runner
Problem: we are not testing behavior of xrefcheck on Windows Solution: test locally and add workflow to run golden and tasty tests on CI via github-actions windows runner
…for running Windows tests on CI
…rkflow for running Windows tests on CI
Problem: we are not testing behavior of xrefcheck on Windows Solution: test locally and add workflow to run golden and tasty tests on CI via github-actions windows runner
…for running Windows tests on CI
Problem: we are not testing behavior of xrefcheck on Windows Solution: test locally and add workflow to run golden and tasty tests on CI via github-actions windows runner
Problem: we are not testing behavior of xrefcheck on Windows Solution: and add workflow to run golden and tasty tests on CI via github-actions windows runner Some subproblems appear: 1. Problem: CI build fails beacuse it needs `pcre` package Solution: add it (somehow), see `install pacman dependencies` in ci.yml 2. Problem: Network errors displayed different on different platforms Solution: collect output from both and use `assert_diff expected_linux.gold || assert_diff expected_windows.gold` 3: Problem: "Config matches" test is failing because checkout action clone files with CRLF, and test assert equality of two ByteStrings Solution: manually remove CR
Problem: xrefcheck uses utf8 symbols in reports, which are not supported on most of Windows shells by default. Sometimes they are printed as question marks (and it cause golden tests to fail) and sometimes printing of them raise an error. Solution: use function `withCP65001` from `code-page` package which sets correct codepage on Windows and do nothing on other OSs
Problem: in markdown links, '/' should always be used as path separator , e.g. GitHub renderer is not threating link `[x](a\b.md)` as a link to file in dir `a` We use OS-dependent file separators everywhere, so e.g. `canonizeLocalRef "./a.md"="./a.md`"` on Windows Solution: replace '\' to '/' while constructing repo tree if needed and then use only '/', preferring functions from `System.FilePath.Posix`. We can do this, since 'a/b' and `a\b` are equivalent paths on Windows
Problem: we are not testing behavior of xrefcheck on Windows Solution: and add workflow to run golden and tasty tests on CI via github-actions windows runner Some subproblems appear: 1. Problem: CI build fails beacuse it needs `pcre` package Solution: add it (somehow), see `install pacman dependencies` in ci.yml 2. Problem: Network errors displayed different on different platforms Solution: collect output from both and use `assert_diff expected_linux.gold || assert_diff expected_windows.gold` 3: Problem: "Config matches" test is failing because checkout action clone files with CRLF, and test assert equality of two ByteStrings Solution: manually remove CR
Problem: xrefcheck uses utf8 symbols in reports, which are not supported on most of Windows shells by default. Sometimes they are printed as question marks (and it cause golden tests to fail) and sometimes printing of them raise an error. Solution: use function `withCP65001` from `code-page` package which sets correct codepage on Windows and do nothing on other OSs
Problem: in markdown links, '/' should always be used as path separator , e.g. GitHub renderer is not threating link `[x](a\b.md)` as a link to file in dir `a` We use OS-dependent file separators everywhere, so e.g. `canonizeLocalRef "./a.md"="./a.md`"` on Windows Solution: replace '\' to '/' while constructing repo tree if needed and then use only '/', preferring functions from `System.FilePath.Posix`. We can do this, since 'a/b' and `a\b` are equivalent paths on Windows
Problem: we are not testing behavior of xrefcheck on Windows Solution: and add workflow to run golden and tasty tests on CI via github-actions windows runner Some subproblems appear: 1. Problem: CI build fails beacuse it needs `pcre` package Solution: add it (somehow), see `install pacman dependencies` in ci.yml 2. Problem: Network errors displayed different on different platforms Solution: collect output from both and use `assert_diff expected_linux.gold || assert_diff expected_windows.gold` 3: Problem: "Config matches" test is failing because checkout action clone files with CRLF, and test assert equality of two ByteStrings Solution: manually remove CR
Problem: we are not testing behavior of xrefcheck on Windows Solution: and add workflow to run golden and tasty tests on CI via github-actions windows runner Some subproblems appear: 1. Problem: CI build fails beacuse it needs `pcre` package Solution: add it (somehow), see `install pacman dependencies` in ci.yml 2. Problem: Network errors displayed different on different platforms Solution: collect output from both and use `assert_diff expected_linux.gold || assert_diff expected_windows.gold` 3: Problem: "Config matches" test is failing because checkout action clone files with CRLF, and test assert equality of two ByteStrings Solution: manually remove CR
Problem: xrefcheck uses utf8 symbols in reports, which are not supported on most of Windows shells by default. Sometimes they are printed as question marks (and it cause golden tests to fail) and sometimes printing of them raise an error. Solution: use function `withCP65001` from `code-page` package which sets correct codepage on Windows and do nothing on other OSs
Problem: in markdown links, '/' should always be used as path separator , e.g. GitHub renderer is not threating link `[x](a\b.md)` as a link to file in dir `a` We use OS-dependent file separators everywhere, so e.g. `canonizeLocalRef "./a.md"="./a.md`"` on Windows Solution: replace '\' to '/' while constructing repo tree if needed and then use only '/', preferring functions from `System.FilePath.Posix`. We can do this, since 'a/b' and `a\b` are equivalent paths on Windows
Problem: we are not testing behavior of xrefcheck on Windows Solution: and add workflow to run golden and tasty tests on CI via github-actions windows runner Some subproblems appear: 1. Problem: CI build fails beacuse it needs `pcre` package Solution: add it (somehow), see `install pacman dependencies` in ci.yml 2. Problem: Network errors displayed different on different platforms Solution: collect output from both and use `assert_diff expected_linux.gold || assert_diff expected_windows.gold` 3: Problem: "Config matches" test is failing because checkout action clone files with CRLF, and test assert equality of two ByteStrings Solution: manually remove CR
Problem: we are not testing behavior of xrefcheck on Windows Solution: and add workflow to run golden and tasty tests on CI via github-actions windows runner Some subproblems appear: 1. Problem: CI build fails beacuse it needs `pcre` package Solution: add it (somehow), see `install pacman dependencies` in ci.yml 2. Problem: Network errors displayed different on different platforms Solution: collect output from both and use `assert_diff expected_linux.gold || assert_diff expected_windows.gold` 3: Problem: "Config matches" test is failing because checkout action clone files with CRLF, and test assert equality of two ByteStrings Solution: manually remove CR
…ests [#164] Improve Windows support
Clarification and motivation
NB: we should probably do #165 first
We've been building and releasing windows binaries, but we haven't actually tested that they indeed work.
The readme also lists "Support for non-Unix systems" under the "For further work" section, so maybe we should invest some time into this.
The first thing to do is to setup a CI to run the haskell and bats tests on windows. GitHub Actions is probably the best way to set this up, see an example we can reuse here. The bats docs say it supports Windows, so this should be doable.
When this is up and running, we may (hopefully not) find some bugs, in which case we'll open more follow-up issues.
A few things that I think may be bugs:
[a](b\c)
. Github and gitlab both interpret this as a link to a file namedb%5Cc
. But on a windows machine, will xrefcheck interpret this as a link to the filec
in dirb
?rLink
to be an "absolute reference" and begin with a/
. Appending it toroot
with<>
works on linux, but will this behave correctly on windows?xrefcheck/src/Xrefcheck/Verify.hs
Line 319 in 955e0ea
Acceptance criteria
The text was updated successfully, but these errors were encountered: