forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Build] Refactor integration test commands to run_integration_group.s…
…h script (apache#9770) ### Motivation - Add a similar solution for running integration tests as there is for running unit tests in run_unit_group.sh script This benefit of this change is that it will be easier to refactor the GitHub Actions workflow build when the commands to run the integration tests are maintained in a separate bash script. ### Modifications - Move commands to run integration tests from the GitHub Actions workflow yaml files to a bash script `build/run_ingration_group.sh`. - The commands aren't modified as part of this PR, only moved to the script.
- Loading branch information
Showing
14 changed files
with
147 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
set -e | ||
set -o pipefail | ||
set -o errexit | ||
|
||
TEST_GROUP=$1 | ||
if [ -z "$TEST_GROUP" ]; then | ||
echo "usage: $0 [test_group]" | ||
exit 1 | ||
fi | ||
shift | ||
|
||
# runs integration tests | ||
mvn_run_integration_test() { | ||
( | ||
RETRY="" | ||
# wrap with retry.sh script if next parameter is "--retry" | ||
if [[ "$1" == "--retry" ]]; then | ||
RETRY="./build/retry.sh" | ||
shift | ||
fi | ||
# skip wrapping with retry.sh script if next parameter is "--no-retry" | ||
if [[ "$1" == "--no-retry" ]]; then | ||
RETRY="" | ||
shift | ||
fi | ||
set -x | ||
# run the integration tests | ||
$RETRY mvn -B -ntp -DredirectTestOutputToFile=false -f tests/pom.xml test "$@" | ||
) | ||
} | ||
|
||
test_group_shade() { | ||
mvn_run_integration_test "$@" -DShadeTests | ||
} | ||
|
||
test_group_backwards_compat() { | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-backwards-compatibility.xml -DintegrationTests | ||
} | ||
|
||
test_group_cli() { | ||
# run pulsar cli integration tests | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-cli.xml -DintegrationTests | ||
# run pulsar auth integration tests | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-auth.xml -DintegrationTests | ||
} | ||
|
||
test_group_function_state() { | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-function-state.xml -DintegrationTests | ||
} | ||
|
||
test_group_messaging() { | ||
# run integration messaging tests | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-messaging.xml -DintegrationTests | ||
# run integration proxy tests | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-proxy.xml -DintegrationTests | ||
# run integration proxy with WebSocket tests | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-proxy-websocket.xml -DintegrationTests | ||
} | ||
|
||
test_group_schema() { | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-schema.xml -DintegrationTests | ||
} | ||
|
||
test_group_standalone() { | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-standalone.xml -DintegrationTests | ||
} | ||
|
||
test_group_transaction() { | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-transaction.xml -DintegrationTests | ||
} | ||
|
||
test_group_tiered_filesystem() { | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=tiered-filesystem-storage.xml -DintegrationTests | ||
} | ||
|
||
test_group_tiered_jcloud() { | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=tiered-jcloud-storage.xml -DintegrationTests | ||
} | ||
|
||
test_group_pulsar_connectors_thread() { | ||
# run integration function | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-thread.xml -DintegrationTests -Dgroups=function | ||
# run integration source | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-thread.xml -DintegrationTests -Dgroups=source | ||
# run integration sink | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-thread.xml -DintegrationTests -Dgroups=sink | ||
} | ||
|
||
test_group_pulsar_connectors_process() { | ||
# run integration function | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-process.xml -DintegrationTests -Dgroups=function | ||
# run integration source | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-process.xml -DintegrationTests -Dgroups=source | ||
# run integraion sink | ||
mvn_run_integration_test --retry "$@" -DintegrationTestSuiteFile=pulsar-process.xml -DintegrationTests -Dgroups=sink | ||
} | ||
|
||
test_group_sql() { | ||
mvn_run_integration_test "$@" -DintegrationTestSuiteFile=pulsar-sql.xml -DintegrationTests -DtestForkCount=1 | ||
} | ||
|
||
echo "Test Group : $TEST_GROUP" | ||
test_group_function_name="test_group_$(echo "$TEST_GROUP" | tr '[:upper:]' '[:lower:]')" | ||
if [[ "$(LC_ALL=C type -t $test_group_function_name)" == "function" ]]; then | ||
eval "$test_group_function_name" "$@" | ||
else | ||
echo "INVALID TEST GROUP" | ||
exit 1 | ||
fi |