Skip to content

Support allure run level failure logs#59

Merged
hi-rai merged 1 commit intomainfrom
dev/himanshu/allure-run-failure-logs
Mar 24, 2026
Merged

Support allure run level failure logs#59
hi-rai merged 1 commit intomainfrom
dev/himanshu/allure-run-failure-logs

Conversation

@hi-rai
Copy link
Contributor

@hi-rai hi-rai commented Mar 23, 2026

@hi-rai hi-rai self-assigned this Mar 23, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the Allure report integration by enabling the extraction and upload of run-level failure logs from Allure container files. This ensures that critical setup and teardown failures, which are not associated with specific test cases, are properly captured and reported. Additionally, the internal API client has been refined for better extensibility and request identification, and the codebase has undergone minor refactoring for improved structure.

Highlights

  • Allure Run-Level Failure Log Support: The Allure parser now extracts run-level failure logs from *-container.json files, specifically from failed or broken befores and afters fixtures. This enhances the reporting of setup/teardown issues not tied to individual test cases.
  • API Client Enhancement: The internal API client has been refactored to use a more generic withHeaders utility, allowing for custom headers. This change also introduces a User-Agent header with the CLI version for better request identification.
  • Codebase Refactoring: Parser files (allureParser.ts, junitXmlParser.ts, playwrightJsonParser.ts) have been moved into a new src/utils/result-upload/parsers subdirectory to improve code organization.
  • Version Update: The CLI version has been bumped from 0.5.0 to 0.6.0.
  • Documentation and Testing Updates: Documentation (CLAUDE.md, README.md) has been updated to reflect the new Allure container parsing capabilities, and comprehensive unit tests have been added to validate the extraction of run-level failure logs from Allure containers.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for run-level failure logs from Allure reports by parsing *-container.json files, which is a valuable addition for capturing setup and teardown failures. The implementation is robust, including comprehensive new tests that cover various scenarios and edge cases. The pull request also includes helpful refactorings, such as generalizing the API header utility and making the CLI version a pre-computed constant. Documentation in both README.md and CLAUDE.md has been updated accordingly. Overall, this is a high-quality contribution with no issues found.

withHttpRetry(
withHeaders(withBaseUrl(fetch, baseUrl), {
Authorization: `ApiKey ${apiKey}`,
'User-Agent': `qas-cli/${CLI_VERSION}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added qas-cli/<version> user-agent header, which might help in debugging future issues

{
"name": "qas-cli",
"version": "0.5.0",
"version": "0.6.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped version for run level logs support

3. **Test case marker in name** - Marker in `name` field (same `PROJECT-SEQUENCE` format as JUnit XML)

Only Allure 2 JSON (`*-result.json`) is supported. Legacy Allure 1 XML files are ignored.
Only Allure JSON result files (`*-result.json`) are supported. Legacy Allure 1 XML files are ignored.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also Allure 3, so we shouldn't specifically mention Allure 2

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4db32dc4e6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +305 to +306
const fixtures = [...(container.befores || []), ...(container.afters || [])]
for (const fixture of fixtures) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Skip test-scoped containers when building run-level logs

Allure container files are not run-global by default: the format describes a fixture container that points back to the affected test result(s) via children. This loop promotes every failed/broken before/after to runFailureLogs without checking whether the container belongs to one or more concrete tests, so a normal pytest function-scoped fixture failure will now be uploaded both on the testcase (from the matching *-result.json) and again as a run-level log. In suites that use per-test fixtures, that makes a single-test failure look like a run-wide outage.

Useful? React with 👍 / 👎.

Comment on lines 244 to +245
if (includeStdout && statusDetails.message) {
message += `<pre><code>${escapeHtml(stripAnsi(statusDetails.message))}</code></pre>`
message += `<p>${escapeHtml(stripAnsi(statusDetails.message))}</p>`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve preformatted Allure failure messages

This changes statusDetails.message rendering for every Allure testcase from a preformatted code block to a paragraph. Multiline assertion messages and diff-style output are common in Allure reports; wrapping them in <p> collapses newlines and indentation, so failed tests that only populate message now lose most of their structure in QA Sphere. Keeping the previous <pre><code> formatting avoids that regression in debuggability.

Useful? React with 👍 / 👎.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth checking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message should be a small text summary, ideal for <p>. The documentation also confirms the same - the short text message to display in the test details, such as a name of the exception that led to a failure. The error detail should be in trace, which already uses <pre><code>

Comment on lines 244 to +245
if (includeStdout && statusDetails.message) {
message += `<pre><code>${escapeHtml(stripAnsi(statusDetails.message))}</code></pre>`
message += `<p>${escapeHtml(stripAnsi(statusDetails.message))}</p>`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth checking

@hi-rai hi-rai merged commit acf0d8c into main Mar 24, 2026
14 checks passed
@hi-rai hi-rai deleted the dev/himanshu/allure-run-failure-logs branch March 24, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants