Skip to content
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

Refactor CI avoiding test circular dependencies #227

Merged
merged 2 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 24 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ env:
# Note: We have to use Cabal 2.4 with GHC 7.0 since for some reason
# builds of "text" fail with GHC 7.0 and Cabal versions prior to 2.4
# https://github.com/haskell/bytestring/issues/213
vdukhovni marked this conversation as resolved.
Show resolved Hide resolved
# With Cabal 2.4 we also get improved syntax in cabal.project files,
# supporting remote sources, and other goodies, so use it across the
# board.
#
- GHCVER=7.0.4 CABALVER=2.4
- GHCVER=7.2.2 CABALVER=1.16
# we have to use CABALVER=1.16 for GHC<7.6 as well, as there's
# no package for earlier cabal versions in the PPA
- GHCVER=7.4.2 CABALVER=1.16
- GHCVER=7.6.3 CABALVER=1.16
- GHCVER=7.8.4 CABALVER=1.18
- GHCVER=7.10.3 CABALVER=1.22
- GHCVER=8.0.2 CABALVER=1.24
- GHCVER=8.2.2 CABALVER=2.0
- GHCVER=8.4.4 CABALVER=2.2
- GHCVER=7.2.2 CABALVER=2.4
- GHCVER=7.4.2 CABALVER=2.4
- GHCVER=7.6.3 CABALVER=2.4
- GHCVER=7.8.4 CABALVER=2.4
- GHCVER=7.10.3 CABALVER=2.4
- GHCVER=8.0.2 CABALVER=2.4
- GHCVER=8.2.2 CABALVER=2.4
- GHCVER=8.4.4 CABALVER=2.4
- GHCVER=8.6.5 CABALVER=2.4
- GHCVER=8.8.3 CABALVER=2.4
- GHCVER=8.10.1 CABALVER=2.4
- GHCVER=8.8.3 CABALVER=3.0
- GHCVER=8.10.1 CABALVER=3.2

### The head in "ppa", currently 8.7, is no longer worth testing.
# - GHCVER=head CABALVER=2.4

Expand All @@ -32,31 +35,19 @@ before_install:

install:
- travis_retry cabal update
# can't use "cabal install --only-dependencies --enable-tests" due to dep-cycle
- cabal install
"QuickCheck >=2.10 && <2.14"
"byteorder ==1.0.*"
"dlist >=0.5 && <0.9"
"mtl >=2.0 && <2.3"
deepseq test-framework-hunit test-framework-quickcheck2

script:
- cabal configure --enable-tests -v2
- cabal build
# --show-details=streaming is available for CABALVER>=1.20 only
- if [ "$(echo -e "1.20\n$CABALVER" | sort -rV | head -n1)" = "$CABALVER" ]; then
cabal test --show-details=streaming;
else
travis_wait cabal test --show-details=always;
fi
- cabal sdist
- cabal v2-configure; cabal v2-build
- cabal v2-sdist -o .
# Remove to enable build of sdist.
- rm -f cabal.project
- (cd tests; cabal v2-configure; cabal v2-test)
# "cabal check" disabled due to -O2 warning
- export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
cd dist/;
if [ -f "$SRC_TGZ" ]; then
cabal install --force-reinstalls "$SRC_TGZ";
- export SRC=$(cabal info . | awk '{print $2; exit}');
if [ -f "$SRC.tar.gz" ]; then
cabal get "./$SRC.tar.gz";
(cd "$SRC"; cabal v2-build);
else
echo "expected '$SRC_TGZ' not found";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, the error message here is not quite right, it should be $SRC.tar.gz not $SRC_TGZ which is no longer set. This should not happen, but if it ever did, the error message would be confusing...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sjakobi Would you care to fix the error message?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too worried about it. Feel free to send a PR or open an issue.

exit 1;
fi

108 changes: 0 additions & 108 deletions bytestring.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -146,111 +146,3 @@ library
if impl(ghc >= 6.9) && impl(ghc < 6.11)
cpp-options: -DINTEGER_GMP
build-depends: integer >= 0.1 && < 0.2


