Skip to content

Commit

Permalink
✅(vitest) Make tests run concurrently (#5380)
Browse files Browse the repository at this point in the history
**Description**

<!-- Please provide a short description and potentially linked issues
justifying the need for this PR -->

They used to be running in a concurrent fashion in the past. But we
stopped doing it due to a recent regression on the stability of our CI
with Node 23.

The regression being still noticeable even without it and because of the
cost of not doing the runs in a concurrent fashion, we move back to
concurrent execution.

Regression was not related to vitest, but we dropped concurrent on it
too in the past.

<!-- * Your PR is fixing a bug or regression? Check for existing issues
related to this bug and link them -->
<!-- * Your PR is adding a new feature? Make sure there is a related
issue or discussion attached to it -->

<!-- You can provide any additional context to help into understanding
what's this PR is attempting to solve: reproduction of a bug, code
snippets... -->

**Checklist** — _Don't delete this checklist and make sure you do the
following before opening the PR_

- [x] The name of my PR follows [gitmoji](https://gitmoji.dev/)
specification
- [x] My PR references one of several related issues (if any)
- [x] New features or breaking changes must come with an associated
Issue or Discussion
- [x] My PR does not add any new dependency without an associated Issue
or Discussion
- [x] My PR includes bumps details, please run `yarn bump` and flag the
impacts properly
- [x] My PR adds relevant tests and they would have failed without my PR
(when applicable)

<!-- More about contributing at
https://github.com/dubzzz/fast-check/blob/main/CONTRIBUTING.md -->

**Advanced**

<!-- How to fill the advanced section is detailed below! -->

- [x] Category: ✅ Add or update tests
- [x] Impacts: Faster CI

<!-- [Category] Please use one of the categories below, it will help us
into better understanding the urgency of the PR -->
<!-- * ✨ Introduce new features -->
<!-- * 📝 Add or update documentation -->
<!-- * ✅ Add or update tests -->
<!-- * 🐛 Fix a bug -->
<!-- * 🏷️ Add or update types -->
<!-- * ⚡️ Improve performance -->
<!-- * _Other(s):_ ... -->

<!-- [Impacts] Please provide a comma separated list of the potential
impacts that might be introduced by this change -->
<!-- * Generated values: Can your change impact any of the existing
generators in terms of generated values, if so which ones? when? -->
<!-- * Shrink values: Can your change impact any of the existing
generators in terms of shrink values, if so which ones? when? -->
<!-- * Performance: Can it require some typings changes on user side?
Please give more details -->
<!-- * Typings: Is there a potential performance impact? In which cases?
-->
  • Loading branch information
dubzzz authored Oct 28, 2024
1 parent e0d1ced commit c54303f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/vitest/test/vitest-fast-check.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe.each<DescribeOptions>([
{ specName: 'test', runnerName: 'test' },
{ specName: 'it', runnerName: 'it' },
])('$specName', ({ runnerName }) => {
it(`should support ${runnerName}.prop`, async () => {
it.concurrent(`should support ${runnerName}.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand All @@ -51,7 +51,7 @@ describe.each<DescribeOptions>([
});

describe('at depth 1', () => {
it(`should support ${runnerName}.concurrent.prop`, async () => {
it.concurrent(`should support ${runnerName}.concurrent.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.concurrent.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand All @@ -66,7 +66,7 @@ describe.each<DescribeOptions>([
expectPass(out, specFileName);
});

it(`should support ${runnerName}.fails.prop`, async () => {
it.concurrent(`should support ${runnerName}.fails.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.fails.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand Down Expand Up @@ -96,7 +96,7 @@ describe.each<DescribeOptions>([
expectPass(out, specFileName);
});

it(`should support ${runnerName}.skip.prop`, async () => {
it.concurrent(`should support ${runnerName}.skip.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.skip.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand All @@ -111,7 +111,7 @@ describe.each<DescribeOptions>([
expectSkip(out, specFileName);
});

it(`should support ${runnerName}.todo.prop`, async () => {
it.concurrent(`should support ${runnerName}.todo.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.todo.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand All @@ -128,7 +128,7 @@ describe.each<DescribeOptions>([
});

describe('at depth strictly above 1', () => {
it(`should support ${runnerName}.concurrent.fails.prop`, async () => {
it.concurrent(`should support ${runnerName}.concurrent.fails.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.concurrent.fails.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand All @@ -143,7 +143,7 @@ describe.each<DescribeOptions>([
expectFail(out, specFileName);
});

it(`should support ${runnerName}.concurrent.fails.only.prop`, async () => {
it.concurrent(`should support ${runnerName}.concurrent.fails.only.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.concurrent.fails.only.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand All @@ -158,7 +158,7 @@ describe.each<DescribeOptions>([
expectFail(out, specFileName);
});

it(`should support ${runnerName}.concurrent.fails.skip.prop`, async () => {
it.concurrent(`should support ${runnerName}.concurrent.fails.skip.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.concurrent.fails.skip.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand All @@ -173,7 +173,7 @@ describe.each<DescribeOptions>([
expectSkip(out, specFileName);
});

it(`should support ${runnerName}.concurrent.fails.todo.prop`, async () => {
it.concurrent(`should support ${runnerName}.concurrent.fails.todo.prop`, async () => {
// Arrange
const { specFileName, vitestConfigRelativePath: jestConfigRelativePath } = await writeToFile(runnerName, () => {
runner.concurrent.fails.todo.prop([fc.string(), fc.string(), fc.string()])('property', (a, b, c) => {
Expand Down

0 comments on commit c54303f

Please sign in to comment.