diff --git a/.github/workflows/update_prci_cksum.yml b/.github/workflows/update_prci_cksum.yml new file mode 100644 index 0000000000..843188edee --- /dev/null +++ b/.github/workflows/update_prci_cksum.yml @@ -0,0 +1,31 @@ +name: Update PRCI checksum + +on: + pull_request: + +jobs: + compute-prci-checksum: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: Compute checksum + run: | + cd src/test + + # Compute the checksum of all prci .py source code + cksum=$(find tests -name '*.py' -exec grep -H -m 1 CLASSES {} \; | grep prci | cut -d':' -f1 | sort | xargs -n 1 cat | shasum -a 256 | cut -d' ' -f1) + + # Update checksum in prci_checksum.txt + sed -i -e '/^# Checksum:/{' -e 'n' -e "s/.*/$cksum/" -e '}' prci_checksum.txt + + - name: Commit and push changes + run: | + git config --global user.email "action@github.com" + git config --global user.name "GitHub Action" + git add -A + git commit -m "Update prci checksum" || echo "No changes to commit" + git push diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 30cba7d080..1e03e2a8bc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,27 +10,9 @@ ##### # TO USE A NEW CONTAINER, UPDATE TAG NAME HERE AS PART OF YOUR PR! -# Be sure to keep the list of files in python_test_files variable -# consistent with those same files listed in the paths trigger ##### variables: container_tag: visitdav/visit-ci-develop:2024-10-15-shac4fd59 - python_test_files: > - ../../src/test/tests/databases/silo.py - ../../src/test/tests/databases/blueprint.py - ../../src/test/tests/databases/blueprint_export.py - ../../src/test/tests/hybrid/ddf.py - ../../src/test/tests/unit/default_methods.py - ../../src/test/tests/unit/convert2to3.py - ../../src/test/tests/unit/atts_assign.py - ../../src/test/tests/unit/test_value_simple.py - ../../src/test/tests/unit/annotation_objects.py - ../../src/test/tests/unit/protocol.py - ../../src/test/tests/unit/utility.py - ../../src/test/tests/expressions/ghost_zoneid_expr.py - ../../src/test/tests/expressions/global_stats.py - ../../src/test/tests/expressions/math_expr.py - ../../src/test/tests/expressions/tensor_expr.py # only build merge target pr to develop trigger: none @@ -51,21 +33,7 @@ pr: - 'data/silo*' - 'data/blueprint*' - 'src/test/py_src/*.py' - - 'src/test/tests/databases/silo.py' - - 'src/test/tests/databases/blueprint.py' - - 'src/test/tests/databases/blueprint_export.py' - - 'src/test/tests/hybrid/ddf.py' - - 'src/test/tests/unit/default_methods.py' - - 'src/test/tests/unit/convert2to3.py' - - 'src/test/tests/unit/atts_assign.py' - - 'src/test/tests/unit/test_value_simple.py' - - 'src/test/tests/unit/annotation_objects.py' - - 'src/test/tests/unit/protocol.py' - - 'src/test/tests/unit/utility.py' - - 'src/test/tests/expressions/ghost_zoneid_expr.py' - - 'src/test/tests/expressions/global_stats.py' - - 'src/test/tests/expressions/math_expr.py' - - 'src/test/tests/expressions/tensor_expr.py' + - 'src/test/prci_checksum.txt' # fast fail consistency checks stages: @@ -158,8 +126,8 @@ stages: # add to ld_lib path (rpaths are missing?) export LD_LIBRARY_PATH=${VTK_LIB_DIR}:${OSPRAY_LIB_DIR}:${QT_LIB_DIR} # run test suite on silo + blueprint tests - export TESTS="$(python_test_files)" - ./run_visit_test_suite.sh --fuzzy --pixdiff 10 --avgdiff 10 --numdiff 0.1 -v ${TESTS} + export TESTS="$(find ../../src/test/tests -name '*.py' -exec grep -H -m 1 CLASSES {} \; | grep prci | cut -d':' -f1)" + ./run_visit_test_suite.sh --pixdiff 10 --avgdiff 10 --numdiff 0.1 -v ${TESTS} hasFailed="$(grep Failed\\\|Unacceptable\\\|OS-Killed output/html/index.html)" if [[ -n "$hasFailed" ]]; then exit 1 # tests failed diff --git a/src/test/prci_checksum.txt b/src/test/prci_checksum.txt new file mode 100644 index 0000000000..48d09f6338 --- /dev/null +++ b/src/test/prci_checksum.txt @@ -0,0 +1,33 @@ +# This file holds a checksum of all the .py source code that is run +# during pull request CI. That is, any .py source file which includes +# the 'prci' string in the 'CLASSES' entry in the header of the file. +# +# This file is then used by Azure CI as one of the paths it checks to +# decide if it needs to trigger a new main build and run of tests. +# +# The string 'prci' stands for Pull Request Continuous Integration. +# +# To include any .py test script in pull request CI, just add the +# 'prci' string to the 'CLASSES' entry in the header of the file. +# +# New tests should be added only if they meet the following conditions... +# +# 1) The test typically takes less than 20 seconds to run "normally". +# 2) The test uses only Silo or Blueprint data or no data at all. +# 3) The test tests something significantly different from all the +# other .py files already included in prci. +# +# The command to produce the checksum is... +# +# find . -name '*.py' -exec grep -H -m 1 CLASSES {} \; | grep prci | \ +# cut -d':' -f1 | sort | xargs -n 1 cat | shasum -a 256 +# +# A GitHub Action maintains this checksum automatically. +# +# Because GitHub Actions and Azure CI are completely asyncronous to +# each other, its possible an Azure CI run can begin before the action +# that updates this checksum has completed. But, because any commit/push +# to a PR will cancel existing Azure runs and start new ones, this is ok. +# +# Checksum: +ddef973252f8007b8c8064779662ec0979cf68ce7f6b452fc83c4a4ad6eb4079 diff --git a/src/test/py_src/visit_test_suite.py b/src/test/py_src/visit_test_suite.py index 329aa2bd19..7637c71076 100755 --- a/src/test/py_src/visit_test_suite.py +++ b/src/test/py_src/visit_test_suite.py @@ -177,6 +177,8 @@ def launch_visit_test(args): opts = args[2] top_dir = visit_root() test_script = abs_path(test_path(),"visit_test_main.py") + if test.split('/')[-2] == 'azure': + test = abs_path('/'.join(test.split('/')[:-1]),os.readlink(test)) test_dir, test_file = os.path.split(test) test_cat = os.path.split(test_dir)[1] test_base = os.path.splitext(test_file)[0] @@ -974,6 +976,8 @@ def launch_tests(opts,tests): if len(results) != len(test_list): for t in test_args: if not t[0] in [ r.index for r in results]: + if t[1].split('/')[-2] == 'azure': + t[1] = abs_path('/'.join(t[1].split('/')[:-1]),os.readlink(t[1])) test_dir, test_file = os.path.split(t[1]) test_cat = os.path.split(test_dir)[1] test_base = os.path.splitext(test_file)[0] diff --git a/src/test/tests/databases/blueprint.py b/src/test/tests/databases/blueprint.py index 0c331f3273..79803cbe8d 100644 --- a/src/test/tests/databases/blueprint.py +++ b/src/test/tests/databases/blueprint.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: blueprint.py # diff --git a/src/test/tests/databases/blueprint_export.py b/src/test/tests/databases/blueprint_export.py index b18cf02a09..c36519ecfc 100644 --- a/src/test/tests/databases/blueprint_export.py +++ b/src/test/tests/databases/blueprint_export.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------------- # MODES: serial parallel -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: blueprint_export.py # diff --git a/src/test/tests/databases/silo.py b/src/test/tests/databases/silo.py index 303388fc1f..f583f13f66 100644 --- a/src/test/tests/databases/silo.py +++ b/src/test/tests/databases/silo.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: silo.py # diff --git a/src/test/tests/expressions/ghost_zoneid_expr.py b/src/test/tests/expressions/ghost_zoneid_expr.py index dc2e6ddc2c..1caab8cc34 100644 --- a/src/test/tests/expressions/ghost_zoneid_expr.py +++ b/src/test/tests/expressions/ghost_zoneid_expr.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: ghost_zoneid_expr.py # diff --git a/src/test/tests/expressions/global_stats.py b/src/test/tests/expressions/global_stats.py index a4b4891c89..081121e2b7 100644 --- a/src/test/tests/expressions/global_stats.py +++ b/src/test/tests/expressions/global_stats.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: global_stats.py # diff --git a/src/test/tests/expressions/math_expr.py b/src/test/tests/expressions/math_expr.py index 4e279fd30c..902037b70a 100644 --- a/src/test/tests/expressions/math_expr.py +++ b/src/test/tests/expressions/math_expr.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: math_expr.py # diff --git a/src/test/tests/expressions/tensor_expr.py b/src/test/tests/expressions/tensor_expr.py index 5f9e47fd3f..a5a401361f 100644 --- a/src/test/tests/expressions/tensor_expr.py +++ b/src/test/tests/expressions/tensor_expr.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: tensor_expr.py # diff --git a/src/test/tests/hybrid/ddf.py b/src/test/tests/hybrid/ddf.py index fbd8877cbf..8c2989bbd9 100644 --- a/src/test/tests/hybrid/ddf.py +++ b/src/test/tests/hybrid/ddf.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: ddf.py # diff --git a/src/test/tests/unit/annotation_objects.py b/src/test/tests/unit/annotation_objects.py index ace339936f..f827b7391e 100644 --- a/src/test/tests/unit/annotation_objects.py +++ b/src/test/tests/unit/annotation_objects.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: annotation_objects.py # diff --git a/src/test/tests/unit/convert2to3.py b/src/test/tests/unit/convert2to3.py index ed5850fef1..0ef50c031d 100644 --- a/src/test/tests/unit/convert2to3.py +++ b/src/test/tests/unit/convert2to3.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: convert2to3.py # diff --git a/src/test/tests/unit/default_methods.py b/src/test/tests/unit/default_methods.py index 4c71d91901..eae157d10f 100644 --- a/src/test/tests/unit/default_methods.py +++ b/src/test/tests/unit/default_methods.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: default_methods.py # diff --git a/src/test/tests/unit/protocol.py b/src/test/tests/unit/protocol.py index b975e6fb7f..eb53b1f3a3 100644 --- a/src/test/tests/unit/protocol.py +++ b/src/test/tests/unit/protocol.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: protocolo.py # diff --git a/src/test/tests/unit/test_value_simple.py b/src/test/tests/unit/test_value_simple.py index c5c463efa4..83b8feb1b1 100644 --- a/src/test/tests/unit/test_value_simple.py +++ b/src/test/tests/unit/test_value_simple.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: test_value_simple.py # diff --git a/src/test/tests/unit/utility.py b/src/test/tests/unit/utility.py index 8b8040ae93..75722100b3 100644 --- a/src/test/tests/unit/utility.py +++ b/src/test/tests/unit/utility.py @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------- -# CLASSES: nightly +# CLASSES: nightly, prci # # Test Case: utility.py #