Skip to content

Commit

Permalink
Test -l SimplifyJson
Browse files Browse the repository at this point in the history
  • Loading branch information
geo2a committed Mar 7, 2024
1 parent 67cdbf9 commit bf9dd42
Show file tree
Hide file tree
Showing 7 changed files with 20,708 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ for dir in $(ls -d test-*); do
"simplify")
SERVER=$BOOSTER_DEV ./runDirectoryTest.sh test-$name $@
;;
"log-simplify-json")
SERVER="${KORE_RPC_BOOSTER} -l SimplifyJson --log-file test-$name/simplify-log.txt" ./runDirectoryTest.sh test-$name $@
;;
"foundry-bug-report")
SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name --time $@
SERVER=$KORE_RPC_BOOSTER SERVER_OPTS="--interim-simplification 100" ./runDirectoryTest.sh test-$name $@
Expand Down
1 change: 1 addition & 0 deletions test/rpc-integration/resources/log-simplify-json.kore
7 changes: 7 additions & 0 deletions test/rpc-integration/test-log-simplify-json/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Testing logging of equations as JSON

This test sends the request to simplify an initial configuration of a Kontrol proof (based on the `resources/foundry-bug-report.kore` definition).
The `kore-rpc-booster` server is expected to be started with `-l SimplifyJson --log-file test-log-simplify-json/simplify-log.txt`, which ensures that the equation simplification logs are collected by both Booster and Kore and emitted into a file. The log file is compared to `simplify-log.golden.txt`.

Note: this test may turn out to be flaky, as the logs are sensitive to which equations fail to apply in Booster and why.

10,350 changes: 10,350 additions & 0 deletions test/rpc-integration/test-log-simplify-json/simplify-log.txt

Large diffs are not rendered by default.

10,315 changes: 10,315 additions & 0 deletions test/rpc-integration/test-log-simplify-json/simplify-log.txt.golden

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/rpc-integration/test-log-simplify-json/state-002.send

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions test/rpc-integration/test-log-simplify-json/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

set -exuo pipefail

# using variables from runDirectoryTest.sh

echo "client=$client"
echo "dir=$dir"
echo "arguments=$*"

diff="git diff --no-index"
# remove "--regenerate" and tweak $diff if it is present

client_args=""
for arg in $*; do
case "$arg" in
--regenerate)
echo "Re-generating expectation files"
diff="tee"
;;
*)
client_args+=" $arg"
;;
esac
done

# send a simplification request and compare the log files
echo "Running a request which will produce the simplify-log.txt log file"
${client} \
send $dir/state-002.send ${client_args} > /dev/null
${diff} $dir/simplify-log.txt.golden $dir/simplify-log.txt

0 comments on commit bf9dd42

Please sign in to comment.