Skip to content

Commit b35f304

Browse files
Optimize test-suite
VCS tests are *very* slow; it took a substantial amount of work (this is a squash of 35 commits by two authors with debugging help from @Mistuke as well) to get the test suite and build process fast enough that they can run along with the rest of it in under an hour (the Appveyor limit). Co-authored-by: quasicomputational <[email protected]>
1 parent 80bfc68 commit b35f304

File tree

2 files changed

+31
-42
lines changed

2 files changed

+31
-42
lines changed

appveyor.yml

Lines changed: 25 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,32 @@ install:
66
- refreshenv
77
# See http://help.appveyor.com/discussions/problems/6312-curl-command-not-found#comment_42195491
88
# NB: Do this after refreshenv, otherwise it will be clobbered!
9-
- set PATH=%APPDATA%\cabal\bin;C:\Program Files\Git\mingw64\bin;%PATH%
9+
- set PATH=%APPDATA%\cabal\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\msys64\usr\bin;%PATH%
1010
- cabal --version
11-
- cabal update
12-
# Install parsec, text and mtl, also alex and happy
13-
- echo "" | appveyor-retry cabal install parsec-3.1.13.0 text-1.2.3.0 mtl-2.2.2 alex-3.2.4 happy-1.19.9
11+
- cabal %CABOPTS% update
12+
- cabal %CABOPTS% install happy alex
1413

15-
build_script:
16-
- cd Cabal
17-
- ghc --make -threaded -i -i. Setup.hs -Wall -Werror -XRank2Types -XFlexibleContexts
14+
environment:
15+
global:
16+
CABOPTS: "--store-dir=C:\\SR"
1817

19-
# 'echo "" |' works around an AppVeyor issue:
20-
# https://github.com/commercialhaskell/stack/issues/1097#issuecomment-145747849
21-
- echo "" | ..\appveyor-retry cabal install --only-dependencies --enable-tests
18+
cache:
19+
- dist-newstyle
20+
- "C:\\sr"
2221

23-
- Setup configure --user --ghc-option=-Werror --enable-tests
24-
- Setup build
25-
- Setup test --show-details=streaming --test-option=--hide-successes
26-
- Setup install
27-
- echo "" | cabal install hackage-repo-tool --allow-newer=Cabal,time --constraint="Cabal == 2.3.0.0"
28-
- cd ..\cabal-testsuite
29-
- ghc --make -threaded -i Setup.hs -package Cabal-2.3.0.0
30-
- echo "" | ..\appveyor-retry cabal install --only-dependencies --enable-tests
31-
- Setup configure --user --ghc-option=-Werror --enable-tests
32-
- Setup build
33-
# Must install the test suite, so that our GHCi invocation picks it up
34-
- Setup install
35-
# Copy the setup script into the spot cabal-tests expects it
36-
- mkdir dist\setup
37-
- cp Setup.exe dist\setup
38-
- dist\build\cabal-tests\cabal-tests.exe -j3
39-
# - Setup test --show-details=streaming --test-option=--hide-successes
40-
- cd ..\cabal-install
41-
- ghc --make -threaded -i -i. Setup.hs -Wall -Werror
42-
- echo "" | ..\appveyor-retry cabal install --only-dependencies --enable-tests -flib
43-
- cabal configure --user --ghc-option=-Werror --enable-tests -flib
44-
- cabal build
45-
# update package index again, this time for the cabal under test
46-
- dist\build\cabal\cabal.exe --http-transport=powershell update -v
47-
# run cabal-testsuite first as it has better logging
48-
- cd ..\cabal-testsuite
49-
- dist\build\cabal-tests\cabal-tests.exe -j3 --skip-setup-tests --with-cabal=..\cabal-install\dist\build\cabal\cabal.exe
50-
- cd ..\cabal-install
51-
- cabal test unit-tests --show-details=streaming --test-option="--pattern=! /FileMonitor/" --test-option=--hide-successes
52-
- cabal test integration-tests2 --show-details=streaming --test-option=--hide-successes
53-
- cabal test solver-quickcheck --show-details=streaming --test-option=--quickcheck-tests=1000
54-
- cabal test memory-usage-tests --show-details=streaming
22+
build_script:
23+
- cabal %CABOPTS% new-configure --enable-tests
24+
- appveyor-retry cabal %CABOPTS% new-build lib:Cabal --only-dependencies
25+
- cabal %CABOPTS% new-build lib:Cabal
26+
- appveyor-retry cabal %CABOPTS% new-build Cabal:tests --only-dependencies
27+
- cabal %CABOPTS% new-test Cabal
28+
- appveyor-retry cabal %CABOPTS% new-build exe:cabal exe:cabal-tests --only-dependencies
29+
- cabal %CABOPTS% new-build exe:cabal
30+
- cabal %CABOPTS% new-run cabal-tests -- -j3 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.0.2\cabal-install-2.3.0.0\build\cabal\cabal.exe
31+
- appveyor-retry cabal %CABOPTS% new-build cabal-install:tests --only-dependencies
32+
- cd cabal-install
33+
- cabal %CABOPTS% new-run cabal-install:memory-usage-tests
34+
- cabal %CABOPTS% new-run cabal-install:solver-quickcheck
35+
- cabal %CABOPTS% new-run cabal-install:integration-tests2
36+
- cabal %CABOPTS% new-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/)"
37+

cabal-testsuite/PackageTests/CustomDep/sandbox.test.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import Test.Cabal.Prelude
22
main = cabalTest $ do
33
osx <- isOSX
4+
win <- isWindows
45
-- On Travis OSX, Cabal shipped with GHC 7.8 does not work
56
-- with error "setup: /usr/bin/ar: permission denied"; see
67
-- also https://github.com/haskell/cabal/issues/3938
78
-- This is a hack to make the test not run in this case.
89
when osx $ skipUnless =<< ghcVersionIs (>= mkVersion [7,10])
10+
-- On Appveyor, for some reason this test fails sometimes
11+
-- due to missing symbols in Cabal 1.24. The solution is to
12+
-- use a newer version of GHC that bundles a newer version
13+
-- of Cabal, but for now, we skip.
14+
when win $ skipUnless =<< ghcVersionIs (>= mkVersion [8,2])
915
withSandbox $ do
1016
cabal_sandbox "add-source" ["custom"]
1117
cabal_sandbox "add-source" ["client"]

0 commit comments

Comments
 (0)