<NME> run_rpc_tests.sh
<BEF> #!/bin/bash

set -euo pipefail

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

pushd $DIR/../python

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 install

# Ask cabal where the server is, and if that does work... check
# the places CI will place the executable as a backup
export SAW_SERVER=$(cabal v2-exec which saw-remote-api)
if [[ -x "$SAW_SERVER" ]]; then
  echo "using saw-remote-api at $SAW_SERVER"
elif [[ -x "$DIR/../../dist/bin/saw-remote-api" ]]; then
  export SAW_SERVER="$DIR/../../dist/bin/saw-remote-api"
  echo "using saw-remote-api at $SAW_SERVER"
elif [[ -x "$DIR/../../dist/bin/saw-remote-api.exe" ]]; then
  export SAW_SERVER="$DIR/../../dist/bin/saw-remote-api.exe"
  echo "using saw-remote-api at $SAW_SERVER"
else
  echo "could not locate saw-remote-api executable"
  exit 1
fi


export SAW_SERVER=$(which saw-remote-api)
if [[ ! -x "$SAW_SERVER" ]]; then
  export SAW_SERVER=$(cabal v2-exec which saw-remote-api)
  if [[ ! -x "$SAW_SERVER" ]]; then
    echo "could not locate saw-remote-api executable"
    exit 1
  fi
fi

export CLASSPATH=$(pwd)/tests/saw/test-files

echo "Running saw-remote-api tests..."
echo "Using server $SAW_SERVER"
run_test poetry run python -m unittest discover tests/saw
run_test poetry run python -m unittest discover tests/saw_low_level


popd

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

<MSG> Split testing, add cryptol-saw-core-tc-test via cabal-collect-bins action (#1111)

Testing jobs are separated and parallelized from build jobs, cryptol-saw-core-tc-test from the saw-core submodule is now run, and CI matrix parameters are made more visible at runtime.
<DFF> @@ -13,19 +13,9 @@ function run_test {
 echo "Setting up python environment for remote server clients..."
 poetry install
 
-# Ask cabal where the server is, and if that does work... check
-# the places CI will place the executable as a backup
-export SAW_SERVER=$(cabal v2-exec which saw-remote-api)
-if [[ -x "$SAW_SERVER" ]]; then
-  echo "using saw-remote-api at $SAW_SERVER"
-elif [[ -x "$DIR/../../dist/bin/saw-remote-api" ]]; then
-  export SAW_SERVER="$DIR/../../dist/bin/saw-remote-api"
-  echo "using saw-remote-api at $SAW_SERVER"
-elif [[ -x "$DIR/../../dist/bin/saw-remote-api.exe" ]]; then
-  export SAW_SERVER="$DIR/../../dist/bin/saw-remote-api.exe"
-  echo "using saw-remote-api at $SAW_SERVER"
-else
-  echo "could not locate saw-remote-api executable"
+export SAW_SERVER=$(which saw-remote-api)
+if [[ ! -x "$SAW_SERVER" ]]; then
+  echo "could not locate saw-remote-api executable - try executing with cabal v2-exec"
   exit 1
 fi
 

{'addition_count': 3, 'commit_subject': 'Split testing, add cryptol-saw-core-tc-test via cabal-collect-bins action (#1111)', 'deletion_count': 13, 'file_extension': '.sh', 'lang': 'sh', 'license': 'bsd-3-clause', 'repo_name': 'GaloisInc/saw-script'}