chore(ci): name failing tests in the django gate - #70815
Conversation
529f7b7 to
1b6a99f
Compare
1b6a99f to
368a4d5
Compare
368a4d5 to
c0eef1c
Compare
|
Reviews (1): Last reviewed commit: "chore(ci): name failing tests in the dja..." | Re-trigger Greptile |
| with: | ||
| name: product-junit-results-${{ strategy.job-index }} | ||
| path: junit-staging/junit-product-*.xml | ||
| if-no-files-found: ignore |
There was a problem hiding this comment.
Rerunning a product matrix job uploads the same product-junit-results-${{ strategy.job-index }} name, but artifacts are immutable unless overwrite is enabled. The upload step then fails with a conflict and can turn a passing test rerun into a failed job; the coverage upload below already enables overwrite for this case.
| with: | |
| name: product-junit-results-${{ strategy.job-index }} | |
| path: junit-staging/junit-product-*.xml | |
| if-no-files-found: ignore | |
| with: | |
| name: product-junit-results-${{ strategy.job-index }} | |
| path: junit-staging/junit-product-*.xml | |
| if-no-files-found: ignore | |
| overwrite: true |
| for path in glob.glob(os.path.join(ROOT, "**", "junit-*.xml"), recursive=True): | ||
| artifact = os.path.relpath(path, ROOT).split(os.sep)[0] |
There was a problem hiding this comment.
Single Artifact Loses Shard Name
When the pattern matches exactly one artifact, download-artifact can extract its files directly into ROOT instead of an artifact-named directory. The first relative path component is then the XML filename, so a selected run reports junit-core.xml as the shard rather than the failing matrix shard.
Problem
The "Django Tests Pass" gate tells you which job failed, not which test. Product test failures can't even be named, because their JUnit never gets uploaded. On this run it just says the product matrix failed, so you're left digging through the shard by hand.
Changes
Check dependency resultsstep (GitHub only auto-expands the step that failed), and also writes a job-summary table plus file-linked::error::annotations.junit-product-<name>.xmlunder aproduct-junit-results-*prefix so it stays out of the snob shadow verdict and the timing reporter.|| true) and skipped on green runs, so it never touches the pass/fail result.Before
flowchart LR D[Django shards] --> G{{Django Tests Pass}} P[Product shards] --> G G --> R[Reports which JOB failed] classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff; classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000; classDef phGray fill:#e5e7eb,stroke:#c7ccd1,color:#000; class G phBlue; class R phYellow; class D,P phGray;After
flowchart LR D[Django shards] -->|result| G{{Django Tests Pass}} P[Product shards] -->|result| G D -. JUnit .-> A[(Artifacts)] P -. JUnit .-> A A -. "download (on failure)" .-> G G --> R[Reports which TEST failed + file annotations] classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff; classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000; classDef phGray fill:#e5e7eb,stroke:#c7ccd1,color:#000; class G phBlue; class R phYellow; class D,P,A phGray;Live proof: a run where a test was failed on purpose, then reverted
posthog/test/test_datetime.py::test_ci_rollup_demo_remove_before_mergePlus a file-linked annotation on the Checks tab. That run predates the current step layout and staged product upload, but uses the same parser, validated locally for backend, product, green-silent, and the XXE guard. The failing test was a throwaway and has been reverted.
Note
No change to test behavior. The verdict is untouched; this only adds detail on failure.
How did you test this code?
hogli lint:workflows6/6,actionlint0 new,ci:preflight --strictgreen.Automatic notifications
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Confirmed the rollup gate still exists (it does:
django_tests, strengthened recently) before building this out. Claude (Opus 4.8) wrote the first pass and a/simplifyrun tightened it.junit-product-<name>.xmlso it survives upload-artifact's path collapse (same trick as the coverage step); the name is parsed back out of the filename.product-junit-results-*prefix sotest-selection-verdictandreport-test-timingsdon't ingest product results.defusedxml.