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

Enables running test-loop against different lts versions #53

Merged
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
45 changes: 24 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ matrix:
- env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #GHC 8.0.2"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}


- env: BUILD=cabal GHCVER=8.2.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}

- env: BUILD=cabal GHCVER=8.4.4 CABALVER=2.2 HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #GHC 8.4.4"
addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
Expand All @@ -80,32 +84,32 @@ matrix:
# The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
# variable, such as using --stack-yaml to point to a different file.

# - env: BUILD=stack ARGS="--resolver lts-2"
# compiler: ": #stack 7.8.4 (lts-2)"
# addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--stack-yaml stack-lts-6.35.yml"
compiler: ": #stack 7.10.3 (lts-6)"
addons: {apt: {packages: [libgmp-dev]}}

# - env: BUILD=stack ARGS="--resolver lts-3"
# compiler: ": #stack 7.10.2 (lts-3)"
# addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--stack-yaml stack-lts-7.24.yml"
compiler: ": #stack 8.0.1 (lts-7)"
addons: {apt: {packages: [libgmp-dev]}}

# - env: BUILD=stack ARGS="--resolver lts-6"
# compiler: ": #stack 7.10.3 (lts-6)"
# addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--stack-yaml stack-lts-8.24.yml"
compiler: ": #stack 8.0.2 (lts-8)"
addons: {apt: {packages: [libgmp-dev]}}

# - env: BUILD=stack ARGS="--resolver lts-7"
# compiler: ": #stack 8.0.1 (lts-7)"
# addons: {apt: {packages: [libgmp-dev]}}
- env: BUILD=stack ARGS="--stack-yaml stack-lts-9.21.yml"
compiler: ": #stack 8.0.2 (lts-9)"
addons: {apt: {packages: [libgmp-dev]}}

- env: BUILD=stack ARGS="--stack-yaml stack-lts-10.10.yml"
compiler: ": #stack 8.2.2 (lts-10)"
addons: {apt: {packages: [libgmp-dev]}}

# - env: BUILD=stack ARGS="--resolver lts-8"
# compiler: ": #stack 8.0.2 (lts-8)"
# addons: {apt: {packages: [libgmp-dev]}}

# conduit dependency keeps this from working right now, so disabling
#- env: BUILD=stack ARGS="--resolver lts-12"
# compiler: ": #stack 8.4.4 (lts-12)"
# addons: {apt: {packages: [libgmp-dev]}}

- env: BUILD=stack ARGS="--resolver nightly"
- env: BUILD=stack ARGS="--stack-yaml stack-lts-10.10.yml --resolver nightly"
compiler: ": #stack nightly"
addons: {apt: {packages: [libgmp-dev]}}

Expand All @@ -127,14 +131,13 @@ matrix:
# compiler: ": #stack 8.0.2 osx"
# os: osx

- env: BUILD=stack ARGS="--resolver nightly"
- env: BUILD=stack ARGS="--stack-yaml stack-lts-10.10.yml --resolver nightly"
compiler: ": #stack nightly osx"
os: osx

allow_failures:
- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
- env: BUILD=stack ARGS="--resolver lts-12"
- env: BUILD=stack ARGS="--resolver nightly"
- env: BUILD=stack ARGS="--stack-yaml stack-lts-10.10.yml --resolver nightly"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the line above this not need to change to specify the yml file as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, the line above should simply be removed. We're not currently running that build, and once the conduit work is done it won't be an allowed failure either. Good catch.

- os: osx

before_install:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
TEST_CONN_STRING: "host=testdb user=orville_test"
command:
- ./test-loop
- stack-lts-10.10.yml
# A TTY is required for the test-loop script to use
# stack test. stdin_open would be sufficient, but
# allocating a tty provides colorful test output :)
Expand Down
9 changes: 5 additions & 4 deletions orville.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- see: https://github.com/sol/hpack
--
-- hash: 2887e13eb28b2250509d3b06828be61801f3a68888aee11e5967d10545ecd865
-- hash: aac4e11fd334ef1bed06baf6d3200c0b50cfb974602a09751fec28951c6ea9e3

