[testing] run only one perftest

This commit is contained in:
vdimir 2022-06-09 14:49:47 +02:00
parent aac2f8aefc
commit c2d774d598
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 5 additions and 1 deletions

View File

@ -218,7 +218,7 @@ function run_tests
if [ -v CHPC_TEST_RUN_BY_HASH_TOTAL ]; then
# filter tests array in bash https://stackoverflow.com/a/40375567
for index in "${!test_files[@]}"; do
[ $(( index % CHPC_TEST_RUN_BY_HASH_TOTAL )) != "$CHPC_TEST_RUN_BY_HASH_NUM" ] && \
[ $(( index )) != "$CHPC_TEST_RUN_BY_HASH_NUM" ] && \
unset -v 'test_files[$index]'
done
# to have sequential indexes...

View File

@ -102,6 +102,10 @@ if __name__ == "__main__":
if "RUN_BY_HASH_TOTAL" in os.environ:
run_by_hash_total = int(os.getenv("RUN_BY_HASH_TOTAL", "1"))
run_by_hash_num = int(os.getenv("RUN_BY_HASH_NUM", "1"))
if run_by_hash_num != 1:
print("Skipped ", run_by_hash_num)
sys.exit(0)
docker_env += (
f" -e CHPC_TEST_RUN_BY_HASH_TOTAL={run_by_hash_total}"
f" -e CHPC_TEST_RUN_BY_HASH_NUM={run_by_hash_num}"