Skip to content

Commit

Permalink
Merge pull request #1477 from GaloisInc/at-ci-cleanup
Browse files Browse the repository at this point in the history
CI cleanup
  • Loading branch information
mergify[bot] authored Oct 20, 2021
2 parents 156e9d6 + ea7185b commit a6cfd61
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 45 deletions.
3 changes: 3 additions & 0 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ zip_dist() {

zip_dist_with_solvers() {
sname="${1}"
# Because these binaries come from the what4-solvers repository, they
# should be at least as portable (in terms of dynamic library
# dependencies) as the SAW binaries.
cp "$BIN/abc" dist/bin/
cp "$BIN/cvc4" dist/bin/
cp "$BIN/yices" dist/bin/
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Overall configuration notes:
# - Artifact uploads for binaries are from GHC 8.10.3
# - Builds for Ubuntu happen on 18.04 (would like to include 20.04, in addition)
# - Builds for macOS builds on 10.15 (to avoid GHC bug on macOS 11; solvable with GHC > 8.10.4)
# - Docker builds happen nightly, on manual invocation, and on release branch commits
# Please update this comment as those details change.

name: SAWScript
on:
push:
Expand All @@ -12,9 +19,10 @@ env:
CACHE_VERSION: 1
DISABLED_TESTS: "test0000 test_FNV_a1_rev test0010_jss_cnf_exp test0039_rust test_boilerplate test_external_abc"

# Solver versions - also update in the following locations:
# Solver package snapshot date - also update in the following locations:
# ./saw/Dockerfile
# ./saw-remote-api/Dockerfile
# ./s2nTests/scripts/blst-entrypoint.sh
# ./s2nTests/docker/saw.dockerfile
SOLVER_PKG_VERSION: "snapshot-20210917"

Expand Down
86 changes: 42 additions & 44 deletions saw-remote-api/scripts/test_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,55 @@

echo "Testing saw-remote-api docker image..."

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

TAG=${1:-saw-remote-api}
cleanup () {
echo "killing saw-remote-api docker container"
docker container kill saw-remote-api || true
docker container rm saw-remote-api || true
}
trap cleanup EXIT

pushd $DIR/..
DIR="$( dirname "$( dirname "${BASH_SOURCE[0]}" )")"

docker run --name=saw-remote-api -d \
--env CLASSPATH=/home/saw/tests/saw/test-files \
-v $PWD/python/tests/saw/test-files:/home/saw/tests/saw/test-files \
-p 8080:8080 \
"$TAG"
TAG=${1:-saw-remote-api}

if (( $? != 0 )); then
echo "Failed to launch docker container"
exit 1
fi
( cd "$DIR";
docker run --name=saw-remote-api -d \
--env CLASSPATH=/home/saw/tests/saw/test-files \
-v $PWD/python/tests/saw/test-files:/home/saw/tests/saw/test-files \
-p 8080:8080 \
"$TAG";

popd
if (( $? != 0 )); then
echo "Failed to launch docker container"
exit 1
fi
)

sleep 5 # let the server catch its breath and be ready for requests

pushd $DIR/../python
( cd "$DIR/python";

NUM_FAILS=0
function run_test {
NUM_FAILS=0;
function run_test {
"$@"
if (( $? != 0 )); then NUM_FAILS=$(($NUM_FAILS+1)); fi
}


echo "Setting up python environment for remote server clients..."
poetry update
poetry install

export SAW_SERVER_URL="http://localhost:8080/"
run_test poetry run python -m unittest discover tests/saw
run_test poetry run python -m unittest discover tests/saw_low_level

popd

echo "killing saw-remote-api docker container"

docker container kill saw-remote-api
docker container rm saw-remote-api


if [ $NUM_FAILS -eq 0 ]
then
echo "All docker saw-remote-api tests passed"
exit 0
else
echo "Some docker saw-remote-api tests failed"
exit 1
fi
};


echo "Setting up python environment for remote server clients...";
poetry update;
poetry install;

export SAW_SERVER_URL="http://localhost:8080/";
run_test poetry run python -m unittest discover tests/saw;
run_test poetry run python -m unittest discover tests/saw_low_level;

if [ $NUM_FAILS -eq 0 ]
then
echo "All docker saw-remote-api tests passed"
exit 0
else
echo "Some docker saw-remote-api tests failed"
exit 1
fi
)

0 comments on commit a6cfd61

Please sign in to comment.