|
23 | 23 |
|
24 | 24 | # Create a temporary directory and store its name in a variable.
|
25 | 25 | TEMPD=$(mktemp -d)
|
| 26 | +KEEP_TEMPD=${KEEP_TEMPD:-''} |
26 | 27 |
|
27 | 28 | # Exit if the temp directory wasn't created successfully.
|
28 | 29 | if [ ! -e "$TEMPD" ]; then
|
29 | 30 | >&2 echo "Failed to create temp directory"
|
30 | 31 | exit 1
|
31 | 32 | fi
|
32 | 33 |
|
33 |
| -# Make sure the temp directory gets removed and kore-rpc-booster gets killed on script exit. |
34 |
| -trap "exit 1" HUP INT PIPE QUIT TERM |
35 |
| -trap 'rm -rf "$TEMPD" && killall kore-rpc-booster || echo "no zombie processes found"' EXIT |
| 34 | +clean_up () { |
| 35 | + if [ -z "$KEEP_TEMPD" ]; then |
| 36 | + rm -rf "$TEMPD" |
| 37 | + fi |
| 38 | + killall kore-rpc-booster || echo "no zombie processes found" |
| 39 | +} |
| 40 | + |
| 41 | +# Make sure the temp directory gets removed (unless KEEP_TEMPD is set) and kore-rpc-booster gets killed on script exit. |
| 42 | +trap "exit 1" HUP INT PIPE QUIT TERM |
| 43 | +trap clean_up EXIT |
36 | 44 |
|
37 | 45 | cd $TEMPD
|
38 | 46 | git clone --depth 1 --branch $KONTROL_VERSION https://github.com/runtimeverification/kontrol.git
|
@@ -93,16 +101,27 @@ master_shell() {
|
93 | 101 | GC_DONT_GC=1 nix develop . --extra-experimental-features 'nix-command flakes' --override-input kevm/k-framework/haskell-backend github:runtimeverification/haskell-backend/$MASTER_COMMIT --command bash -c "$1"
|
94 | 102 | }
|
95 | 103 |
|
| 104 | +# kompile Kontrol's K dependencies |
96 | 105 | feature_shell "poetry install && poetry run kdist --verbose build evm-semantics.plugin evm-semantics.haskell kontrol.foundry --jobs 4"
|
97 | 106 |
|
| 107 | +# kompile the test contracts, to be reused in feature_shell and master_shell. Copy the result from pytest's temp directory |
| 108 | +PYTEST_TEMP_DIR=$TEMPD/pytest-temp-dir |
| 109 | +mkdir -p $PYTEST_TEMP_DIR |
| 110 | +FOUNDRY_DIR=$TEMPD/foundry |
| 111 | +mkdir -p $FOUNDRY_DIR |
| 112 | +feature_shell "make test-integration TEST_ARGS='--basetemp=$PYTEST_TEMP_DIR -n0 --dist=no -k test_foundry_kompile'" |
| 113 | +cp -r $PYTEST_TEMP_DIR/foundry/* $FOUNDRY_DIR |
| 114 | + |
98 | 115 | mkdir -p $SCRIPT_DIR/logs
|
99 | 116 |
|
100 |
| -feature_shell "make test-integration TEST_ARGS='--maxfail=0 --numprocesses=$PYTEST_PARALLEL -vv $BUG_REPORT' | tee $SCRIPT_DIR/logs/kontrol-$KONTROL_VERSION-$FEATURE_BRANCH_NAME.log" |
| 117 | +feature_shell "make test-integration TEST_ARGS='--foundry-root $FOUNDRY_DIR --maxfail=0 --numprocesses=$PYTEST_PARALLEL -vv $BUG_REPORT' | tee $SCRIPT_DIR/logs/kontrol-$KONTROL_VERSION-$FEATURE_BRANCH_NAME.log" |
101 | 118 | killall kore-rpc-booster || echo "no zombie processes found"
|
102 | 119 |
|
103 | 120 | if [ -z "$BUG_REPORT" ]; then
|
104 | 121 | if [ ! -e "$SCRIPT_DIR/logs/kontrol-$KONTROL_VERSION-master-$MASTER_COMMIT_SHORT.log" ]; then
|
105 |
| - master_shell "make test-integration TEST_ARGS='--maxfail=0 --numprocesses=$PYTEST_PARALLEL -vv' | tee $SCRIPT_DIR/logs/kontrol-$KONTROL_VERSION-master-$MASTER_COMMIT_SHORT.log" |
| 122 | + # remove proofs so that they are not reused by the master shell call |
| 123 | + rm -r $FOUNDRY_DIR/out/proofs |
| 124 | + master_shell "make test-integration TEST_ARGS='--foundry-root $FOUNDRY_DIR --maxfail=0 --numprocesses=$PYTEST_PARALLEL -vv' | tee $SCRIPT_DIR/logs/kontrol-$KONTROL_VERSION-master-$MASTER_COMMIT_SHORT.log" |
106 | 125 | killall kore-rpc-booster || echo "no zombie processes found"
|
107 | 126 | fi
|
108 | 127 |
|
|
0 commit comments