Skip to content

Commit 3a90147

Browse files
authored
feat: add matrix tests to containers (#637)
* feat: add matrix tests * fix: apply PR review * fix: apply agent suggestions
1 parent d855876 commit 3a90147

3 files changed

Lines changed: 746 additions & 28 deletions

File tree

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,23 +169,40 @@ By default, the script clones the repository at the current commit for clean bui
169169
# Force rebuild of base image only (useful after Alpine/Ubuntu updates)
170170
./utils/run-containers-tests.sh --libc=musl --rebuild-base
171171

172+
# Preview all supported musl cells (sanitizer configs are skipped, matching CI policy)
173+
./utils/run-containers-tests.sh --matrix --libc=musl
174+
175+
# Run all supported musl cells without an interactive prompt
176+
./utils/run-containers-tests.sh --matrix --libc=musl --run
177+
178+
# Preview selected JDKs across every supported libc/architecture pair
179+
./utils/run-containers-tests.sh --libc=all --jdk=8,17,21 --arch=all
180+
181+
# Run all OpenJ9 cells
182+
./utils/run-containers-tests.sh --matrix --jdk=j9 --run
183+
172184
# Show options
173185
./utils/run-containers-tests.sh --help
174186
```
175187

176188
Supported options:
177-
- `--libc=glibc|musl` (default: glibc)
178-
- `--jdk=8|11|17|21|25|8-j9|11-j9|17-j9|21-j9|17-graal|21-graal|25-graal` (default: 21)
179-
- `--arch=x64|aarch64` (default: auto-detect)
180-
- `--config=debug|release|asan|tsan` (default: debug)
189+
- `--libc=glibc|musl|all[,..]` (default: glibc)
190+
- `--jdk=8|11|17|21|25|8-j9|11-j9|17-j9|21-j9|17-graal|21-graal|25-graal|regular|j9|graal|all[,..]` (default: 21)
191+
- `--arch=x64|aarch64|all[,..]` (default: auto-detect)
192+
- `--config=debug|release|asan|tsan|all[,..]` (default: debug)
181193
- `--container=podman|docker` (default: podman)
182194
- `--tests="TestPattern"`
183195
- `--gtest` (enable C++ gtests, disabled by default for faster runs)
184-
- `--gtest-task=Task` (run one C++ gtest task; accepts `elfparser_ut` or a full task path like `:ddprof-lib:gtestAsan_elfparser_ut`)
196+
- `--gtest-task=Task` (run one C++ gtest task; matrix runs require a short name like `elfparser_ut`, while single-cell runs also accept a full task path like `:ddprof-lib:gtestAsan_elfparser_ut`)
185197
- `--shell` (interactive shell instead of running tests)
186198
- `--mount` (mount local repo instead of cloning - faster but may have stale artifacts)
187199
- `--rebuild` (force rebuild of all container images)
188200
- `--rebuild-base` (force rebuild of base image only)
201+
- `--matrix` (preview a full test matrix; unset dimensions expand to `all`)
202+
- `--run` (execute an inferred matrix without prompting)
203+
- `--fail-fast` (stop matrix execution on first failure)
204+
205+
Single-value commands run one configuration immediately. When any dimension expands to multiple cells, the script prints a compact status table first; interactive terminals ask for confirmation, while non-interactive runs require `--run` to execute. Matrix execution prints the status table again after all cells finish and writes summaries to `build/reports/container-matrix/summary.md` and `build/reports/container-matrix/summary.json`. Cells not run because of `--fail-fast` are reported as cancelled separately from unsupported cells that are skipped.
189206

190207
## Unwinding Validation Tool
191208

utils/README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,21 @@ Runs tests in containers across various OS/libc/JDK combinations, mirroring the
8484
**Usage:**
8585
```bash
8686
./utils/run-containers-tests.sh [options]
87-
--libc=glibc|musl (default: glibc)
88-
--jdk=8|11|17|21|25|8-j9|... (default: 21)
89-
--arch=x64|aarch64 (default: auto-detect)
90-
--config=debug|release|asan|tsan (default: debug)
87+
--libc=glibc|musl|all[,..] (default: glibc)
88+
--jdk=8|11|17|21|25|8-j9|...|regular|j9|graal|all[,..]
89+
(default: 21)
90+
--arch=x64|aarch64|all[,..] (default: auto-detect)
91+
--config=debug|release|asan|tsan|all[,..] (default: debug)
9192
--container=podman|docker (default: podman)
9293
--tests="TestPattern" (optional)
9394
--gtest (enable C++ gtests)
9495
--gtest-task=Task (run one C++ gtest task)
9596
--shell (drop to shell instead of running tests)
9697
--mount (mount local repo instead of cloning)
9798
--rebuild (force rebuild of container images)
99+
--matrix (preview a full matrix)
100+
--run (execute an inferred matrix without prompting)
101+
--fail-fast (stop matrix execution on first failure)
98102
```
99103

100104
Examples:
@@ -104,8 +108,19 @@ Examples:
104108

105109
# Use Docker instead of the default Podman runtime
106110
./utils/run-containers-tests.sh --container=docker --libc=glibc --jdk=21
111+
112+
# Preview selected JDKs across every supported libc/architecture pair
113+
./utils/run-containers-tests.sh --libc=all --jdk=8,17,21 --arch=all
114+
115+
# Run all supported musl cells without an interactive prompt
116+
./utils/run-containers-tests.sh --matrix --libc=musl --run
117+
118+
# Run all OpenJ9 cells
119+
./utils/run-containers-tests.sh --matrix --jdk=j9 --run
107120
```
108121

122+
Single-value commands run one container test configuration immediately. When any dimension expands to multiple cells, the script prints a compact status table first; interactive terminals ask for confirmation, while non-interactive runs require `--run` to execute. Matrix execution prints the status table again after all cells finish and writes summaries to `build/reports/container-matrix/summary.md` and `build/reports/container-matrix/summary.json`. Matrix gtest runs require a short `--gtest-task` name so the task follows each cell's configuration. Cells not run because of `--fail-fast` are reported as cancelled separately from unsupported cells that are skipped.
123+
109124
### `patch-dd-java-agent.sh`
110125

111126
Patches a `dd-java-agent.jar` with a locally-built ddprof library for quick local testing without a full dd-trace-java rebuild.

0 commit comments

Comments
 (0)