name: orville
version: 0.8.3.0
Expand All @@ -13,6 +13,7 @@ author: Flipstone Technology Partners
maintainer: [email protected]
license: MIT
license-file: LICENSE
tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4
build-type: Simple
cabal-version: >= 1.10
extra-source-files:
Expand Down Expand Up @@ -88,7 +89,7 @@ library
, lifted-base >=0.2
, monad-control >=1.0
, mtl >=2.2
, profunctors >=5.2.1
, profunctors >=5.2
, resource-pool >=0.2
, text
, time >=1.5
Expand Down Expand Up @@ -123,7 +124,7 @@ executable orville-sample-exe
, monad-control >=1.0
, mtl >=2.2
, orville
, profunctors >=5.2.1
, profunctors >=5.2
, resource-pool >=0.2
, text
, time >=1.5
Expand Down Expand Up @@ -177,7 +178,7 @@ test-suite spec
, monad-control >=1.0
, mtl >=2.2
, orville
, profunctors >=5.2.1
, profunctors >=5.2
, resource-pool
, tasty
, tasty-discover
Expand Down
3 changes: 2 additions & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ author: Flipstone Technology Partners
maintainer: [email protected]
license: MIT
git: [email protected]:flipstone/orville.git
tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4
extra-source-files:
- README.md
default-extensions:
Expand All @@ -30,7 +31,7 @@ dependencies:
- HDBC >=2.4
- HDBC-postgresql >=2.3
- mtl >=2.2
- profunctors >= 5.2.1
- profunctors >= 5.2
- resource-pool >=0.2
- text
- time >=1.5
Expand Down
6 changes: 6 additions & 0 deletions stack-lts-10.10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resolver: lts-10.10
Copy link
Contributor

Choose a reason for hiding this comment

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

I recall a conversation around the compiler flags used to build by default given hackage recommendations. After getting some warnings from Orville trying to use -Weverything perhaps we could turn on more strict warnings for these so we see those in CI?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100% sure what you're getting at, but if you're saying you want to simply print warnings during CI I honestly doubt we'd every go and look at them very much. If you're suggesting we make them errors, I'm concerned that trying to make everything to compile on so many different versions without any warnings on any of them might be a lot of effort for not much gain.

I'm not against trying if we think there's value in it, but I'd like to understand what course of action you're specifically suggesting before getting too far down the path.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just trying to get us some way to have visibility into more warnings, especially ones that end up being shown to users of Orville. And since we don't want Weverything to be on for all compiles for package repositories, this seemed like an opportunity to be able to get those warnings in a consistent way.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't buy that having CI spit out warnings is going to cause is to fix them. If our goal is to never have a user see a warning while Orville compiles, we would need to commit to using -Werror and going through whatever gymnastics are necessary to fix all warnings across all compiler versions. At the very least I'm not willing to do that right now.

packages:
- .
extra-deps:
- HDBC-postgresql-2.3.2.5

11 changes: 11 additions & 0 deletions stack-lts-6.35.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resolver: lts-6.35
packages:
- .
extra-deps:
- HDBC-postgresql-2.3.2.5
- unliftio-core-0.1.2.0

# the following dependencies are for
# the test suite
- tasty-discover-2.0.3

7 changes: 7 additions & 0 deletions stack-lts-7.24.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resolver: lts-7.24
packages:
- .
extra-deps:
- HDBC-postgresql-2.3.2.5
- unliftio-core-0.1.2.0

14 changes: 14 additions & 0 deletions stack-lts-8.24.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resolver: lts-8.24
packages:
- .
extra-deps:
- HDBC-postgresql-2.3.2.5
- unliftio-core-0.1.2.0

# lts-8.24 contains tasty-discover-1.1.0 for some reason, which appears to
# have an issuee with tests having the same name if different test modules,
# so we use a different version of tasty-discover to run tests in this lts.
# This doesn't affect the operation of the library itself, which does not
# depend on tasty.
- tasty-discover-2.0.3

6 changes: 6 additions & 0 deletions stack-lts-9.21.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resolver: lts-9.21
packages:
- .
extra-deps:
- HDBC-postgresql-2.3.2.5

70 changes: 0 additions & 70 deletions stack.yaml

This file was deleted.

11 changes: 10 additions & 1 deletion test-loop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

set -e

if [ $# != 1 ]; then
echo "Usage: docker-compose run --rm dev ./test-loop <stack-yaml>"
exit 1
fi

STACK_YAML="$1"

echo "Starting test loop using $STACK_YAML. Use \`docker-compose run --rm dev ./test-loop <stack-yaml>\` to change the stack file used."

# This used to use ghcid, but I was not able to get ghcid to both run the test
# suite *and* compile the sample project to detect errors there. stack test
# --fast is a bit slower than ghcid, but we need to catch all the errors :(
stack test --fast --file-watch
stack --stack-yaml "$STACK_YAML" test --fast --file-watch