Allow for running multiple selected tests

This commit is contained in:
Alexander Lakhin
2025-05-14 11:31:43 +03:00
parent 4b9087651c
commit 8f2808864b

View File

@@ -12,6 +12,10 @@ inputs:
description: 'Arbitrary parameters to pytest. For example "-s" to prevent capturing stdout/stderr'
required: false
default: ''
extended_testing:
description: 'Set to true if the test results should be stored and processed separately'
required: false
default: 'false'
needs_postgres_source:
description: 'Set to true if the test suite requires postgres source checked out'
required: false
@@ -135,13 +139,15 @@ runs:
PERF_REPORT_DIR="$(realpath test_runner/perf-report-local)"
echo "PERF_REPORT_DIR=${PERF_REPORT_DIR}" >> ${GITHUB_ENV}
rm -rf $PERF_REPORT_DIR
TEST_SELECTION="test_runner/${{ inputs.test_selection }}"
EXTRA_PARAMS="${{ inputs.extra_params }}"
TEST_SELECTION="${{ inputs.test_selection }}"
if [ -z "$TEST_SELECTION" ]; then
echo "test_selection must be set"
exit 1
fi
if [[ $TEST_SELECTION != test_runner/* ]]; then
TEST_SELECTION="test_runner/$TEST_SELECTION"
fi
EXTRA_PARAMS="${{ inputs.extra_params }}"
if [[ "${{ inputs.run_in_parallel }}" == "true" ]]; then
# -n sets the number of parallel processes that pytest-xdist will run
EXTRA_PARAMS="-n12 $EXTRA_PARAMS"
@@ -244,3 +250,5 @@ runs:
report-dir: /tmp/test_output/allure/results
unique-key: ${{ inputs.build_type }}-${{ inputs.pg_version }}-${{ runner.arch }}
aws-oidc-role-arn: ${{ inputs.aws-oidc-role-arn }}
env:
REPORT_EXT: ${{ inputs.extended_testing == 'true' && '-ext' || '' }}