-- QC properties, with GHC RULES disabled
test-suite prop-compiled
type: exitcode-stdio-1.0
main-is: Properties.hs
other-modules: Rules
QuickCheckUtils
TestFramework
Data.ByteString
Data.ByteString.Char8
Data.ByteString.Internal
Data.ByteString.Lazy
Data.ByteString.Lazy.Char8
Data.ByteString.Lazy.Internal
Data.ByteString.Short
Data.ByteString.Short.Internal
Data.ByteString.Unsafe
hs-source-dirs: . tests
build-depends: base, ghc-prim, deepseq, random, directory,
test-framework, test-framework-quickcheck2,
QuickCheck >= 2.10 && < 2.15
c-sources: cbits/fpstring.c
include-dirs: include
ghc-options: -fwarn-unused-binds
-fno-enable-rewrite-rules
-threaded -rtsopts
cpp-options: -DHAVE_TEST_FRAMEWORK=1
default-language: Haskell98
-- older ghc had issues with language pragmas guarded by cpp
if impl(ghc < 7)
default-extensions: CPP, MagicHash, UnboxedTuples,
DeriveDataTypeable, BangPatterns,
NamedFieldPuns

test-suite regressions
-- temporarily disabled as it allocates too much memory
buildable: False
type: exitcode-stdio-1.0
main-is: Regressions.hs
hs-source-dirs: . tests
build-depends: base, ghc-prim, deepseq, random, directory,
test-framework, test-framework-hunit, HUnit
c-sources: cbits/fpstring.c
include-dirs: include
ghc-options: -fwarn-unused-binds
-fno-enable-rewrite-rules
-threaded -rtsopts
default-language: Haskell98
-- older ghc had issues with language pragmas guarded by cpp
if impl(ghc < 7)
default-extensions: CPP, MagicHash, UnboxedTuples,
DeriveDataTypeable, BangPatterns,
NamedFieldPuns

test-suite test-builder
type: exitcode-stdio-1.0
hs-source-dirs: . tests tests/builder
main-is: TestSuite.hs
other-modules: Data.ByteString
Data.ByteString.Internal
Data.ByteString.Lazy
Data.ByteString.Lazy.Internal
Data.ByteString.Short
Data.ByteString.Short.Internal
Data.ByteString.Unsafe
Data.ByteString.Builder
Data.ByteString.Builder.ASCII
Data.ByteString.Builder.Extra
Data.ByteString.Builder.Internal
Data.ByteString.Builder.Prim
Data.ByteString.Builder.Prim.ASCII
Data.ByteString.Builder.Prim.Binary
Data.ByteString.Builder.Prim.Internal
Data.ByteString.Builder.Prim.Internal.Base16
Data.ByteString.Builder.Prim.Internal.Floating
Data.ByteString.Builder.Prim.Internal.UncheckedShifts
Data.ByteString.Builder.Prim.TestUtils
Data.ByteString.Builder.Prim.Tests
Data.ByteString.Builder.Tests
TestFramework
build-depends: base, ghc-prim,
deepseq,
QuickCheck >= 2.10 && < 2.15,
byteorder == 1.0.*,
dlist >= 0.5 && < 0.9,
directory,
mtl >= 2.0 && < 2.3,
HUnit,
test-framework,
test-framework-hunit,
test-framework-quickcheck2

ghc-options: -Wall -fwarn-tabs -threaded -rtsopts
cpp-options: -DHAVE_TEST_FRAMEWORK=1

default-language: Haskell98
-- older ghc had issues with language pragmas guarded by cpp
if impl(ghc < 7)
default-extensions: CPP, MagicHash, UnboxedTuples,
DeriveDataTypeable, BangPatterns,
NamedFieldPuns

c-sources: cbits/fpstring.c
cbits/itoa.c
include-dirs: include
includes: fpstring.h
install-includes: fpstring.h
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages: bytestring.cabal
tests: False
benchmarks: False
vdukhovni marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion tests/builder/Data/ByteString/Builder/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Control.Monad.Writer
import Foreign (Word, Word8, minusPtr)
import System.IO.Unsafe (unsafePerformIO)

