cryptol/cryptol-remote-api/run_rpc_tests.sh
Ryan Scott d602858ea4
CI: Don't run poetry update (#1586)
This causes `poetry` to regenerate the `poetry.lock` file with newer versions
of dependencies, which defeats the point of checking in the lock file in the
first place.

This mirrors a similar change applied to SAW's CI in
67a25a81c4.
The use of `poetry update` isn't actively causing problems with Cryptol's CI
yet, but better to be safe than sorry.
2023-11-03 12:20:18 -04:00

40 lines
967 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd $DIR/python
NUM_FAILS=0
run_test() {
"$@"
if (( $? != 0 )); then NUM_FAILS=$(($NUM_FAILS+1)); fi
}
cabal-which() {
which $1 || cabal v2-exec which $1 || { echo "could not locate $1 executable" >&2 && exit 1; }
}
get_server() {
CRYPTOL_SERVER=$(cabal-which $1)
export CRYPTOL_SERVER
echo "Using server $CRYPTOL_SERVER"
}
echo "Setting up python environment for remote server clients..."
poetry install
echo "Typechecking code with mypy..."
run_test poetry run mypy --install-types --non-interactive cryptol/ tests/
get_server cryptol-remote-api
echo "Running cryptol-remote-api tests..."
run_test poetry run python -m unittest discover --verbose tests/cryptol
get_server cryptol-eval-server
echo "Running cryptol-eval-server tests..."
run_test poetry run python -m unittest discover --verbose tests/cryptol_eval
popd