Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI cleanup #1477

Merged
merged 4 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)