11#! /bin/bash
22set -eu -o pipefail
33
4- # Run init-environment script to prepare filesystem for GitHub CI caching.
5- #
6- # Normally the init-environment script prints variables in format that GitHub CI
7- # understands[1]. Setting GITHUB_ACTIONS to other value than true turns it into
8- # format that can be fed into eval. We don't necessarily need the variables it
9- # produces. Those are used only in workflow (cache related variables). But
10- # someone may initialize more variables there anyway and expect to see them in
11- # integration tests.
12- #
13- # When [2] is fixed, we can remove this and run whole job in the rchain/buildenv
14- # container. See comments in run_integration_tests job for more information.
15- #
16- # [1] https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-environment-variable-set-env
17- # [2] https://github.community/t5/GitHub-Actions/Container-volumes-key-not-mounting-volume/m-p/34798
18- eval " $( GITHUB_ACTIONS= ./.github/init-environment || echo false) "
19-
204# Store virtualenv in integration-tests/.venv instead of the magic path with
215# hash that Pipenv creates, so that it remains on known path for easy caching.
226export PIPENV_VENV_IN_PROJECT=1
@@ -28,19 +12,20 @@ export PIPENV_VENV_IN_PROJECT=1
2812# printed after all tests finish.
2913export PYTEST_ADDOPTS=" ${PYTEST_ADDOPTS-} --log-cli-level=ERROR"
3014
15+ # The virtual environment should have been initialized at this point.
16+ export _SKIP_VIRTUALENV_INIT=1
17+
3118if [[ $TESTS != REMAINDER ]]; then
3219 # Check code (Pylint & mypy) only once, when running the REMAINDER
3320 # selection. Do not remove/modify REMAINDER selection!
3421 export _SKIP_CHECK_CODE=1
3522fi
3623
37- test_selection=" $( ./.github/print-integration-test-selection) "
38-
39-
40- cd integration-tests/
24+ GITHUB_DIR=" $( dirname " $0 " ) "
25+ TEST_SELECTION=" $( " $GITHUB_DIR /print-integration-test-selection" ) "
4126
4227ret=0
43- ./run_tests -k " $test_selection " || ret=$?
28+ ./run_tests -k " $TEST_SELECTION " || ret=$?
4429
4530# Exit code 5: No tests were collected
4631# Source: http://doc.pytest.org/en/latest/usage.html#possible-exit-codes
0 commit comments