Skip to content

Commit b65f67e

Browse files
committed
CI: Run 4 versions of the wordpress unit test job - this/plain/tee/quite
FYI: After running all 4 versions of '🔬 Unit Test WordPress', we'll ask Claude AI to help us analyze the build failure and let us know what's the problem there. We'll see which of those 4 versions could be used to successfully analyze the logs, effectively overcoming this long lines log parsing challenges we are facing.
1 parent f997f1d commit b65f67e

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.buildkite/commands/run-unit-tests.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,31 @@ fi
77

88
"$(dirname "${BASH_SOURCE[0]}")/restore-cache.sh"
99

10+
echo "--- 🧪 Create logs directory"
11+
mkdir -p build/logs
12+
1013
echo "--- 🧪 Testing"
1114
set +e
1215
if [ "$1" == "wordpress" ]; then
1316
test_suite="testWordpressVanillaRelease koverXmlReportWordpressVanillaRelease"
1417
test_results_dir="WordPress/build/test-results"
1518
test_log_dir="${test_results_dir}/*/*.xml"
1619
code_coverage_report="WordPress/build/reports/kover/reportWordpressVanillaRelease.xml"
20+
elif [ "$1" == "wordpress-plain" ]; then
21+
test_suite="testWordpressVanillaRelease koverXmlReportWordpressVanillaRelease --console=plain"
22+
test_results_dir="WordPress/build/test-results"
23+
test_log_dir="${test_results_dir}/*/*.xml"
24+
code_coverage_report="WordPress/build/reports/kover/reportWordpressVanillaRelease.xml"
25+
elif [ "$1" == "wordpress-tee" ]; then
26+
test_suite="testWordpressVanillaRelease koverXmlReportWordpressVanillaRelease --console=plain 2>&1 | tee build/logs/gradle-full.log"
27+
test_results_dir="WordPress/build/test-results"
28+
test_log_dir="${test_results_dir}/*/*.xml"
29+
code_coverage_report="WordPress/build/reports/kover/reportWordpressVanillaRelease.xml"
30+
elif [ "$1" == "wordpress-quiet" ]; then
31+
test_suite="testWordpressVanillaRelease koverXmlReportWordpressVanillaRelease --console=plain --quiet > build/logs/gradle-errors.log 2>&1 || true"
32+
test_results_dir="WordPress/build/test-results"
33+
test_log_dir="${test_results_dir}/*/*.xml"
34+
code_coverage_report="WordPress/build/reports/kover/reportWordpressVanillaRelease.xml"
1735
elif [ "$1" == "processors" ]; then
1836
test_suite=":libs:processors:test :libs:processors:koverXmlReport"
1937
test_results_dir="libs/processors/build/test-results"

.buildkite/pipeline.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,38 @@ steps:
113113
artifact_paths:
114114
- "**/build/test-results/merged-test-results.xml"
115115

116+
- label: "🔬 Unit Test WordPress (Plain)"
117+
command: ".buildkite/commands/run-unit-tests.sh wordpress-plain"
118+
plugins:
119+
- $CI_TOOLKIT
120+
- $TEST_COLLECTOR :
121+
<<: *test_collector_common_params
122+
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_WORDPRESS"
123+
artifact_paths:
124+
- "**/build/test-results/merged-test-results.xml"
125+
126+
- label: "🔬 Unit Test WordPress (Tee)"
127+
command: ".buildkite/commands/run-unit-tests.sh wordpress-tee"
128+
plugins:
129+
- $CI_TOOLKIT
130+
- $TEST_COLLECTOR :
131+
<<: *test_collector_common_params
132+
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_WORDPRESS"
133+
artifact_paths:
134+
- "**/build/test-results/merged-test-results.xml"
135+
- "**/build/logs/gradle-full.log"
136+
137+
- label: "🔬 Unit Test WordPress (Quiet)"
138+
command: ".buildkite/commands/run-unit-tests.sh wordpress-quiet"
139+
plugins:
140+
- $CI_TOOLKIT
141+
- $TEST_COLLECTOR :
142+
<<: *test_collector_common_params
143+
api-token-env-name: "BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS_WORDPRESS"
144+
artifact_paths:
145+
- "**/build/test-results/merged-test-results.xml"
146+
- "**/build/logs/gradle-errors.log"
147+
116148
- label: "🔬 Unit Test Processors"
117149
command: ".buildkite/commands/run-unit-tests.sh processors"
118150
plugins:

0 commit comments

Comments
 (0)