Skip to content

Commit

Permalink
[#19772] build: support TEST_P gtest_filter derivation
Browse files Browse the repository at this point in the history
Summary:
yb_build.sh set_cxx_test_name has logic to take a line such as

    TEST_F_EX(QLTransactionTest, RemoteBootstrap, RemoteBootstrapTest) {

and derive a gtest filter.  It supports TEST, TEST_F, and TEST_F_EX, but
it doesn't support TEST_P.  Add that support using wildcards to cover
all parameters.
Jira: DB-8625

Test Plan:
    #!/usr/bin/env bash
    # No set -o pipefail because some tests are flaky.
    set -eu

    for cxxtest in 'TEST_P(PgOidCollisionTest, MetaCachePgOidCollisionFromTservers) {' \
                   'TEST_P(PgPackedRowTest, AddDropColumn) {' \
                   'TEST_P(PgFKeyTestConcurrentModification, HighPriorityDeleteBeforeLowPriorityReferencing) {' \
                   'TEST_P(CreateMultiHBTableStressTest, RestartServersAfterCreation) {'; do
      echo Testing "$cxxtest"
      ./yb_build.sh fastdebug --gcc11 --cxx-test "$cxxtest" \
        |& grep "Determined C++ test based on source substring:"
    done

Close: #19772
Jenkins: skip

Reviewers: mbautin

Reviewed By: mbautin

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D29835
  • Loading branch information
jaki committed Nov 7, 2023
1 parent 2617960 commit e5a0006
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions yb_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ set_cxx_test_name() {
if [[ $1 =~ ^(TEST_F_EX)\($identifier,\ *$identifier,\ *$identifier\) ||
$1 =~ ^(TEST|TEST_F)\($identifier,\ *$identifier\) ]]; then
gtest_filter=${BASH_REMATCH[2]}.${BASH_REMATCH[3]}
elif [[ $1 =~ ^TEST_P\($identifier,\ *$identifier\) ]]; then
# Create a filter with wildcards that match all possiblilities. For example,
# - PackingVersion/PgPackedRowTest.AddDropColumn/kV1
# - PackingVersion/PgPackedRowTest.AddDropColumn/kV2
gtest_filter="*/${BASH_REMATCH[1]}.${BASH_REMATCH[2]}/*"
else
fatal "Could not determine gtest test filter from source substring $1"
fi
Expand Down

0 comments on commit e5a0006

Please sign in to comment.