Skip to content

Allure-vitest incompatible with Vitest 4.0 - Test results not generated #1367

@jercollini

Description

@jercollini

🐛 allure-vitest incompatible with Vitest 4.0 - Test results not generated

Description

The allure-vitest reporter (v3.4.1) is not compatible with Vitest 4.0.x and fails to generate test results correctly. The allure-results folder remains empty or is not created at all when running tests with Vitest 4.0.

Environment

  • allure-vitest version: 3.4.1
  • vitest version: 4.0.3
  • Node version: 22.x
  • OS: Linux (CI: GitHub Actions)
  • Test environment: jsdom

Configuration

// [vite.config.ts](http://_vscodecontentref_/0)
export default defineConfig({
  test: {
    environment: 'jsdom',
    setupFiles: ['allure-vitest/setup', './test-globals.ts'],
    globals: true,
    restoreMocks: true,
    clearMocks: true,
    mockReset: true,
    isolate: true,
    pool: 'forks',
    testTimeout: 30000,
    reporters: [
      'default',
      ['allure-vitest/reporter', {
        resultsDir: './allure-results',
      }]
    ],
  },
})

Steps to Reproduce

  1. Install Vitest 4.0.3 and allure-vitest 3.4.1
  1. Configure Vitest with the above settings

  2. Run tests with:

   vitest run --reporter=default --reporter=allure-vitest/reporter
  1. Check the allure-results folder

Expected Behavior

  • allure-results folder should be created
  • Test result JSON files should be generated for each test suite
  • Allure reports should be accessible for CI/CD pipelines

Actual Behavior

  • allure-results folder is either empty or not created
  • No test result JSON files are generated
  • CI/CD pipeline fails with: Error: No artifacts found matching pattern 'Allure Results - *'

Additional Context

Vitest 4.0 Breaking Changes Affecting This Issue

Vitest 4.0 introduced several changes that may affect reporters:

  • New test isolation model with isolate: true
  • New worker pool system (pool: 'forks' vs pool: 'threads')
  • Changes to how reporters are executed in parallel test runs
  • Global mock reset behavior changes

Workarounds Attempted

We tried the following without success:

  • ✅ Explicit resultsDir configuration
  • ✅ Different pool strategies (threads, forks)
  • ✅ Disabling isolate mode
  • ✅ Using different reporter configurations
  • ❌ None of these resolved the issue

Works Correctly With

  • Vitest 3.x: allure-vitest works perfectly
  • Downgrading to Vitest 3.5.x resolves the issue completely

Impact

This issue is blocking our Vitest 4.0 upgrade as:

  • Test reports are required for our CI/CD pipeline
  • We rely on Allure reports for test documentation and tracking
  • Without working reports, we cannot complete the upgrade

Requested Action

Please update allure-vitest to support Vitest 4.0.x compatibility. This would allow teams to benefit from:

  • Vitest 4.0 performance improvements
  • Better test isolation
  • Improved mock handling
  • Latest Vitest features

Related Links


Thank you for maintaining this excellent testing framework integration! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions