vitest icon indicating copy to clipboard operation
vitest copied to clipboard

vitest dot reporter is not used in CI (jenkins)

Open vandriesh opened this issue 2 years ago • 5 comments

Describe the bug

with viteconfig

test: {
    globals: true,
    environment: 'jsdom',
    setupFiles: './tests/setup.ts',
    reporters: ['dot'],
    coverage: {
        provider: 'v8',
        reportsDirectory: './reports/coverage-vitest',
        reporter: [['lcov']],
        lines: 3,
        functions: 3,
        branches: 3,
        statements: 3,
    },
},

or command line

npx vitest --reporter dot

work on "my machine" (osx)

but it doesn't in CI (jenkins)

Screen Shot 2023-08-11 at 10 20 01

Reproduction

hard to build env with jenkins and share it,

System Info

10:28:09  + npx envinfo --system --npmPackages '{vitest,@vitest/*,vite,@vitejs/*}' --binaries --browsers
10:28:10  npm WARN exec The following package was not found and will be installed: [email protected]
10:28:11  
10:28:11    System:
10:28:11      OS: Linux 5.4 Amazon Linux 2
10:28:11      CPU: (16) x64 Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
10:28:11      Memory: 121.03 GB / 124.36 GB
10:28:11      Container: Yes
10:28:11      Shell: 4.2.46 - /bin/bash
10:28:11    Binaries:
10:28:11      Node: 16.20.0 - /usr/local/lib/nodejs/node-v16.20.0-linux-x64/bin/node
10:28:11      npm: 8.19.4 - /usr/local/lib/nodejs/node-v16.20.0-linux-x64/bin/npm
1

Used Package Manager

npm

Validations

vandriesh avatar Aug 11 '23 07:08 vandriesh

In CI the terminal is not interactive, meaning that terminal cannot be cleared.

What is the expected output a dot reporter would produce in this kind of environment? Currently this is intentionally disabled:

https://github.com/vitest-dev/vitest/blob/f4e6e99fa3a81fd7a97fb9b435da367dddba7fa4/packages/vitest/src/node/reporters/dot.ts#L10-L16

AriPerkkio avatar Aug 12 '23 07:08 AriPerkkio

not sure I understand - I was expecting this (actual dot report) instead : green check marks + files names Screen Shot 2023-08-13 at 21 58 27

vandriesh avatar Aug 13 '23 18:08 vandriesh

I think we could render the dots of the test final result (green/red) and don't care about test-in-progress states (yellow dots).

AriPerkkio avatar Aug 14 '23 04:08 AriPerkkio

I'd love to WYSIWYG (what you see is what you get) here. The main issue it would solve is the end the holy war between FE and devops devs. When devops sees tons of info (sometimes red/or exceptions) - they point out - it our fault. I want to output ass less as possible info easy to investigate when you have 1 page of logs instead of 5) ;-) - so I'd really like to see same output everywhere (regardless where vitest is running - local os CI)

Thanks!

p.s. Should I open a PR or something - once you pointed the code...

vandriesh avatar Aug 15 '23 06:08 vandriesh

just saw pr welcome tag - I guess that answers my question

vandriesh avatar Aug 15 '23 06:08 vandriesh