diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-10-30 12:21:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-30 12:21:20 -0400 |
commit | f25f05d8ac309b343f8e34e882d92cb8bc78eca3 (patch) | |
tree | 740bbf4fa413357d1e839bd308ab545d1271de96 /tests/rt_generic.sh | |
parent | ec55ea8fc503ad3fb53635d7e9e6d58a63c6684a (diff) | |
parent | 3da6e513cc64990aa865613bd0bb9ba5d6624570 (diff) | |
download | stasis-f25f05d8ac309b343f8e34e882d92cb8bc78eca3.tar.gz |
Merge pull request #65 from jhunkeler/more-rt
More RT
Diffstat (limited to 'tests/rt_generic.sh')
-rw-r--r-- | tests/rt_generic.sh | 125 |
1 files changed, 23 insertions, 102 deletions
diff --git a/tests/rt_generic.sh b/tests/rt_generic.sh index 6e4454c..674f6f0 100644 --- a/tests/rt_generic.sh +++ b/tests/rt_generic.sh @@ -1,110 +1,31 @@ #!/usr/bin/env bash -set -x -unset STASIS_SYSCONFDIR -if [ -n "$GITHUB_TOKEN" ] && [ -z "$STASIS_GH_TOKEN"]; then - export STASIS_GH_TOKEN="$GITHUB_TOKEN" -else - export STASIS_GH_TOKEN="anonymous" -fi -python_versions=( - 3.10 +here="$(dirname ${BASH_SOURCE[0]})" +source $here/setup.sh + +TEST_NAME=generic +PYTHON_VERSIONS=( 3.11 - 3.12 ) -topdir=$(pwd) - -ws="rt_workspace" -rm -rf "$ws" -mkdir -p "$ws" -ws="$(realpath $ws)" - -prefix="$ws"/local -mkdir -p "$prefix" - -bdir="$ws"/build -mkdir -p "$bdir" - -pushd "$bdir" -cmake -DCMAKE_INSTALL_PREFIX="$prefix" -DCMAKE_BUILD_TYPE=Debug "${topdir}"/../.. -make install -export PATH="$prefix/bin:$PATH" -popd - -pushd "$ws" - type -P stasis - type -P stasis_indexer - retcode=0 - - for py_version in "${python_versions[@]}"; do - stasis --python "$py_version" --no-docker --no-artifactory --unbuffered -v "$topdir"/generic.ini - retcode+=$? - done - - set +x - - echo "#### Files ####" - find stasis/*/output | sort - echo - - echo "#### Contents ####" - files=$(find stasis/*/output -type f \( -name '*.yml' -o -name '*.md' -o -name '*.stasis' -o -name '*.ini' \) | sort) - for x in $files; do - echo - echo "FILENAME: $x" - echo - cat "$x" - echo "[EOF]" - echo - - fail_on_main=( - "(null)" - ) - for cond in "${fail_on_main[@]}"; do - if grep --color -H -n "$cond" "$x" >&2; then - echo "ERROR DETECTED IN $x!" >&2 - retcode+=1 - fi - done - done - - # Something above failed, so drop out. Don't bother indexing. - # Don't clean up either. - (( retcode )) && exit $retcode - - fail_on_indexer=( - "(null)" - ) - logfile="stasis_indexer.log" - set -x - stasis_indexer --web --unbuffered -v stasis/* 2>&1 | tee "$logfile" - retcode=$? - - set +x - echo "#### Files ####" - find output +setup_workspace "$TEST_NAME" +run_command install_stasis +for py_version in "${PYTHON_VERSIONS[@]}"; do + run_command run_stasis --python "$py_version" \ + --no-docker \ + --no-artifactory \ + "$TEST_DATA"/"$TEST_NAME".ini +done - for cond in "${fail_on_indexer[@]}"; do - if grep --color -H -n "$cond" "$logfile" >&2; then - echo "ERROR DETECTED IN INDEX OPERATION!" >&2 - exit 1 - fi - done +check_output_add "(null)" +run_command check_output_stasis_dir stasis/*/output +check_output_reset - echo "#### Contents ####" - files=$(find output -type f \( -name '*.html' \) | sort) - for x in $files; do - echo - echo "FILENAME: $x" - echo - cat "$x" - echo "[EOF]" - echo - done -popd +# NOTE: indexer default output directory is "output" +check_output_add "(null)" +run_command run_stasis_indexer stasis +run_command check_output_indexed_dir output +check_output_reset -if [ -z "$RT_KEEP_WORKSPACE" ]; then - rm -rf "$ws" -fi +run_command assert_file_contains "$LOGFILE_STASIS" "USE EXTERNAL" "External packages should have been used" -exit $retcode
\ No newline at end of file +teardown_workspace "$TEST_NAME"
\ No newline at end of file |