Generate.sh -s param to skip autodetection of tests

patch by Berenguer Blasi; reviewed by Andres de la Peña for CASSANDRA-18553
This commit is contained in:
Bereng 2023-06-09 09:47:30 +02:00
parent 8d3c30dde4
commit c91e2714b9
2 changed files with 12 additions and 3 deletions

View File

@ -30,7 +30,7 @@ die ()
print_help() print_help()
{ {
echo "Usage: $0 [-f|-p|-a|-e|-i|-b]" echo "Usage: $0 [-f|-p|-a|-e|-i|-b|-s]"
echo " -a Generate the config.yml, config.yml.FREE and config.yml.PAID expanded configuration" echo " -a Generate the config.yml, config.yml.FREE and config.yml.PAID expanded configuration"
echo " files from the main config_template.yml reusable configuration file." echo " files from the main config_template.yml reusable configuration file."
echo " Use this for permanent changes in config that will be committed to the main repo." echo " Use this for permanent changes in config that will be committed to the main repo."
@ -39,6 +39,8 @@ print_help()
echo " -b Specify the base git branch for comparison when determining changed tests to" echo " -b Specify the base git branch for comparison when determining changed tests to"
echo " repeat. Defaults to ${BASE_BRANCH}. Note that this option is not used when" echo " repeat. Defaults to ${BASE_BRANCH}. Note that this option is not used when"
echo " the '-a' option is specified." echo " the '-a' option is specified."
echo " -s Skip automatic detection of changed tests. Useful when you need to repeat a few ones,"
echo " or when there are too many changed tests for CircleCI."
echo " -e <key=value> Environment variables to be used in the generated config.yml, e.g.:" echo " -e <key=value> Environment variables to be used in the generated config.yml, e.g.:"
echo " -e DTEST_BRANCH=CASSANDRA-8272" echo " -e DTEST_BRANCH=CASSANDRA-8272"
echo " -e DTEST_REPO=https://github.com/adelapena/cassandra-dtest.git" echo " -e DTEST_REPO=https://github.com/adelapena/cassandra-dtest.git"
@ -74,9 +76,11 @@ paid=false
env_vars="" env_vars=""
has_env_vars=false has_env_vars=false
check_env_vars=true check_env_vars=true
while getopts "e:afpib:" opt; do detect_changed_tests=true
while getopts "e:afpib:s" opt; do
case $opt in case $opt in
a ) all=true a ) all=true
detect_changed_tests=false
;; ;;
f ) free=true f ) free=true
;; ;;
@ -93,6 +97,8 @@ while getopts "e:afpib:" opt; do
;; ;;
i ) check_env_vars=false i ) check_env_vars=false
;; ;;
s ) detect_changed_tests=false
;;
\?) die "Invalid option: -$OPTARG" \?) die "Invalid option: -$OPTARG"
;; ;;
esac esac
@ -173,7 +179,7 @@ elif (!($has_env_vars)); then
fi fi
# add new or modified tests to the sets of tests to be repeated # add new or modified tests to the sets of tests to be repeated
if (!($all)); then if $detect_changed_tests; then
# Sanity check that the referenced branch exists # Sanity check that the referenced branch exists
if ! git show ${BASE_BRANCH} -- >&/dev/null; then if ! git show ${BASE_BRANCH} -- >&/dev/null; then
echo -e "\n\nUnknown base branch: ${BASE_BRANCH}. Unable to detect changed tests.\n" echo -e "\n\nUnknown base branch: ${BASE_BRANCH}. Unable to detect changed tests.\n"

View File

@ -101,6 +101,9 @@ generate.sh -p \
-e REPEATED_UPGRADE_DTESTS=upgrade_tests/cql_tests.py \ -e REPEATED_UPGRADE_DTESTS=upgrade_tests/cql_tests.py \
-e REPEATED_JVM_UPGRADE_DTESTS=org.apache.cassandra.distributed.upgrade.GroupByTest -e REPEATED_JVM_UPGRADE_DTESTS=org.apache.cassandra.distributed.upgrade.GroupByTest
``` ```
If you need to repeat a particular set of tests and avoid automatic detection of changed tests
use the -s command line option.
For particular Ant test targets that are not included in the regular test suites, you can For particular Ant test targets that are not included in the regular test suites, you can
use the `run_repeated_utest` job: use the `run_repeated_utest` job:
``` ```