This is an automated email from the ASF dual-hosted git repository.
terrymanu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 525835a0702 Rename E2E SQL target matrix and remaining tests (#40216)
525835a0702 is described below
commit 525835a0702dc89d16dfe83f28d69a70d04b1fca
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Oct 18 10:59:05 2026 +0800
Rename E2E SQL target matrix and remaining tests (#40216)
---
.github/workflows/e2e-sql.yml | 28 ++---
.../scripts/e2e-sql/generate-e2e-sql-matrix.sh | 110 +++++++++---------
.../scripts/e2e-sql/generate-remaining-matrix.sh | 14 +--
.../e2e-sql/test-generate-e2e-sql-matrix.sh | 128 ++++++++++-----------
4 files changed, 140 insertions(+), 140 deletions(-)
diff --git a/.github/workflows/e2e-sql.yml b/.github/workflows/e2e-sql.yml
index 288d9132e46..9605c6a400f 100644
--- a/.github/workflows/e2e-sql.yml
+++ b/.github/workflows/e2e-sql.yml
@@ -24,8 +24,8 @@ on:
- '**/*.md'
workflow_dispatch:
inputs:
- full_matrix_algorithm:
- description: Full matrix generation algorithm
+ target_matrix_algorithm:
+ description: Target matrix generation algorithm
required: false
default: auto
type: choice
@@ -60,12 +60,12 @@ jobs:
timeout-minutes: 5
outputs:
smoke-matrix: ${{ steps.generate-matrix.outputs.smoke-matrix }}
- full-matrix: ${{ steps.generate-matrix.outputs.full-matrix }}
+ target-matrix: ${{ steps.generate-matrix.outputs.target-matrix }}
matrix: ${{ steps.generate-matrix.outputs.matrix }}
has-jobs: ${{ steps.generate-matrix.outputs.has-jobs }}
- full-matrix-algorithm: ${{
steps.generate-matrix.outputs.full-matrix-algorithm }}
- full-smoke-overlap-count: ${{
steps.generate-matrix.outputs.full-smoke-overlap-count }}
- estimated-stage2-jobs: ${{
steps.generate-matrix.outputs.estimated-stage2-jobs }}
+ target-matrix-algorithm: ${{
steps.generate-matrix.outputs.target-matrix-algorithm }}
+ target-smoke-overlap-count: ${{
steps.generate-matrix.outputs.target-smoke-overlap-count }}
+ estimated-remaining-tests-jobs: ${{
steps.generate-matrix.outputs.estimated-remaining-tests-jobs }}
total-two-stage-jobs: ${{
steps.generate-matrix.outputs.total-two-stage-jobs }}
effective-reduction-ratio: ${{
steps.generate-matrix.outputs.effective-reduction-ratio }}
filter-json: ${{ steps.generate-matrix.outputs.filter-json }}
@@ -95,7 +95,7 @@ jobs:
FILTER_CORE_INFRA: ${{ steps.filter.outputs.core_infra }}
FILTER_TEST_FRAMEWORK: ${{ steps.filter.outputs.test_framework }}
FILTER_POM_CHANGES: ${{ steps.filter.outputs.pom_changes }}
- FULL_MATRIX_ALGORITHM_INPUT: ${{ github.event_name ==
'workflow_dispatch' && github.event.inputs.full_matrix_algorithm || 'auto' }}
+ TARGET_MATRIX_ALGORITHM_INPUT: ${{ github.event_name ==
'workflow_dispatch' && github.event.inputs.target_matrix_algorithm || 'auto' }}
run: |
filters=$(jq -cn \
--arg adapter_proxy "$FILTER_ADAPTER_PROXY" \
@@ -123,9 +123,9 @@ jobs:
run: |
echo "smoke-matrix=${{ steps.generate-matrix.outputs.smoke-matrix }}"
echo "has-jobs=${{ steps.generate-matrix.outputs.has-jobs }}"
- echo "full-matrix-algorithm=${{
steps.generate-matrix.outputs.full-matrix-algorithm }}"
- echo "full-smoke-overlap-count=${{
steps.generate-matrix.outputs.full-smoke-overlap-count }}"
- echo "estimated-stage2-jobs=${{
steps.generate-matrix.outputs.estimated-stage2-jobs }}"
+ echo "target-matrix-algorithm=${{
steps.generate-matrix.outputs.target-matrix-algorithm }}"
+ echo "target-smoke-overlap-count=${{
steps.generate-matrix.outputs.target-smoke-overlap-count }}"
+ echo "estimated-remaining-tests-jobs=${{
steps.generate-matrix.outputs.estimated-remaining-tests-jobs }}"
echo "total-two-stage-jobs=${{
steps.generate-matrix.outputs.total-two-stage-jobs }}"
echo "effective-reduction-ratio=${{
steps.generate-matrix.outputs.effective-reduction-ratio }}"
echo "filter-json=${{ steps.generate-matrix.outputs.filter-json }}"
@@ -227,20 +227,20 @@ jobs:
id: generate
env:
FILTER_JSON: ${{
needs.detect-and-generate-matrix.outputs.filter-json }}
- FULL_MATRIX: ${{
needs.detect-and-generate-matrix.outputs.full-matrix }}
+ TARGET_MATRIX: ${{
needs.detect-and-generate-matrix.outputs.target-matrix }}
SMOKE_MATRIX: ${{
needs.detect-and-generate-matrix.outputs.smoke-matrix }}
run: |
bash
.github/workflows/resources/scripts/e2e-sql/generate-remaining-matrix.sh \
"$FILTER_JSON" \
- "$FULL_MATRIX" \
+ "$TARGET_MATRIX" \
"$SMOKE_MATRIX"
- name: Logs
run: |
echo "matrix=${{ steps.generate.outputs.matrix }}"
echo "has-remaining-jobs=${{
steps.generate.outputs.has-remaining-jobs }}"
- e2e-sql-stage2:
- name: E2E - SQL (Stage 2)
+ e2e-sql-remaining-tests:
+ name: E2E - SQL (Remaining Tests)
needs: [ detect-remaining-matrix, prepare-e2e-artifacts,
global-environment ]
if: >-
always()
diff --git
a/.github/workflows/resources/scripts/e2e-sql/generate-e2e-sql-matrix.sh
b/.github/workflows/resources/scripts/e2e-sql/generate-e2e-sql-matrix.sh
index 9c66c9aa9b6..1e82658c702 100755
--- a/.github/workflows/resources/scripts/e2e-sql/generate-e2e-sql-matrix.sh
+++ b/.github/workflows/resources/scripts/e2e-sql/generate-e2e-sql-matrix.sh
@@ -18,9 +18,9 @@
# Usage: generate-e2e-sql-matrix.sh '<json-with-all-18-filter-labels>'
# Environment:
-# FULL_MATRIX_ALGORITHM_INPUT: auto|cartesian|pairwise (optional, default
auto)
-# Output: writes smoke-matrix=<JSON>, full-matrix=<JSON>, matrix=<JSON>(alias
for full), has-jobs=<true|false>,
-# full-matrix-algorithm=<cartesian|pairwise|auto>,
full-smoke-overlap-count=<N>, estimated-stage2-jobs=<N>,
+# TARGET_MATRIX_ALGORITHM_INPUT: auto|cartesian|pairwise (optional, default
auto)
+# Output: writes smoke-matrix=<JSON>, target-matrix=<JSON>,
matrix=<JSON>(alias for target), has-jobs=<true|false>,
+# target-matrix-algorithm=<cartesian|pairwise|auto>,
target-smoke-overlap-count=<N>, estimated-remaining-tests-jobs=<N>,
# total-two-stage-jobs=<N>, and effective-reduction-ratio=<0..1> to
$GITHUB_OUTPUT
set -euo pipefail
@@ -277,13 +277,13 @@ if [ "${GITHUB_EVENT_NAME:-}" = "workflow_dispatch" ];
then
echo "::notice::workflow_dispatch detected"
fi
-requested_full_matrix_algorithm="${FULL_MATRIX_ALGORITHM_INPUT:-auto}"
-case "$requested_full_matrix_algorithm" in
+requested_target_matrix_algorithm="${TARGET_MATRIX_ALGORITHM_INPUT:-auto}"
+case "$requested_target_matrix_algorithm" in
auto|cartesian|pairwise)
;;
*)
- echo "::warning::Invalid
FULL_MATRIX_ALGORITHM_INPUT=$requested_full_matrix_algorithm, fallback to auto"
- requested_full_matrix_algorithm="auto"
+ echo "::warning::Invalid
TARGET_MATRIX_ALGORITHM_INPUT=$requested_target_matrix_algorithm, fallback to
auto"
+ requested_target_matrix_algorithm="auto"
;;
esac
@@ -310,8 +310,8 @@ if [ "$any_relevant_change" = "false" ]; then
echo "matrix={\"include\":[]}" >> "$GITHUB_OUTPUT"
echo "has-jobs=false" >> "$GITHUB_OUTPUT"
echo "smoke-matrix={\"include\":[]}" >> "$GITHUB_OUTPUT"
- echo "full-matrix={\"include\":[]}" >> "$GITHUB_OUTPUT"
- echo "full-matrix-algorithm=auto" >> "$GITHUB_OUTPUT"
+ echo "target-matrix={\"include\":[]}" >> "$GITHUB_OUTPUT"
+ echo "target-matrix-algorithm=auto" >> "$GITHUB_OUTPUT"
echo "::notice::No relevant filters triggered, skipping job generation"
exit 0
fi
@@ -453,18 +453,18 @@ if [ "$manual_dispatch" = "true" ]; then
echo "::notice::workflow_dispatch uses all adapters, modes, and databases"
fi
-effective_full_matrix_algorithm="$requested_full_matrix_algorithm"
-if [ "$effective_full_matrix_algorithm" = "auto" ]; then
+effective_target_matrix_algorithm="$requested_target_matrix_algorithm"
+if [ "$effective_target_matrix_algorithm" = "auto" ]; then
if [ "$manual_dispatch" = "true" ]; then
- effective_full_matrix_algorithm="cartesian"
+ effective_target_matrix_algorithm="cartesian"
elif [ "$any_base_change" = "true" ] || [ "$any_feature_triggered" = "true"
]; then
- effective_full_matrix_algorithm="pairwise"
+ effective_target_matrix_algorithm="pairwise"
else
- effective_full_matrix_algorithm="cartesian"
+ effective_target_matrix_algorithm="cartesian"
fi
fi
-echo "::notice::any_base_change=$any_base_change,
any_feature_triggered=$any_feature_triggered, dimensions adapters=$adapters
modes=$modes databases=$databases,
full-matrix-algorithm(requested=$requested_full_matrix_algorithm,effective=$effective_full_matrix_algorithm)"
+echo "::notice::any_base_change=$any_base_change,
any_feature_triggered=$any_feature_triggered, dimensions adapters=$adapters
modes=$modes databases=$databases,
target-matrix-algorithm(requested=$requested_target_matrix_algorithm,effective=$effective_target_matrix_algorithm)"
# Generate smoke-matrix from default or feature-mapped smoke scenarios, and DO
NOT add the extra passthrough job
if [ "$any_feature_triggered" = "true" ]; then
@@ -482,45 +482,45 @@ fi
SMOKE_MATRIX=$(build_matrix "$adapters" "$modes" "$databases"
"$smoke_scenarios_json" false)
log_counts "smoke-matrix" "$SMOKE_MATRIX"
-# Build full-matrix scenarios
+# Build target-matrix scenarios
if [ "$manual_dispatch" = "true" ]; then
- full_scenarios_json="$ALL_SCENARIOS"
- echo "::notice::full-matrix reason=workflow-dispatch, use all scenarios:
$full_scenarios_json"
+ target_scenarios_json="$ALL_SCENARIOS"
+ echo "::notice::target-matrix reason=workflow-dispatch, use all scenarios:
$target_scenarios_json"
elif [ "$any_base_change" = "true" ]; then
- full_scenarios_json="$ALL_SCENARIOS"
- echo "::notice::full-matrix reason=base-change, use all scenarios:
$full_scenarios_json"
+ target_scenarios_json="$ALL_SCENARIOS"
+ echo "::notice::target-matrix reason=base-change, use all scenarios:
$target_scenarios_json"
else
if [ "$any_feature_triggered" = "false" ]; then
- # When no feature triggered, full-matrix is limited to smoke scenario set
- full_scenarios_json="$SMOKE_SCENARIOS"
- echo "::notice::full-matrix reason=no-feature-triggered, use smoke
scenarios: $full_scenarios_json"
+ # When no feature triggered, target-matrix is limited to smoke scenario set
+ target_scenarios_json="$SMOKE_SCENARIOS"
+ echo "::notice::target-matrix reason=no-feature-triggered, use smoke
scenarios: $target_scenarios_json"
else
- full_scenarios_json=$(printf '%s\n' "${scenarios_set[@]}" | jq -R . | jq
-sc .)
- echo "::notice::full-matrix reason=feature-triggered, scenarios:
$full_scenarios_json"
+ target_scenarios_json=$(printf '%s\n' "${scenarios_set[@]}" | jq -R . | jq
-sc .)
+ echo "::notice::target-matrix reason=feature-triggered, scenarios:
$target_scenarios_json"
fi
fi
-FULL_MATRIX_CANDIDATE=$(build_matrix "$adapters" "$modes" "$databases"
"$full_scenarios_json" true)
-FULL_MATRIX_CANDIDATE_COUNT=$(echo "$FULL_MATRIX_CANDIDATE" | jq '.include |
length')
-if [ "$effective_full_matrix_algorithm" = "pairwise" ]; then
- if [ "$FULL_MATRIX_CANDIDATE_COUNT" -le 20 ]; then
- FULL_MATRIX="$FULL_MATRIX_CANDIDATE"
- echo "::notice::full-matrix pairwise skipped due to small candidate set:
candidate=$FULL_MATRIX_CANDIDATE_COUNT"
+TARGET_MATRIX_CANDIDATE=$(build_matrix "$adapters" "$modes" "$databases"
"$target_scenarios_json" true)
+TARGET_MATRIX_CANDIDATE_COUNT=$(echo "$TARGET_MATRIX_CANDIDATE" | jq '.include
| length')
+if [ "$effective_target_matrix_algorithm" = "pairwise" ]; then
+ if [ "$TARGET_MATRIX_CANDIDATE_COUNT" -le 20 ]; then
+ TARGET_MATRIX="$TARGET_MATRIX_CANDIDATE"
+ echo "::notice::target-matrix pairwise skipped due to small candidate set:
candidate=$TARGET_MATRIX_CANDIDATE_COUNT"
else
- FULL_MATRIX=$(build_pairwise_matrix "$FULL_MATRIX_CANDIDATE"
"$full_scenarios_json")
- echo "::notice::full-matrix reduction applied:
candidate=$FULL_MATRIX_CANDIDATE_COUNT, reduced=$(echo "$FULL_MATRIX" | jq
'.include | length')"
+ TARGET_MATRIX=$(build_pairwise_matrix "$TARGET_MATRIX_CANDIDATE"
"$target_scenarios_json")
+ echo "::notice::target-matrix reduction applied:
candidate=$TARGET_MATRIX_CANDIDATE_COUNT, reduced=$(echo "$TARGET_MATRIX" | jq
'.include | length')"
fi
else
- FULL_MATRIX="$FULL_MATRIX_CANDIDATE"
+ TARGET_MATRIX="$TARGET_MATRIX_CANDIDATE"
fi
-log_counts "full-matrix" "$FULL_MATRIX"
+log_counts "target-matrix" "$TARGET_MATRIX"
-# Determine whether there are any jobs at all (based on full-matrix)
-FULL_JOB_COUNT=$(echo "$FULL_MATRIX" | jq '.include | length')
+# Determine whether there are any jobs at all (based on target-matrix)
+TARGET_JOB_COUNT=$(echo "$TARGET_MATRIX" | jq '.include | length')
SMOKE_JOB_COUNT=$(echo "$SMOKE_MATRIX" | jq '.include | length')
-FULL_SMOKE_OVERLAP_COUNT=$(jq -n --argjson full "$FULL_MATRIX" --argjson smoke
"$SMOKE_MATRIX" '
+TARGET_SMOKE_OVERLAP_COUNT=$(jq -n --argjson target "$TARGET_MATRIX" --argjson
smoke "$SMOKE_MATRIX" '
[
- $full.include[] as $job |
+ $target.include[] as $job |
select(
[$smoke.include[] | select(
.adapter == $job.adapter and
@@ -532,22 +532,22 @@ FULL_SMOKE_OVERLAP_COUNT=$(jq -n --argjson full
"$FULL_MATRIX" --argjson smoke "
)
] | length
')
-ESTIMATED_STAGE2_JOBS=$((FULL_JOB_COUNT - FULL_SMOKE_OVERLAP_COUNT))
-TOTAL_TWO_STAGE_JOBS=$((SMOKE_JOB_COUNT + ESTIMATED_STAGE2_JOBS))
-if [ "$FULL_MATRIX_CANDIDATE_COUNT" -eq 0 ]; then
+ESTIMATED_REMAINING_TESTS_JOBS=$((TARGET_JOB_COUNT -
TARGET_SMOKE_OVERLAP_COUNT))
+TOTAL_TWO_STAGE_JOBS=$((SMOKE_JOB_COUNT + ESTIMATED_REMAINING_TESTS_JOBS))
+if [ "$TARGET_MATRIX_CANDIDATE_COUNT" -eq 0 ]; then
EFFECTIVE_REDUCTION_RATIO="0"
else
- EFFECTIVE_REDUCTION_RATIO=$(jq -cn --argjson candidate
"$FULL_MATRIX_CANDIDATE_COUNT" --argjson total "$TOTAL_TWO_STAGE_JOBS" '1 -
($total / $candidate)')
+ EFFECTIVE_REDUCTION_RATIO=$(jq -cn --argjson candidate
"$TARGET_MATRIX_CANDIDATE_COUNT" --argjson total "$TOTAL_TWO_STAGE_JOBS" '1 -
($total / $candidate)')
fi
-echo "::notice::matrix-breakdown full=$FULL_JOB_COUNT smoke=$SMOKE_JOB_COUNT
overlap=$FULL_SMOKE_OVERLAP_COUNT estimated-stage2=$ESTIMATED_STAGE2_JOBS
total-two-stage=$TOTAL_TWO_STAGE_JOBS
effective-reduction-ratio=$EFFECTIVE_REDUCTION_RATIO"
-if [ "$FULL_JOB_COUNT" -eq 0 ]; then
+echo "::notice::matrix-breakdown target=$TARGET_JOB_COUNT
smoke=$SMOKE_JOB_COUNT overlap=$TARGET_SMOKE_OVERLAP_COUNT
estimated-remaining-tests=$ESTIMATED_REMAINING_TESTS_JOBS
total-two-stage=$TOTAL_TWO_STAGE_JOBS
effective-reduction-ratio=$EFFECTIVE_REDUCTION_RATIO"
+if [ "$TARGET_JOB_COUNT" -eq 0 ]; then
echo "smoke-matrix=$(echo "$SMOKE_MATRIX" | jq -c .)" >> "$GITHUB_OUTPUT"
- echo "full-matrix={\"include\":[]}" >> "$GITHUB_OUTPUT"
+ echo "target-matrix={\"include\":[]}" >> "$GITHUB_OUTPUT"
echo "matrix={\"include\":[]}" >> "$GITHUB_OUTPUT"
echo "has-jobs=false" >> "$GITHUB_OUTPUT"
- echo "full-matrix-algorithm=$effective_full_matrix_algorithm" >>
"$GITHUB_OUTPUT"
- echo "full-smoke-overlap-count=0" >> "$GITHUB_OUTPUT"
- echo "estimated-stage2-jobs=0" >> "$GITHUB_OUTPUT"
+ echo "target-matrix-algorithm=$effective_target_matrix_algorithm" >>
"$GITHUB_OUTPUT"
+ echo "target-smoke-overlap-count=0" >> "$GITHUB_OUTPUT"
+ echo "estimated-remaining-tests-jobs=0" >> "$GITHUB_OUTPUT"
echo "total-two-stage-jobs=0" >> "$GITHUB_OUTPUT"
echo "effective-reduction-ratio=0" >> "$GITHUB_OUTPUT"
echo "::notice::No jobs generated after applying all filters and rules,
skipping job execution"
@@ -555,14 +555,14 @@ if [ "$FULL_JOB_COUNT" -eq 0 ]; then
fi
echo "smoke-matrix=$(echo "$SMOKE_MATRIX" | jq -c .)" >> "$GITHUB_OUTPUT"
-echo "full-matrix=$(echo "$FULL_MATRIX" | jq -c .)" >> "$GITHUB_OUTPUT"
-echo "matrix=$(echo "$FULL_MATRIX" | jq -c .)" >> "$GITHUB_OUTPUT"
+echo "target-matrix=$(echo "$TARGET_MATRIX" | jq -c .)" >> "$GITHUB_OUTPUT"
+echo "matrix=$(echo "$TARGET_MATRIX" | jq -c .)" >> "$GITHUB_OUTPUT"
echo "has-jobs=true" >> "$GITHUB_OUTPUT"
-echo "full-matrix-algorithm=$effective_full_matrix_algorithm" >>
"$GITHUB_OUTPUT"
-echo "full-smoke-overlap-count=$FULL_SMOKE_OVERLAP_COUNT" >> "$GITHUB_OUTPUT"
-echo "estimated-stage2-jobs=$ESTIMATED_STAGE2_JOBS" >> "$GITHUB_OUTPUT"
+echo "target-matrix-algorithm=$effective_target_matrix_algorithm" >>
"$GITHUB_OUTPUT"
+echo "target-smoke-overlap-count=$TARGET_SMOKE_OVERLAP_COUNT" >>
"$GITHUB_OUTPUT"
+echo "estimated-remaining-tests-jobs=$ESTIMATED_REMAINING_TESTS_JOBS" >>
"$GITHUB_OUTPUT"
echo "total-two-stage-jobs=$TOTAL_TWO_STAGE_JOBS" >> "$GITHUB_OUTPUT"
echo "effective-reduction-ratio=$EFFECTIVE_REDUCTION_RATIO" >> "$GITHUB_OUTPUT"
-echo "::notice::Generated $SMOKE_JOB_COUNT smoke jobs, $FULL_JOB_COUNT full
jobs, overlap=$FULL_SMOKE_OVERLAP_COUNT, estimated stage2
jobs=$ESTIMATED_STAGE2_JOBS, total two-stage jobs=$TOTAL_TWO_STAGE_JOBS,
effective reduction ratio=$EFFECTIVE_REDUCTION_RATIO"
+echo "::notice::Generated $SMOKE_JOB_COUNT smoke jobs, $TARGET_JOB_COUNT
target jobs, overlap=$TARGET_SMOKE_OVERLAP_COUNT, estimated remaining-tests
jobs=$ESTIMATED_REMAINING_TESTS_JOBS, total two-stage
jobs=$TOTAL_TWO_STAGE_JOBS, effective reduction
ratio=$EFFECTIVE_REDUCTION_RATIO"
exit 0
diff --git
a/.github/workflows/resources/scripts/e2e-sql/generate-remaining-matrix.sh
b/.github/workflows/resources/scripts/e2e-sql/generate-remaining-matrix.sh
index 578c0f85da3..a7256f0b738 100755
--- a/.github/workflows/resources/scripts/e2e-sql/generate-remaining-matrix.sh
+++ b/.github/workflows/resources/scripts/e2e-sql/generate-remaining-matrix.sh
@@ -16,31 +16,31 @@
# limitations under the License.
#
-# Usage: generate-remaining-matrix.sh '<filter-json>' '<full-matrix-json>'
'<smoke-matrix-json>'
-# Generates the Stage 2 matrix by subtracting smoke combinations from the full
matrix.
+# Usage: generate-remaining-matrix.sh '<filter-json>' '<target-matrix-json>'
'<smoke-matrix-json>'
+# Generates the remaining-tests matrix by subtracting smoke combinations from
the target matrix.
# Output: writes matrix=<JSON>, has-remaining-jobs=<true|false> to
$GITHUB_OUTPUT
set -euo pipefail
FILTER_JSON="$1"
-FULL_MATRIX="$2"
+TARGET_MATRIX="$2"
SMOKE_MATRIX="$3"
# Parse completed jobs from smoke matrix
COMPLETED_JOBS=$(echo "$SMOKE_MATRIX" | jq -c '.include // []')
-if [ -z "$FULL_MATRIX" ]; then
+if [ -z "$TARGET_MATRIX" ]; then
echo "matrix={\"include\":[]}" >> "$GITHUB_OUTPUT"
echo "has-remaining-jobs=false" >> "$GITHUB_OUTPUT"
exit 0
fi
-# Subtract Stage 1 completed jobs from the full matrix
+# Subtract Stage 1 completed jobs from the target matrix
REMAINING_JOBS=$(jq -cn \
- --argjson full "$FULL_MATRIX" \
+ --argjson target "$TARGET_MATRIX" \
--argjson completed "$COMPLETED_JOBS" \
'[
- $full.include[] as $job |
+ $target.include[] as $job |
select(
[$completed[] | select(
.adapter == $job.adapter and
diff --git
a/.github/workflows/resources/scripts/e2e-sql/test-generate-e2e-sql-matrix.sh
b/.github/workflows/resources/scripts/e2e-sql/test-generate-e2e-sql-matrix.sh
index c2e875d205d..c0fe02a4f44 100644
---
a/.github/workflows/resources/scripts/e2e-sql/test-generate-e2e-sql-matrix.sh
+++
b/.github/workflows/resources/scripts/e2e-sql/test-generate-e2e-sql-matrix.sh
@@ -43,10 +43,10 @@ build_filters() {
run_script() {
local filters="$1"
local event_name="${2:-pull_request}"
- local full_matrix_algorithm_input="${3:-auto}"
+ local target_matrix_algorithm_input="${3:-auto}"
local output_file
output_file=$(mktemp)
- GITHUB_OUTPUT="$output_file" GITHUB_EVENT_NAME="$event_name"
FULL_MATRIX_ALGORITHM_INPUT="$full_matrix_algorithm_input" \
+ GITHUB_OUTPUT="$output_file" GITHUB_EVENT_NAME="$event_name"
TARGET_MATRIX_ALGORITHM_INPUT="$target_matrix_algorithm_input" \
bash "$TARGET_SCRIPT" "$filters" > /dev/null 2>&1
local rc=$?
cat "$output_file"
@@ -164,37 +164,37 @@ assert_less_than() {
assert_matrix_breakdown_consistency() {
local desc="$1" outputs="$2"
- local smoke_matrix full_matrix overlap stage2 total
- local smoke_count full_count expected_stage2 expected_total
+ local smoke_matrix target_matrix overlap remaining_tests total
+ local smoke_count target_count expected_remaining_tests expected_total
smoke_matrix=$(get_output "$outputs" "smoke-matrix")
- full_matrix=$(get_output "$outputs" "full-matrix")
- overlap=$(get_output "$outputs" "full-smoke-overlap-count")
- stage2=$(get_output "$outputs" "estimated-stage2-jobs")
+ target_matrix=$(get_output "$outputs" "target-matrix")
+ overlap=$(get_output "$outputs" "target-smoke-overlap-count")
+ remaining_tests=$(get_output "$outputs" "estimated-remaining-tests-jobs")
total=$(get_output "$outputs" "total-two-stage-jobs")
smoke_count=$(echo "$smoke_matrix" | jq '.include | length')
- full_count=$(echo "$full_matrix" | jq '.include | length')
- expected_stage2=$((full_count - overlap))
- expected_total=$((smoke_count + stage2))
- assert_eq "$desc: stage2=full-overlap" "$expected_stage2" "$stage2"
- assert_eq "$desc: total=smoke+stage2" "$expected_total" "$total"
+ target_count=$(echo "$target_matrix" | jq '.include | length')
+ expected_remaining_tests=$((target_count - overlap))
+ expected_total=$((smoke_count + remaining_tests))
+ assert_eq "$desc: remaining-tests=target-overlap"
"$expected_remaining_tests" "$remaining_tests"
+ assert_eq "$desc: total=smoke+remaining-tests" "$expected_total" "$total"
}
# Common assertions for full-trigger tests (base change / workflow_dispatch)
assert_full_trigger() {
local label="$1" outputs="$2" expected_algorithm="$3"
assert_eq "$label: has-jobs" "true" "$(get_output "$outputs" "has-jobs")"
- assert_eq "$label: full-matrix-algorithm" "$expected_algorithm"
"$(get_output "$outputs" "full-matrix-algorithm")"
+ assert_eq "$label: target-matrix-algorithm" "$expected_algorithm"
"$(get_output "$outputs" "target-matrix-algorithm")"
local smoke_matrix
smoke_matrix=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "$label: smoke-matrix uses default scenarios"
"$smoke_matrix" '["db","tbl"]'
- local full_matrix
- full_matrix=$(get_output "$outputs" "full-matrix")
- assert_all_scenarios "$label: full-matrix has all 22 scenarios"
"$full_matrix"
- assert_distsql_bootstrap_job "$label: full-matrix" "$full_matrix" "1"
- assert_no_excludes "$label: full-matrix has no excluded combinations"
"$full_matrix"
- assert_extra_passthrough_job "$label: full-matrix has extra passthrough job"
"$full_matrix"
- assert_not_empty "$label: full-smoke-overlap-count exists" "$(get_output
"$outputs" "full-smoke-overlap-count")"
- assert_not_empty "$label: estimated-stage2-jobs exists" "$(get_output
"$outputs" "estimated-stage2-jobs")"
+ local target_matrix
+ target_matrix=$(get_output "$outputs" "target-matrix")
+ assert_all_scenarios "$label: target-matrix has all 22 scenarios"
"$target_matrix"
+ assert_distsql_bootstrap_job "$label: target-matrix" "$target_matrix" "1"
+ assert_no_excludes "$label: target-matrix has no excluded combinations"
"$target_matrix"
+ assert_extra_passthrough_job "$label: target-matrix has extra passthrough
job" "$target_matrix"
+ assert_not_empty "$label: target-smoke-overlap-count exists" "$(get_output
"$outputs" "target-smoke-overlap-count")"
+ assert_not_empty "$label: estimated-remaining-tests-jobs exists"
"$(get_output "$outputs" "estimated-remaining-tests-jobs")"
assert_not_empty "$label: total-two-stage-jobs exists" "$(get_output
"$outputs" "total-two-stage-jobs")"
assert_not_empty "$label: effective-reduction-ratio exists" "$(get_output
"$outputs" "effective-reduction-ratio")"
assert_matrix_breakdown_consistency "$label: matrix-breakdown consistency"
"$outputs"
@@ -229,19 +229,19 @@ echo ""
echo "--- #2: core_infra=true ---"
outputs=$(run_script "$(build_filters core_infra=true)")
assert_full_trigger "#2" "$outputs" "pairwise"
-assert_less_than "#2: pairwise full-matrix is reduced" "$(echo "$(get_output
"$outputs" "full-matrix")" | jq '.include | length')" "119"
+assert_less_than "#2: pairwise target-matrix is reduced" "$(echo "$(get_output
"$outputs" "target-matrix")" | jq '.include | length')" "119"
echo ""
echo "--- #3: test_framework=true ---"
outputs=$(run_script "$(build_filters test_framework=true)")
assert_full_trigger "#3" "$outputs" "pairwise"
-assert_less_than "#3: pairwise full-matrix is reduced" "$(echo "$(get_output
"$outputs" "full-matrix")" | jq '.include | length')" "119"
+assert_less_than "#3: pairwise target-matrix is reduced" "$(echo "$(get_output
"$outputs" "target-matrix")" | jq '.include | length')" "119"
echo ""
echo "--- #4: pom_changes=true ---"
outputs=$(run_script "$(build_filters pom_changes=true)")
assert_full_trigger "#4" "$outputs" "pairwise"
-assert_less_than "#4: pairwise full-matrix is reduced" "$(echo "$(get_output
"$outputs" "full-matrix")" | jq '.include | length')" "119"
+assert_less_than "#4: pairwise target-matrix is reduced" "$(echo "$(get_output
"$outputs" "target-matrix")" | jq '.include | length')" "119"
# ============================================================
# B. workflow_dispatch
@@ -258,7 +258,7 @@ echo ""
echo "--- #6: workflow_dispatch with pairwise ---"
outputs=$(run_script "$(build_filters)" "workflow_dispatch" "pairwise")
assert_full_trigger "#6" "$outputs" "pairwise"
-assert_less_than "#6: workflow_dispatch pairwise full-matrix is reduced"
"$(echo "$(get_output "$outputs" "full-matrix")" | jq '.include | length')"
"119"
+assert_less_than "#6: workflow_dispatch pairwise target-matrix is reduced"
"$(echo "$(get_output "$outputs" "target-matrix")" | jq '.include | length')"
"119"
echo ""
echo "--- #7: workflow_dispatch with invalid algorithm falls back to
auto(cartesian) ---"
@@ -276,7 +276,7 @@ echo "--- #8: adapter_proxy only ---"
outputs=$(run_script "$(build_filters adapter_proxy=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_all_field_eq "#8: smoke all adapter=proxy" "$smoke" "adapter" "proxy"
-assert_distsql_bootstrap_job "#8: proxy-only full-matrix" "$(get_output
"$outputs" "full-matrix")" "0"
+assert_distsql_bootstrap_job "#8: proxy-only target-matrix" "$(get_output
"$outputs" "target-matrix")" "0"
echo ""
echo "--- #9: adapter_jdbc only ---"
@@ -307,7 +307,7 @@ echo "--- #13: mode_cluster only ---"
outputs=$(run_script "$(build_filters mode_cluster=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_all_field_eq "#13: smoke all mode=Cluster" "$smoke" "mode" "Cluster"
-assert_distsql_bootstrap_job "#13: Cluster-only full-matrix" "$(get_output
"$outputs" "full-matrix")" "0"
+assert_distsql_bootstrap_job "#13: Cluster-only target-matrix" "$(get_output
"$outputs" "target-matrix")" "0"
echo ""
echo "--- #14: mode_core only ---"
@@ -326,62 +326,62 @@ echo "--- #15: feature_sharding ---"
outputs=$(run_script "$(build_filters feature_sharding=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#15: sharding smoke scenarios" "$smoke" '["db","tbl"]'
-full=$(get_output "$outputs" "full-matrix")
+target=$(get_output "$outputs" "target-matrix")
expected_sharding='["db","tbl","dbtbl_with_readwrite_splitting","dbtbl_with_readwrite_splitting_and_encrypt","sharding_and_encrypt","sharding_and_shadow","sharding_encrypt_shadow","mask_sharding","mask_encrypt_sharding","db_tbl_sql_federation"]'
-assert_scenarios "#15: sharding scenarios" "$full" "$expected_sharding"
-assert_all_dimensions "#15" "$full"
-assert_eq "#15: full-matrix-algorithm" "pairwise" "$(get_output "$outputs"
"full-matrix-algorithm")"
+assert_scenarios "#15: sharding scenarios" "$target" "$expected_sharding"
+assert_all_dimensions "#15" "$target"
+assert_eq "#15: target-matrix-algorithm" "pairwise" "$(get_output "$outputs"
"target-matrix-algorithm")"
echo ""
echo "--- #16: feature_encrypt ---"
outputs=$(run_script "$(build_filters feature_encrypt=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#16: encrypt smoke scenarios" "$smoke" '["encrypt"]'
-full=$(get_output "$outputs" "full-matrix")
+target=$(get_output "$outputs" "target-matrix")
expected_encrypt='["encrypt","dbtbl_with_readwrite_splitting_and_encrypt","sharding_and_encrypt","encrypt_and_readwrite_splitting","encrypt_shadow","sharding_encrypt_shadow","mask_encrypt","mask_encrypt_sharding"]'
-assert_scenarios "#16: encrypt scenarios" "$full" "$expected_encrypt"
-assert_all_dimensions "#16" "$full"
-assert_eq "#16: full-matrix-algorithm" "pairwise" "$(get_output "$outputs"
"full-matrix-algorithm")"
+assert_scenarios "#16: encrypt scenarios" "$target" "$expected_encrypt"
+assert_all_dimensions "#16" "$target"
+assert_eq "#16: target-matrix-algorithm" "pairwise" "$(get_output "$outputs"
"target-matrix-algorithm")"
echo ""
echo "--- #17: feature_readwrite_splitting ---"
outputs=$(run_script "$(build_filters feature_readwrite_splitting=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#17: readwrite_splitting smoke scenarios" "$smoke"
'["readwrite_splitting"]'
-full=$(get_output "$outputs" "full-matrix")
+target=$(get_output "$outputs" "target-matrix")
expected_rws='["readwrite_splitting","dbtbl_with_readwrite_splitting","dbtbl_with_readwrite_splitting_and_encrypt","encrypt_and_readwrite_splitting","readwrite_splitting_and_shadow"]'
-assert_scenarios "#17: readwrite_splitting scenarios" "$full" "$expected_rws"
-assert_all_dimensions "#17" "$full"
+assert_scenarios "#17: readwrite_splitting scenarios" "$target" "$expected_rws"
+assert_all_dimensions "#17" "$target"
echo ""
echo "--- #18: feature_shadow ---"
outputs=$(run_script "$(build_filters feature_shadow=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#18: shadow smoke scenarios" "$smoke" '["shadow"]'
-full=$(get_output "$outputs" "full-matrix")
+target=$(get_output "$outputs" "target-matrix")
expected_shadow='["shadow","encrypt_shadow","readwrite_splitting_and_shadow","sharding_and_shadow","sharding_encrypt_shadow"]'
-assert_scenarios "#18: shadow scenarios" "$full" "$expected_shadow"
-assert_all_dimensions "#18" "$full"
+assert_scenarios "#18: shadow scenarios" "$target" "$expected_shadow"
+assert_all_dimensions "#18" "$target"
echo ""
echo "--- #19: feature_mask ---"
outputs=$(run_script "$(build_filters feature_mask=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#19: mask smoke scenarios" "$smoke" '["mask"]'
-full=$(get_output "$outputs" "full-matrix")
+target=$(get_output "$outputs" "target-matrix")
expected_mask='["mask","mask_encrypt","mask_sharding","mask_encrypt_sharding"]'
-assert_scenarios "#19: mask scenarios" "$full" "$expected_mask"
-assert_all_dimensions "#19" "$full"
+assert_scenarios "#19: mask scenarios" "$target" "$expected_mask"
+assert_all_dimensions "#19" "$target"
echo ""
echo "--- #20: feature_distsql ---"
outputs=$(run_script "$(build_filters feature_distsql=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#20: distsql smoke scenarios" "$smoke" '["distsql_rdl"]'
-full=$(get_output "$outputs" "full-matrix")
-assert_scenarios "#20: distsql scenarios" "$full"
'["distsql_rdl","distsql_rdl_empty"]'
-assert_all_dimensions "#20" "$full" "3"
-assert_distsql_bootstrap_job "#20: DistSQL full-matrix" "$full" "1"
+target=$(get_output "$outputs" "target-matrix")
+assert_scenarios "#20: distsql scenarios" "$target"
'["distsql_rdl","distsql_rdl_empty"]'
+assert_all_dimensions "#20" "$target" "3"
+assert_distsql_bootstrap_job "#20: DistSQL target-matrix" "$target" "1"
assert_distsql_bootstrap_job "#20: DistSQL smoke-matrix" "$smoke" "0"
echo ""
@@ -389,18 +389,18 @@ echo "--- #21: feature_sql_federation ---"
outputs=$(run_script "$(build_filters feature_sql_federation=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#21: sql_federation smoke scenarios" "$smoke"
'["db_tbl_sql_federation"]'
-full=$(get_output "$outputs" "full-matrix")
-assert_scenarios "#21: sql_federation scenarios" "$full"
'["db_tbl_sql_federation"]'
-assert_all_dimensions "#21" "$full"
+target=$(get_output "$outputs" "target-matrix")
+assert_scenarios "#21: sql_federation scenarios" "$target"
'["db_tbl_sql_federation"]'
+assert_all_dimensions "#21" "$target"
echo ""
echo "--- #22: feature_broadcast ---"
outputs=$(run_script "$(build_filters feature_broadcast=true)")
smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#22: broadcast smoke scenarios" "$smoke" '["empty_rules"]'
-full=$(get_output "$outputs" "full-matrix")
-assert_scenarios "#22: broadcast scenarios" "$full" '["empty_rules"]'
-assert_all_dimensions "#22" "$full"
+target=$(get_output "$outputs" "target-matrix")
+assert_scenarios "#22: broadcast scenarios" "$target" '["empty_rules"]'
+assert_all_dimensions "#22" "$target"
# ============================================================
# E. Mixed dimensions
@@ -412,9 +412,9 @@ echo ""
echo "--- #23: base change overrides dimension filters ---"
outputs_mixed=$(run_script "$(build_filters adapter_proxy=true
mode_standalone=true database_mysql=true core_infra=true)")
outputs_base=$(run_script "$(build_filters core_infra=true)")
-assert_eq "#23: same full-matrix as core_infra only" \
- "$(get_output "$outputs_base" "full-matrix")" \
- "$(get_output "$outputs_mixed" "full-matrix")"
+assert_eq "#23: same target-matrix as core_infra only" \
+ "$(get_output "$outputs_base" "target-matrix")" \
+ "$(get_output "$outputs_mixed" "target-matrix")"
assert_eq "#23: same smoke-matrix as core_infra only" \
"$(get_output "$outputs_base" "smoke-matrix")" \
"$(get_output "$outputs_mixed" "smoke-matrix")"
@@ -423,9 +423,9 @@ echo ""
echo "--- #24: feature trigger overrides dimension filters ---"
outputs_mixed=$(run_script "$(build_filters adapter_jdbc=true
feature_sharding=true)")
outputs_feature=$(run_script "$(build_filters feature_sharding=true)")
-assert_eq "#24: same full-matrix as feature_sharding only" \
- "$(get_output "$outputs_feature" "full-matrix")" \
- "$(get_output "$outputs_mixed" "full-matrix")"
+assert_eq "#24: same target-matrix as feature_sharding only" \
+ "$(get_output "$outputs_feature" "target-matrix")" \
+ "$(get_output "$outputs_mixed" "target-matrix")"
assert_eq "#24: same smoke-matrix as feature_sharding only" \
"$(get_output "$outputs_feature" "smoke-matrix")" \
"$(get_output "$outputs_mixed" "smoke-matrix")"
@@ -437,14 +437,14 @@ smoke=$(get_output "$outputs" "smoke-matrix")
assert_scenarios "#25: smoke scenarios are merged and deduplicated" "$smoke"
'["db","encrypt","tbl"]'
echo ""
-echo "--- #26: DistSQL bootstrap remains in Stage 2 ---"
+echo "--- #26: DistSQL bootstrap remains in Remaining Tests ---"
filters=$(build_filters feature_distsql=true)
outputs=$(run_script "$filters" "pull_request" "cartesian")
-full=$(get_output "$outputs" "full-matrix")
+target=$(get_output "$outputs" "target-matrix")
smoke=$(get_output "$outputs" "smoke-matrix")
-assert_distsql_bootstrap_job "#26: cartesian full-matrix" "$full" "1"
+assert_distsql_bootstrap_job "#26: cartesian target-matrix" "$target" "1"
output_file=$(mktemp)
-GITHUB_OUTPUT="$output_file" bash "$SCRIPT_DIR/generate-remaining-matrix.sh"
"$filters" "$full" "$smoke"
+GITHUB_OUTPUT="$output_file" bash "$SCRIPT_DIR/generate-remaining-matrix.sh"
"$filters" "$target" "$smoke"
remaining=$(get_output "$(cat "$output_file")" "matrix")
rm -f "$output_file"
assert_distsql_bootstrap_job "#26: remaining-matrix" "$remaining" "1"