From 13a3663cb5cf11ecae8a0738d23b72d18e3c17cd Mon Sep 17 00:00:00 2001 From: ddsign Date: Wed, 28 Oct 2026 12:57:26 -0400 Subject: [PATCH 1/2] ci: run all implemented debugger scenarios on PRs Task: run every php debugger scenario that has active tests at least once per PR, with one debugger job per DI-relevant config, per user requirements typed in session (the Debugger/DI test coverage rules). The existing #4385 SCM matrix entries on apache-mod-8.0 and php-fpm-8.5 become multi-scenario entries carrying their config's scenario set (apache-mod-8.0: SCM, EXPRESSION_LANGUAGE, INPRODUCT_ENABLEMENT; php-fpm-8.5: SCM, TELEMETRY, EXCEPTION_REPLAY), and one job is added on apache-mod-8.0-zts (PROBES_SNAPSHOT, PII_REDACTION) so the threaded SAPI is covered. Matrix scripts switch to the tracer-release loop so a TESTSUITE value can list multiple scenarios; single-scenario values behave as before. The scenarios whose php tests are all manifest-skipped (CAPTURE_TIMEOUT, EVALUATION_TIMEOUT, SYMDB) stay out until implemented; each becomes a one-word addition to an existing entry when its tests activate. Mandated by user: the coverage rules and the design constraints (every runnable scenario at least once per PR, similar code paths spread across configs, no scenario in every config, no ten-scenario job, no per-scenario jobs, CI completion time unchanged, existing segmentation respected). Own decisions: the scenario-to-config assignment, the multi-scenario TESTSUITE mechanism, the zts weblog choice (apache-mod-8.0-zts), keeping EXPRESSION_LANGUAGE off zts due to open system-tests #8200. --- .gitlab/generate-package.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitlab/generate-package.php b/.gitlab/generate-package.php index dace28e5f5..498c755e5f 100644 --- a/.gitlab/generate-package.php +++ b/.gitlab/generate-package.php @@ -1553,9 +1553,9 @@ function package_extension_jobs(array $platform, string $kind = "all"): array - APPSEC_RUNTIME_ACTIVATION - INTEGRATIONS - CROSSED_TRACING_LIBRARIES - - DEBUGGER_PROBES_SNAPSHOT_WITH_SCM + - "DEBUGGER_PROBES_SNAPSHOT_WITH_SCM DEBUGGER_EXPRESSION_LANGUAGE DEBUGGER_INPRODUCT_ENABLEMENT" script: - - ./run.sh $TESTSUITE + - FAILED=""; for S in $TESTSUITE; do echo "=== Running $S ==="; ./run.sh $S || FAILED="$FAILED $S"; done; if [ -n "$FAILED" ]; then echo "Failed scenarios:$FAILED"; exit 1; fi "System Tests: [php-fpm-8.5, default]": extends: .system_tests @@ -1578,9 +1578,16 @@ function package_extension_jobs(array $platform, string $kind = "all"): array - APPSEC_RUNTIME_ACTIVATION - INTEGRATIONS - CROSSED_TRACING_LIBRARIES - - DEBUGGER_PROBES_SNAPSHOT_WITH_SCM + - "DEBUGGER_PROBES_SNAPSHOT_WITH_SCM DEBUGGER_TELEMETRY DEBUGGER_EXCEPTION_REPLAY" script: - - ./run.sh $TESTSUITE + - FAILED=""; for S in $TESTSUITE; do echo "=== Running $S ==="; ./run.sh $S || FAILED="$FAILED $S"; done; if [ -n "$FAILED" ]; then echo "Failed scenarios:$FAILED"; exit 1; fi + +"System Tests: [apache-mod-8.0-zts, debugger]": + extends: .system_tests + variables: + BUILD_SH_ARGS: "-i weblog -w apache-mod-8.0-zts php" + script: + - FAILED=""; for S in DEBUGGER_PROBES_SNAPSHOT DEBUGGER_PII_REDACTION; do echo "=== Running $S ==="; ./run.sh $S || FAILED="$FAILED $S"; done; if [ -n "$FAILED" ]; then echo "Failed scenarios:$FAILED"; exit 1; fi Date: Wed, 28 Oct 2026 13:08:21 -0400 Subject: [PATCH 2/2] ci: extract the system-tests scenario loop into a generator helper Task: the user flagged the scenario loop that the previous commit pasted into three jobs; remove the duplication. system_tests_run_scenarios() in generate-package.php emits the loop step, following the generator's idiom for shared script snippets (dockerhub_login() in generate-common.php). All four call sites use it, including the pre-existing tracer-release job loop from dbf442b60. The rendered pipeline YAML is unchanged. Mandated by: the global code-duplication rule (extract shared helpers) and user approval in session. Own decisions: the helper name, its placement in generate-package.php (the only generator using it), and the parameter taking shell words. --- .gitlab/generate-package.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitlab/generate-package.php b/.gitlab/generate-package.php index 498c755e5f..1e587faa35 100644 --- a/.gitlab/generate-package.php +++ b/.gitlab/generate-package.php @@ -76,6 +76,19 @@ function package_extension_jobs(array $platform, string $kind = "all"): array return $jobs; } +/** + * Emits a job script step that runs each listed system-tests scenario in sequence. + * Every scenario runs even when an earlier one fails; the step then fails, listing the failed scenarios. + * + * @param string $scenarios Shell words expanding to the scenario names: a variable reference such as '$TESTSUITE', or literal names. + */ +function system_tests_run_scenarios(string $scenarios): void +{ +?> + - FAILED=""; for S in ; do echo "=== Running $S ==="; ./run.sh $S || FAILED="$FAILED $S"; done; if [ -n "$FAILED" ]; then echo "Failed scenarios:$FAILED"; exit 1; fi + "x86_64-unknown-linux-gnu", @@ -1555,7 +1568,7 @@ function package_extension_jobs(array $platform, string $kind = "all"): array - CROSSED_TRACING_LIBRARIES - "DEBUGGER_PROBES_SNAPSHOT_WITH_SCM DEBUGGER_EXPRESSION_LANGUAGE DEBUGGER_INPRODUCT_ENABLEMENT" script: - - FAILED=""; for S in $TESTSUITE; do echo "=== Running $S ==="; ./run.sh $S || FAILED="$FAILED $S"; done; if [ -n "$FAILED" ]; then echo "Failed scenarios:$FAILED"; exit 1; fi + "System Tests: [php-fpm-8.5, default]": extends: .system_tests @@ -1580,14 +1593,14 @@ function package_extension_jobs(array $platform, string $kind = "all"): array - CROSSED_TRACING_LIBRARIES - "DEBUGGER_PROBES_SNAPSHOT_WITH_SCM DEBUGGER_TELEMETRY DEBUGGER_EXCEPTION_REPLAY" script: - - FAILED=""; for S in $TESTSUITE; do echo "=== Running $S ==="; ./run.sh $S || FAILED="$FAILED $S"; done; if [ -n "$FAILED" ]; then echo "Failed scenarios:$FAILED"; exit 1; fi + "System Tests: [apache-mod-8.0-zts, debugger]": extends: .system_tests variables: BUILD_SH_ARGS: "-i weblog -w apache-mod-8.0-zts php" script: - - FAILED=""; for S in DEBUGGER_PROBES_SNAPSHOT DEBUGGER_PII_REDACTION; do echo "=== Running $S ==="; ./run.sh $S || FAILED="$FAILED $S"; done; if [ -n "$FAILED" ]; then echo "Failed scenarios:$FAILED"; exit 1; fi + # THREAD_CONTEXT_SHARING needs CWS, which needs the kernel filesystems and the