-
Notifications
You must be signed in to change notification settings - Fork 701
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
Run tests requiring hackage-repo-tool on Windows #5219
Conversation
Thanks, this is very nice. Re: CABAL_DIR - I may be mistaken, but didn't we already have something like that in the test suite to make it use a non-default .cabal dir? |
Thanks. I wasn't able to find an existing way to override the cabal directory. I thought that cabal-testsuite only set HOME, which doesn't work on Windows. The closest feature I could find was CABAL_CONFIG, which only overrides the config file location. |
@23Skidoo @grayjay fyi, I just published http://hackage.haskell.org/package/hackage-repo-tool-0.1.1.1 |
39bed2f
to
dbd5676
Compare
Awesome! I updated the PR to use the version from Hackage. |
1a8c711
to
1911c73
Compare
1911c73
to
a629cc0
Compare
@23Skidoo Do you think this PR is ready to be merged? |
CABAL_DIR can be used to run integration tests independently on Windows, since setting HOME doesn't affect the location of the APPDATA directory.
This change gives each test a new cabal directory on Windows and prevents the tests from accessing the user's cabal directory. This commit also re-enables PackageTests/Regression/T4154/install-time-with-constraint.test.hs on Windows.
This commit uses a temporary directory for the nix store in several of the new-build tests in cabal-testsuite. The directory is given a very short path on Windows in order to avoid issues with long store paths.
This commit uses a relative path to specify the test remote repository on Windows, to avoid the path conversion issue described in haskell#5218.
…haskell#5204). I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
a629cc0
to
1826980
Compare
OK, let's merge this now, I'll try to find time to look into |
Merged, thanks! |
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!
This PR installs hackage-repo-tool in the AppVeyor build and works around several issues to allow the tests to run. The commits are:
Run tar with --force-local on Windows in cabal-tests, to handle colons in paths.
Add CABAL_DIR environment variable for specifying the cabal directory.
CABAL_DIR can be used to run integration tests independently on Windows,
since setting HOME doesn't affect the location of the APPDATA directory.
Set CABAL_DIR in cabal-tests (fixes #5187).
This change gives each test a new cabal directory on Windows and prevents the
tests from accessing the user's cabal directory.
This commit also re-enables
PackageTests/Regression/T4154/install-time-with-constraint.test.hs on Windows.
Work around issue #4515 in several new-build integration tests.
This commit uses a temporary directory for the nix store in several of the
new-build tests in cabal-testsuite. The directory is given a very short path on
Windows in order to avoid issues with long store paths.
Work around issue #5218 in cabal-testsuite.
This commit uses a relative path to specify the test remote repository on
Windows, to avoid the path conversion issue described in #5218.
Use hackage-repo-tool when running cabal-testsuite on AppVeyor (closes #5204).
appveyor.yml currently downloads hackage-security from Github, since the changes
that allow building on Windows haven't been released yet.
I disabled one test that still fails on Windows:
PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
The only non-test change is the CABAL_DIR environment variable for overriding the cabal directory. I'm not completely sure that is the right solution for preventing the tests from accessing the user's cabal directory, since it could cause an incompatibility between cabal-install and older custom setup executables that don't recognize the variable. (I only tested it by building cabal-install, so far.) Does it make sense to add the variable only for testing?
/cc @23Skidoo @ezyang