Fix Allure artifacts reported as null links - #918
Merged
Conversation
`uploader.uploadFileByPath()` resolves to the S3 link as a plain string, but AllureReader read `.link` off it. On a string that resolves to the legacy `String.prototype.link` method, which is truthy, so the `a && a.link` guard passed and the "Uploaded N artifacts" log looked correct — but the mapped values were functions, and `JSON.stringify` turns those into `null` inside an array. Every Allure artifact reached Testomat.io as `"artifacts":[null,null]` even though the upload to S3 had succeeded. Also collect attachments made inside Allure steps. They were dropped entirely: `processAllureResult` only read `result.attachments`, so nothing was uploaded or rendered in the step tree. They now upload under `<runId>/<rid>/steps/` and land on `step.artifacts` as links, matching how the client handles step artifacts — inline in the step tree, out of the test-level list. The same null-link leak is fixed in XmlReader, where skipped and failed uploads were sent as `null`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DavertMik
force-pushed
the
fix-allure-artifacts
branch
from
August 12, 2026 22:24
d0bcff6 to
7c0ec4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allure artifacts uploaded to S3 successfully but arrived at Testomat.io as
"artifacts":[null,null,null], so nothing rendered in the UI — neither in the artifacts block nor in steps. Reported against 2.10.0 and 2.13.0; present since #852.Root cause
uploader.uploadFileByPath()resolves to the S3 link as a plain string (src/uploader.js:271), butAllureReader.uploadArtifacts()treated it as an object:Reading
.linkoff a string doesn't yieldundefined— it hitsString.prototype.link, the legacy Annex B HTML method. That function is truthy, so:filterkeeps every element, and the count stays right🗄️ Uploaded 3 artifactsprints, so the log looks healthymapyields three functionsJSON.stringifyserializes functions inside an array asnullThis explains every symptom, including why no configuration helped: the upload genuinely succeeded and the file really was in the bucket — only the link was destroyed on the way into the payload. No combination of Share credentials, env credentials, or
TESTOMATIO_PRIVATE_ARTIFACTScould have worked around it.Step attachments were dropped entirely
processAllureResultread onlyresult.attachments, andconvertStepsignoredstep.attachments. Attachments made insideAllure.stepwere never uploaded or referenced.They are now collected per step, uploaded under
<runId>/<rid>/steps/, and written back tostep.artifactsas links — matching the convention inclient.js, where step artifacts render inline in the step tree and stay out of the test-level list.Behavior change worth a look: on the repo fixtures,
sample_allure/backendgoes from 0 → 6 artifacts andsample_allure/iosfrom 1 → 9. Teams that attach request/response dumps to every step will see S3 volume per run grow accordingly.TESTOMATIO_ARTIFACT_MAX_SIZE_MBremains the throttle.Also noting: when S3 credentials are absent, step artifacts fall to the deferred
upload-artifactspath, which re-attaches by test rid — so on that path they land at test level and lose step placement.Same bug class in XmlReader
src/xmlReader.js:536had no filter at all, so skipped and failed uploads leakedundefined→nullinto JUnit payloads. Fixed, and the log now reports the real count rather than the attempted count.Test plan
tests/unit/allure_artifacts_test.jsasserts on the JSON round-trip. A length or truthiness check would have passed against the broken code; against the original it fails withexpected [ null, null, null ]— the exact reported payload.npm test: 550 passing, 0 failing (baseline 545/0).npm run buildandnpm run lintclean; verified the fix is present inlib/and thatlib/allureReader.jsloads under CommonJS.sample_allure/iosandsample_allure/backendwith a stubbed uploader: real URLs at both test and step level, zero nulls.tests/adapter/allure-integration.test.jsare pre-existing (sample_allure/android/allure-resultsdoesn't exist — onlyallure-report) and untouched here.🤖 Generated with Claude Code