Conversation
0873807 to
93b5b2e
Compare
c30386c to
48286eb
Compare
|
Nice diagnosis. I verified it against the store: Three things I would like to see addressed. 1. The same defect is still live in the Quality Gate tab. See
It also makes the PR description inaccurate: it says the new behaviour "mirrors how quality gate results behave: filterable per environment, but global when they carry no environment", but Quality Gate has the bug too. After this PR, Global Errors and Quality Gate sit next to each other in the same header and disagree about shared entries.
2.
Suggestion: treat the 3. The section header disappears when only the shared bucket is rendered. See The
Gating that branch on |
…e components/tests accordingly
48286eb to
3b38c21
Compare
…t and ensure visibility of environment-specific data across components and tests
…efault environment Addresses the review on allure-framework#927: * Quality Gate results use the same selector as global attachments and errors, so results dispatched without an environment stay visible while a single environment is selected; the tab counter counts the same set. * The `default` bucket is only treated as shared when `default` isn't one of the report's configured environments. The environments widget can't tell that on its own, because the default identity is always listed, so the store exposes `configuredEnvironmentIds()` and the awesome plugin marks declared identities with `configured: true`. * Section headers stay while a single environment is selected, they tell the shared bucket apart from the entries of that environment.
|
Thanks @todti — all three addressed. 1. Quality Gate. Fixed here. 2. 3. Section header. The plain-list branch is gated on Unit tests added for the selector, both globals components, Quality Gate, the store method, the generator and |
Context
Fixes #869.
Files declared via
globalAttachmentswere only listed in the Global Attachments tab while theenvironment picker was set to All. As soon as a single environment was selected, the tab showed
0and rendered "No attachments information available" — even though such attachments aren'tenvironment-specific at all. In a multi-environment report that made them effectively unreachable,
because a single environment is exactly the view you work in while triaging one staging, language or
browser.
Cause
widgets/globals.jsoncarries two views of the same data: the flatattachmentslist and theper-environment
attachmentsByEnvindex. Global data which isn't bound to an environment is indexedunder the default environment by
AllureStore(#indexGlobalAttachment/#indexGlobalError), so itends up in the
defaultbucket. The frontend rendered onlyattachmentsByEnv[<selected env>]whilean environment was selected and therefore dropped the
defaultbucket — the one bucket that appliesto every environment.
widgets/quality-gate.jsonhas the sameRecord<envId, T[]>shape, results validated without anenvironment go through the same store path, and
ReportQualityGateResultshad the same defect.Solution
A shared selector,
packages/web-awesome/src/utils/globals.ts, resolves the buckets to render:defaultbucket, because entries without an own environment are shared by all of them;
defaultselected — the shared bucket exactly once, no duplicates;defaultdeclared as an environment in the report config — then thedefaultbucket holdsentries specific to that environment and nothing is shared. The environments widget can't tell
that case apart on its own, because the default identity is always listed, so
AllureStorenowexposes
configuredEnvironmentIds()and the awesome plugin marks declared identities inwidgets/environments.jsonwithconfigured: true. Reports without the flag behave as before.Rendering: a lone
defaultbucket in the All view renders as a plain list, everything elserenders as environment sections (the selected environment first, the shared one after it). While a
single environment is selected the section headers stay, they tell the shared bucket apart from the
entries of that environment.
Applied to:
ReportGlobalAttachments— the reported case;ReportGlobalErrors— the same widget and the same defect, e.g. thestdout/stderrattachmentsand the "Test process has failed" error dispatched by
allure runcarry no environment anddisappeared the same way;
ReportQualityGateResults— same defect, same widget shape. Side effect: with an environmentselected the tab now renders section headers like the globals tabs do, instead of a bare list;
MainReport— the three tab counters count exactly what the tabs render.The only change to the report data is the additive, optional
configuredflag on the identities inwidgets/environments.json; theAllureStoremethod is optional so third-party stores keep working.Checklist
Unit tests cover the selector, both globals components, the quality gate component, the store
method, the generator and
normalizeEnvironmentsWidget; e2e covers the shared quality gate bucket,the header while an environment is selected and the declared-
defaultcase. Package suites ofweb-awesome,core,core-api,web-commons,plugin-awesomeandplugin-apipass;yarn build,yarn lintandyarn format:checkare clean.