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

Exit code 0 on failure #2363

Closed
revmischa opened this issue Nov 21, 2022 · 3 comments
Closed

Exit code 0 on failure #2363

revmischa opened this issue Nov 21, 2022 · 3 comments

Comments

@revmischa
Copy link

Describe the bug

When tests fail I expect vitest --run to return a non-zero exit code

Reproduction

 px vitest --run backend/src/api/resolver/application/list.test.ts

 RUN  v0.24.3 /home/cyber/dev/jbp

 ❯ backend/src/api/resolver/application/list.test.ts (4) 2571ms
   ❯ [GQL] Query listApplications (4) 2537ms
     × should get applications according to vacancy queried 1307ms
     ✓ should filter applications based on provided status 675ms
     ✓ should paginate applications 317ms
     ✓ should throw unauthorized error if user not provided

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  backend/src/api/resolver/application/list.test.ts > [GQL] Query listApplications > blahblah
AssertionError: expected [] to have a length of 1 but got +0
 ❯ backend/src/api/resolver/application/list.test.ts:109:8
    107|           })
    108|         ).items
    109|       ).toHaveLength(1);
       |        ^
    110|     }
    111|   });

  - Expected   "1"
  + Received   "0"


Test Files  1 failed (1)
     Tests  1 failed | 3 passed (4)
  Start at  14:21:32
  Duration  11.57s (transform 1.33s, setup 56ms, collect 6.51s, tests 2.57s)

➜  jbp git:(fix-tests-2) ✗ echo $?
0

I would like to use a newer version of vitest but I get segfaults (#2347)

System Info

System:
    OS: Linux 5.19 Ubuntu 22.10 22.10 (Kinetic Kudu)
    CPU: (8) x64 Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Memory: 13.55 GB / 31.07 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.nvm/versions/node/v18.12.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.12.0/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.0/bin/npm
  npmPackages:
    vite: ^3.0.8 => 3.0.9 
    vitest: 0.24.3 => 0.24.3 


### Used Package Manager

pnpm

### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitest-dev/vitest/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitest.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/vitest-dev/vitest/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitest-dev/vitest/discussions) or join our [Discord Chat Server](https://chat.vitest.dev).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@github-actions
Copy link

Hello @revmischa. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@sheremet-va
Copy link
Member

sheremet-va commented Nov 22, 2022

This is not a reproduction. How do I run your CLI output to reproduce it?

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2022
@revmischa revmischa mentioned this issue Dec 2, 2022
@revmischa
Copy link
Author

@sheremet-va I added a reproduction for this and my segfault issue here: #2347 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants