Skip to content

Commit 1256b5c

Browse files
authored
fix: rename collect to import, remove prepare (#9091)
1 parent 6f22c67 commit 1256b5c

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

docs/guide/profiling-test-performance.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ When you run Vitest it reports multiple time metrics of your tests:
1111
> Test Files 1 passed (1)
1212
> Tests 1 passed (1)
1313
> Start at 09:32:53
14-
> Duration 4.80s (transform 44ms, setup 0ms, collect 35ms, tests 4.52s, environment 0ms, prepare 81ms)
14+
> Duration 4.80s (transform 44ms, setup 0ms, import 35ms, tests 4.52s, environment 0ms, prepare 81ms)
1515
> # Time metrics ^^
1616
> ```
1717
1818
- Transform: How much time was spent transforming the files. See [File Transform](#file-transform).
1919
- Setup: Time spent for running the [`setupFiles`](/config/#setupfiles) files.
20-
- Collect: Time spent for collecting all tests in the test files. This includes the time it took to import all file dependencies.
20+
- Import: Time it took to import your test files and their dependencies. This also includes the time spent collecting all tests. Note that this doesn't include dynamic imports inside of tests.
2121
- Tests: Time spent for actually running the test cases.
2222
- Environment: Time spent for setting up the test [`environment`](/config/#environment), for example JSDOM.
23-
- Prepare: Time Vitest uses to prepare the test runner. When running tests in Node, this is the time to import and execute all internal utilities inside the worker. When running tests in the browser, this also includes the time to initiate the iframe.
2423
2524
## Test runner
2625

packages/vitest/src/node/reporters/base.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,17 +587,15 @@ export abstract class BaseReporter implements Reporter {
587587
const executionTime = blobs?.executionTimes ? sum(blobs.executionTimes, time => time) : this.end - this.start
588588

589589
const environmentTime = sum(files, file => file.environmentLoad)
590-
const prepareTime = sum(files, file => file.prepareDuration)
591590
const transformTime = this.ctx.state.transformTime
592591
const typecheck = sum(this.ctx.projects, project => project.typechecker?.getResult().time)
593592

594593
const timers = [
595594
`transform ${formatTime(transformTime)}`,
596595
`setup ${formatTime(setupTime)}`,
597-
`collect ${formatTime(collectTime)}`,
596+
`import ${formatTime(collectTime)}`,
598597
`tests ${formatTime(testsTime)}`,
599598
`environment ${formatTime(environmentTime)}`,
600-
`prepare ${formatTime(prepareTime)}`,
601599
typecheck && `typecheck ${formatTime(typecheck)}`,
602600
].filter(Boolean).join(', ')
603601

test/cli/test/artifacts.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ describe('reporters', () => {
380380
Test Files 1 passed (1)
381381
Tests 2 passed (2)
382382
Start at <time>
383-
Duration <duration> (transform <duration>, setup <duration>, collect <duration>, tests <duration>, environment <duration>, prepare <duration>)
383+
Duration <duration> (transform <duration>, setup <duration>, import <duration>, tests <duration>, environment <duration>)
384384
385385
"
386386
`)
@@ -411,7 +411,7 @@ describe('reporters', () => {
411411
Test Files 1 passed (1)
412412
Tests 2 passed (2)
413413
Start at <time>
414-
Duration <duration> (transform <duration>, setup <duration>, collect <duration>, tests <duration>, environment <duration>, prepare <duration>)
414+
Duration <duration> (transform <duration>, setup <duration>, import <duration>, tests <duration>, environment <duration>)
415415
416416
"
417417
`)

test/cli/test/no-unexpected-logging.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe.each(['forks', 'threads', 'vmForks', 'vmThreads'] as const)('%s', (pool
3333
Test Files 12 passed (12)
3434
Tests 12 passed (12)
3535
Start at [...]
36-
Duration [...]ms (transform [...]ms, setup [...]ms, collect [...]ms, tests [...]ms, environment [...]ms, prepare [...]ms)
36+
Duration [...]ms (transform [...]ms, setup [...]ms, import [...]ms, tests [...]ms, environment [...]ms)
3737
3838
`.trim())
3939
})

test/reporters/tests/merge-reports.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ test('merge reports', async () => {
107107
108108
Test Files 2 failed (2)
109109
Tests 2 failed | 3 passed (5)
110-
Duration <time> (transform <time>, setup <time>, collect <time>, tests <time>, environment <time>, prepare <time>)
110+
Duration <time> (transform <time>, setup <time>, import <time>, tests <time>, environment <time>)
111111
Per blob <time> <time>"
112112
`)
113113

0 commit comments

Comments
 (0)