diff --git a/pkg/be/local/shell/spawn.go b/pkg/be/local/shell/spawn.go index 88057e05..117c987c 100644 --- a/pkg/be/local/shell/spawn.go +++ b/pkg/be/local/shell/spawn.go @@ -86,6 +86,7 @@ func addEnv(c llir.ShellComponent, q llir.Queue) ([]string, error) { "LUNCHPAIL_POD_NAME=" + c.InstanceName, "TEST_QUEUE_ENDPOINT=" + q.Endpoint, "LUNCHPAIL_TARGET=local", + "PYTHONUNBUFFERED=1", } env, err = addAppEnv(env, c) diff --git a/tests/bin/run.sh b/tests/bin/run.sh index 4c674011..78943b00 100755 --- a/tests/bin/run.sh +++ b/tests/bin/run.sh @@ -45,6 +45,7 @@ unset testname unset deployname expected=() +export TEST_PATH=$(cd "$1" && pwd) . "$1"/settings.sh testname="${testname-$(basename $1)}" diff --git a/tests/tests/python-pii-redactor/.helmignore b/tests/tests/python-pii-redactor/pail/.helmignore similarity index 100% rename from tests/tests/python-pii-redactor/.helmignore rename to tests/tests/python-pii-redactor/pail/.helmignore diff --git a/tests/tests/python-pii-redactor/requirements.txt b/tests/tests/python-pii-redactor/pail/requirements.txt similarity index 100% rename from tests/tests/python-pii-redactor/requirements.txt rename to tests/tests/python-pii-redactor/pail/requirements.txt diff --git a/tests/tests/python-pii-redactor/src/flair_recognizer.py b/tests/tests/python-pii-redactor/pail/src/flair_recognizer.py similarity index 100% rename from tests/tests/python-pii-redactor/src/flair_recognizer.py rename to tests/tests/python-pii-redactor/pail/src/flair_recognizer.py diff --git a/tests/tests/python-pii-redactor/src/main.py b/tests/tests/python-pii-redactor/pail/src/main.py similarity index 100% rename from tests/tests/python-pii-redactor/src/main.py rename to tests/tests/python-pii-redactor/pail/src/main.py diff --git a/tests/tests/python-pii-redactor/src/pii_analyzer.py b/tests/tests/python-pii-redactor/pail/src/pii_analyzer.py similarity index 100% rename from tests/tests/python-pii-redactor/src/pii_analyzer.py rename to tests/tests/python-pii-redactor/pail/src/pii_analyzer.py diff --git a/tests/tests/python-pii-redactor/src/pii_anonymizer.py b/tests/tests/python-pii-redactor/pail/src/pii_anonymizer.py similarity index 100% rename from tests/tests/python-pii-redactor/src/pii_anonymizer.py rename to tests/tests/python-pii-redactor/pail/src/pii_anonymizer.py diff --git a/tests/tests/python-pii-redactor/test-data/sm/pii_test_data.expected.parquet.gz b/tests/tests/python-pii-redactor/pail/test-data/sm/pii_test_data.expected.parquet.gz similarity index 100% rename from tests/tests/python-pii-redactor/test-data/sm/pii_test_data.expected.parquet.gz rename to tests/tests/python-pii-redactor/pail/test-data/sm/pii_test_data.expected.parquet.gz diff --git a/tests/tests/python-pii-redactor/test-data/sm/pii_test_data.parquet.gz b/tests/tests/python-pii-redactor/pail/test-data/sm/pii_test_data.parquet.gz similarity index 100% rename from tests/tests/python-pii-redactor/test-data/sm/pii_test_data.parquet.gz rename to tests/tests/python-pii-redactor/pail/test-data/sm/pii_test_data.parquet.gz diff --git a/tests/tests/python-pii-redactor/test-data/xs/1.expected.parquet.gz b/tests/tests/python-pii-redactor/pail/test-data/xs/1.expected.parquet.gz similarity index 100% rename from tests/tests/python-pii-redactor/test-data/xs/1.expected.parquet.gz rename to tests/tests/python-pii-redactor/pail/test-data/xs/1.expected.parquet.gz diff --git a/tests/tests/python-pii-redactor/test-data/xs/1.parquet.gz b/tests/tests/python-pii-redactor/pail/test-data/xs/1.parquet.gz similarity index 100% rename from tests/tests/python-pii-redactor/test-data/xs/1.parquet.gz rename to tests/tests/python-pii-redactor/pail/test-data/xs/1.parquet.gz diff --git a/tests/tests/python-pii-redactor/test-data/xs/xs.py b/tests/tests/python-pii-redactor/pail/test-data/xs/xs.py similarity index 100% rename from tests/tests/python-pii-redactor/test-data/xs/xs.py rename to tests/tests/python-pii-redactor/pail/test-data/xs/xs.py diff --git a/tests/tests/python-pii-redactor/post.sh b/tests/tests/python-pii-redactor/post.sh new file mode 100755 index 00000000..842ffddc --- /dev/null +++ b/tests/tests/python-pii-redactor/post.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +DATA="$TEST_PATH"/pail/test-data + +actual="$DATA"/xs/1.output.parquet +expected="$DATA"/xs/1.expected.parquet.gz + +if [ -f $actual ] +then echo "✅ PASS found local task output file=$actual test=$TEST_NAME" && rm -f $actual +else echo "❌ FAIL cannot find local task output file=$actual test=$TEST_NAME" && exit 1 +fi + +actual_sha256=$(cat "$actual" | sha256) +expected_sha256=$(gzcat "$expected" | sha256 ) + +if [ "$actual_sha256" = "$expected_sha256" ] +then echo "✅ PASS found local task output file=$f test=$TEST_NAME" && rm -f $f +else echo "❌ FAIL cannot find local task output file=$f test=$TEST_NAME" && exit 1 +fi + +deactivate diff --git a/tests/tests/python-pii-redactor/settings.sh b/tests/tests/python-pii-redactor/settings.sh new file mode 100644 index 00000000..b95a5c98 --- /dev/null +++ b/tests/tests/python-pii-redactor/settings.sh @@ -0,0 +1,6 @@ +api=workqueue + +expected=("SequenceTagger predicts") +NUM_DESIRED_OUTPUTS=1 + +up_args='<(gzcat "$TEST_PATH"/pail/test-data/xs/1.parquet.gz)'