Skip to content

Run tests requiring hackage-repo-tool on Windows - #5219

Merged
23Skidoo merged 6 commits into
haskell:masterfrom
sebright:appveyor-hackage-repo-tool
May 9, 2018
Merged

23Skidoo merged 6 commits into
haskell:masterfrom
sebright:appveyor-hackage-repo-tool

Conversation

@sebright

Copy link
Copy Markdown
Collaborator

Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [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

@23Skidoo

Copy link
Copy Markdown
Member

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?

@sebright

Copy link
Copy Markdown
Collaborator Author

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.

@hvr

hvr commented Mar 25, 2018

Copy link
Copy Markdown
Member

@sebright
sebright force-pushed the appveyor-hackage-repo-tool branch from 39bed2f to dbd5676 Compare March 25, 2018 20:10
@sebright

Copy link
Copy Markdown
Collaborator Author

Awesome! I updated the PR to use the version from Hackage.

@sebright
sebright force-pushed the appveyor-hackage-repo-tool branch 3 times, most recently from 1a8c711 to 1911c73 Compare March 31, 2018 03:49
@sebright
sebright force-pushed the appveyor-hackage-repo-tool branch from 1911c73 to a629cc0 Compare April 29, 2018 06:08
@sebright

Copy link
Copy Markdown
Collaborator Author

@23Skidoo Do you think this PR is ready to be merged?

sebright added 6 commits May 2, 2018 22:00
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
@sebright
sebright force-pushed the appveyor-hackage-repo-tool branch from a629cc0 to 1826980 Compare May 3, 2018 05:02
@23Skidoo

23Skidoo commented May 9, 2018

Copy link
Copy Markdown
Member

OK, let's merge this now, I'll try to find time to look into CABAL_DIR stuff more closely later.

@23Skidoo
23Skidoo merged commit 3c339d2 into haskell:master May 9, 2018
@23Skidoo

23Skidoo commented May 9, 2018

Copy link
Copy Markdown
Member

Merged, thanks!

@sebright
sebright deleted the appveyor-hackage-repo-tool branch May 13, 2018 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests requiring hackage-repo-tool don't run on Windows. cabal-testsuite tests can access the Hackage package index on Windows

3 participants