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

inner suite { sequential: true } doesn't override outer suite { concurrent: true } #5716

Closed
6 tasks done
hi-ogawa opened this issue May 14, 2024 · 0 comments · Fixed by #5737
Closed
6 tasks done

inner suite { sequential: true } doesn't override outer suite { concurrent: true } #5716

hi-ogawa opened this issue May 14, 2024 · 0 comments · Fixed by #5737
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@hi-ogawa
Copy link
Contributor

Describe the bug

I'm not sure what we want it to happen since users could technically also write completely conflicting things like { sequential: true, concurrent: true }. As shown in the reproduction below, describe.sequential and describe('...', { concurrent: false }) correctly resets, so I think we could also support { sequential: true } too at least?

describe('repro', { concurrent: true }, () => {
  // sequential
  describe.sequential("ok 1", () => { ... });

  // sequential
  describe("ok 2", { concurrent: false }, () => { ... });

  // this is still concurrent
  describe('bad', { sequential: true }, () => { ... });
});

I spotted this while writing test cases for #5491. Probably the condition around here is relevant:

// inherit concurrent / sequential from current suite
options.concurrent = this.concurrent || (!this.sequential && options?.concurrent)
options.sequential = this.sequential || (!this.concurrent && options?.sequential)

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-79s4mn?file=test%2Frepro.test.ts

System Info

(stackblitz)

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitest/ui: latest => 1.6.0 
    vite: latest => 5.2.11 
    vitest: latest => 1.6.0

Used Package Manager

npm

Validations

@sheremet-va sheremet-va added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels May 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
2 participants