import Data.Char (ord, chr)
import Data.Char (chr)
import qualified Data.DList as D
import Data.Foldable (asum, foldMap)

Expand Down
48 changes: 35 additions & 13 deletions tests/bytestring-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ flag integer-simple
default: False

-- QC properties, with GHC RULES disabled
executable prop-compiled
test-suite prop-compiled
type: exitcode-stdio-1.0
main-is: Properties.hs
other-modules: Rules
QuickCheckUtils
Data.ByteString
Data.ByteString.Char8
Data.ByteString.Internal
Data.ByteString.Lazy
Data.ByteString.Lazy.Char8
Data.ByteString.Lazy.Internal
Data.ByteString.Short
Data.ByteString.Short.Internal
Data.ByteString.Unsafe
hs-source-dirs: . ..
build-depends: base, ghc-prim, deepseq, random, directory,
test-framework, test-framework-quickcheck2,
Expand All @@ -37,13 +47,14 @@ executable prop-compiled
extensions: BangPatterns
UnliftedFFITypes,
MagicHash,
UnboxedTuples,
DeriveDataTypeable
ScopedTypeVariables
NamedFieldPuns

executable regressions
vdukhovni marked this conversation as resolved.
Show resolved Hide resolved
main-is: Regressions.hs
other-modules: Data.ByteString
Data.ByteString.Internal
Data.ByteString.Unsafe
hs-source-dirs: . ..
build-depends: base, ghc-prim, deepseq, random, directory,
test-framework, test-framework-hunit, HUnit
Expand All @@ -56,18 +67,34 @@ executable regressions
extensions: BangPatterns
UnliftedFFITypes,
MagicHash,
UnboxedTuples,
DeriveDataTypeable
ScopedTypeVariables
NamedFieldPuns

executable test-builder
test-suite test-builder
type: exitcode-stdio-1.0
hs-source-dirs: . .. builder
main-is: TestSuite.hs
other-modules: Data.ByteString.Builder.Tests
Data.ByteString.Builder.Prim.Tests
Data.ByteString.Builder.Prim.TestUtils

Data.ByteString
Data.ByteString.Builder
Data.ByteString.Builder.ASCII
Data.ByteString.Builder.Extra
Data.ByteString.Builder.Internal
Data.ByteString.Builder.Prim
Data.ByteString.Builder.Prim.ASCII
Data.ByteString.Builder.Prim.Binary
Data.ByteString.Builder.Prim.Internal
Data.ByteString.Builder.Prim.Internal.Base16
Data.ByteString.Builder.Prim.Internal.Floating
Data.ByteString.Builder.Prim.Internal.UncheckedShifts
Data.ByteString.Internal
Data.ByteString.Lazy
Data.ByteString.Lazy.Internal
Data.ByteString.Short
Data.ByteString.Short.Internal
Data.ByteString.Unsafe
build-depends: base, ghc-prim,
deepseq,
QuickCheck >= 2.10 && < 2.15,
Expand All @@ -79,20 +106,15 @@ executable test-builder
test-framework,
test-framework-hunit,
test-framework-quickcheck2 >= 0.3

cpp-options: -DHAVE_TEST_FRAMEWORK=1
ghc-options: -Wall -fwarn-tabs -fhpc -threaded -rtsopts

ghc-options: -Wall -fwarn-tabs -threaded -rtsopts
extensions: CPP, ForeignFunctionInterface
UnliftedFFITypes,
MagicHash,
UnboxedTuples,
DeriveDataTypeable
ScopedTypeVariables
Rank2Types
BangPatterns
NamedFieldPuns

c-sources: ../cbits/fpstring.c
../cbits/itoa.c
include-dirs: ../include
Expand Down
2 changes: 2 additions & 0 deletions tests/cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages: bytestring-tests.cabal
tests: True