mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-19 12:56:08 +00:00
Merge pull request #1042 from jamesdbrock/test-nbconvert
Stable nbconvert acceptance test
This commit is contained in:
commit
30c01eaf6e
26
.travis.yml
26
.travis.yml
@ -78,10 +78,7 @@ matrix:
|
||||
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
|
||||
stack install --fast
|
||||
stack exec -- ihaskell install --stack
|
||||
stack exec -- jupyter nbconvert --to=notebook --execute --allow-errors --stdout notebooks/IHaskell.ipynb > ~/ihaskell-out.ipynb
|
||||
|
||||
# Images are rendered differently on different systems, so filter them out in the comparison
|
||||
diff <(egrep -v 'image/png|version|pygments' ~/ihaskell-out.ipynb) <(egrep -v 'image/png|version|pygments' notebooks/IHaskell.ipynb)
|
||||
test/acceptance.nbconvert.sh stack exec -- jupyter nbconvert
|
||||
fi
|
||||
- env: DISPLAY=true USE_STACK_YAML="stack-8.2.yaml" # GHC 8.2.2
|
||||
language: python
|
||||
@ -158,10 +155,7 @@ matrix:
|
||||
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
|
||||
stack install --fast
|
||||
stack exec -- ihaskell install --stack
|
||||
stack exec -- jupyter nbconvert --to=notebook --execute --allow-errors --stdout notebooks/IHaskell.ipynb > ~/ihaskell-out.ipynb
|
||||
|
||||
# Images are rendered differently on different systems, so filter them out in the comparison
|
||||
diff <(egrep -v 'image/png|version|pygments' ~/ihaskell-out.ipynb) <(egrep -v 'image/png|version|pygments' notebooks/IHaskell.ipynb)
|
||||
test/acceptance.nbconvert.sh stack exec -- jupyter nbconvert
|
||||
fi
|
||||
- env: DISPLAY=true USE_STACK_YAML="stack-8.4.yaml" # GHC 8.4.3
|
||||
language: python
|
||||
@ -238,10 +232,7 @@ matrix:
|
||||
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
|
||||
stack install --fast
|
||||
stack exec -- ihaskell install --stack
|
||||
stack exec -- jupyter nbconvert --to=notebook --execute --allow-errors --stdout notebooks/IHaskell.ipynb > ~/ihaskell-out.ipynb
|
||||
|
||||
# Images are rendered differently on different systems, so filter them out in the comparison
|
||||
diff <(egrep -v 'image/png|version|pygments' ~/ihaskell-out.ipynb) <(egrep -v 'image/png|version|pygments' notebooks/IHaskell.ipynb)
|
||||
test/acceptance.nbconvert.sh stack exec -- jupyter nbconvert
|
||||
fi
|
||||
- env: DISPLAY=false USE_STACK_YAML="stack.yaml" # GHC 8.6.3
|
||||
language: python
|
||||
@ -318,10 +309,7 @@ matrix:
|
||||
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
|
||||
stack install --fast
|
||||
stack exec -- ihaskell install --stack
|
||||
stack exec -- jupyter nbconvert --to=notebook --execute --allow-errors --stdout notebooks/IHaskell.ipynb > ~/ihaskell-out.ipynb
|
||||
|
||||
# Images are rendered differently on different systems, so filter them out in the comparison
|
||||
diff <(egrep -v 'image/png|version|pygments' ~/ihaskell-out.ipynb) <(egrep -v 'image/png|version|pygments' notebooks/IHaskell.ipynb)
|
||||
test/acceptance.nbconvert.sh stack exec -- jupyter nbconvert
|
||||
fi
|
||||
- language: nix
|
||||
dist: xenial
|
||||
@ -352,8 +340,7 @@ matrix:
|
||||
ihaskell-plot
|
||||
ihaskell-static-canvas
|
||||
])'
|
||||
- result/bin/ihaskell-nbconvert --to=notebook --execute --allow-errors --stdout notebooks/IHaskell.ipynb > ~/ihaskell-out.ipynb
|
||||
- diff <(egrep -v 'image/png|version|pygments' ~/ihaskell-out.ipynb) <(egrep -v 'image/png|version|pygments' notebooks/IHaskell.ipynb)
|
||||
- test/acceptance.nbconvert.sh result/bin/ihaskell-nbconvert
|
||||
- language: nix
|
||||
dist: xenial
|
||||
env: RELEASE_NIX="release-8.2.nix"
|
||||
@ -383,5 +370,4 @@ matrix:
|
||||
ihaskell-plot
|
||||
ihaskell-static-canvas
|
||||
])'
|
||||
- result/bin/ihaskell-nbconvert --to=notebook --execute --allow-errors --stdout notebooks/IHaskell.ipynb > ~/ihaskell-out.ipynb
|
||||
- diff <(egrep -v 'image/png|version|pygments' ~/ihaskell-out.ipynb) <(egrep -v 'image/png|version|pygments' notebooks/IHaskell.ipynb)
|
||||
- test/acceptance.nbconvert.sh result/bin/ihaskell-nbconvert
|
||||
|
2
test/.gitignore
vendored
Normal file
2
test/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
A
|
||||
acceptance.nbconvert.out.ipynb
|
1155
test/acceptance.nbconvert.in.ipynb
Normal file
1155
test/acceptance.nbconvert.in.ipynb
Normal file
File diff suppressed because it is too large
Load Diff
33
test/acceptance.nbconvert.sh
Executable file
33
test/acceptance.nbconvert.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Run nbconvert acceptance tests
|
||||
# ------------------------------
|
||||
#
|
||||
# This script must be called from the root directory of IHaskell.
|
||||
#
|
||||
# Positional arguments to this script are the invocation for `nbconvert`.
|
||||
# For example:
|
||||
#
|
||||
# Invoke from the the root IHaskell directory:
|
||||
#
|
||||
# test/acceptance.nbconvert.sh jupyter nbconvert
|
||||
#
|
||||
# Invoke with `stack` from the the root IHaskell directory:
|
||||
#
|
||||
# test/acceptance.nbconvert.sh stack exec -- jupyter nbconvert
|
||||
#
|
||||
# Invoke with Stack+Docker from the the root IHaskell directory:
|
||||
#
|
||||
# test/acceptance.nbconvert.sh stack --docker exec -- jupyter nbconvert
|
||||
#
|
||||
# Invoke with Nix from the root IHaskell directory:
|
||||
#
|
||||
# test/acceptance.nbconvert.sh result/bin/ihaskell-nbconvert
|
||||
#
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
$* --to=notebook --execute --allow-errors --stdout test/acceptance.nbconvert.in.ipynb > test/acceptance.nbconvert.out.ipynb
|
||||
|
||||
diff <(grep -v 'version' test/acceptance.nbconvert.in.ipynb) <(grep -v 'version' test/acceptance.nbconvert.out.ipynb)
|
||||
|
Loading…
x
Reference in New Issue
Block a user