Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vitest][Issue] Allure Report Fails to Display Description When Using test.concurrent of Vitest #1157

Open
li1225 opened this issue Sep 26, 2024 · 0 comments
Labels
theme:vitest type:bug Something isn't working

Comments

@li1225
Copy link

li1225 commented Sep 26, 2024

Describe the bug

In the provided script, I encountered an issue where the Allure report does not display the description or other Allure features correctly when using test.concurrent. However, the description works fine when using test() without concurrent.

describe('Sleep Duration Test', () => {
    test.concurrent.for([2,3,4])('1-1 Should sleep for %i second(s).', async (n, ctx)=> {
        await allure.description(`This is allure description - ${ctx.task.name}`)
        await sleep(n)
        expect(n).toBeLessThan(10)
        logWithTimestamp(`This is ${ctx.task.name}-${n}`)
        logWithTimestamp(`Slept for ${n} second(s)`)
    })

    test.for([2,3,4])('1-2 Should sleep for %i second(s).', async (n, ctx)=> {
        await allure.description(`This is allure description - ${ctx.task.name}`)
        await sleep(n)
        expect(n).toBeLessThan(10)
        logWithTimestamp(`This is ${ctx.task.name}-${n}`)
        logWithTimestamp(`Slept for ${n} second(s)`)
    })
})

Could this be related to how Allure integrates with concurrent tests, or is there something specific that needs to be configured for it to work with test.concurrent?

"dependencies": {
    "@types/allure-js-commons": "^0.0.4",
    "@types/node": "^22.7.2",
    "allure-commandline": "^2.30.0",
    "allure-js-commons": "^3.0.2",
    "allure-vitest": "^3.0.2",
    "babel-loader": "^9.2.1",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vitest": "^2.1.1",
    "zod": "^3.23.8"
  }

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to the e2e folder.
  2. Run the following command:
   npx vitest run exploration --testTimeout 1200000
  1. After the test execution, ensure that the allure-results folder is generated under the e2e directory.
  2. Run the following command within the e2e folder:
allure serve allure-results
  1. Observe that the dashboard data is not displayed as expected in the Allure report.

Expected behavior
Description sections should display in every tests.

Screenshots
The results of tests wrapped in test.concurrent()
Screenshot 2024-09-26 at 7 30 06 PM
The results of tests wrapped in test()
Screenshot 2024-09-26 at 7 29 57 PM

Desktop (please complete the following information):

  • OS: [MAC OS 14.5]
  • Browser [chrome]
  • Version [Version 126.0.6478.127 (Official Build) (arm64)]

Additional context
Add any other context about the problem here.

@baev baev added the type:bug Something isn't working label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:vitest type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants