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

Tests not found after using bun install, but found using npm install, on Github Actions #6971

Open
jasongitmail opened this issue Nov 7, 2023 · 0 comments
Labels
bug Something isn't working npm Something that relates to the npm-compatible client

Comments

@jasongitmail
Copy link

jasongitmail commented Nov 7, 2023

What version of Bun is running?

oven-sh/setup-bun@v1 (1.0.10+d85bd49d8)

What platform is your computer?

Ubuntu on Github Actions

What steps can reproduce the bug?

  1. Failed example: Fork and use this commit: https://github.com/jasongitmail/super-sitemap/tree/1c6b4389abc3f82e0167ac0a7520ca873b0085c2 This commit's Github Actions .github/workflows/ci.yml uses bun install; vitest always fails.
    You can view the job output from this commit here: https://github.com/jasongitmail/super-sitemap/actions/runs/6789375785/job/18456422682
  2. Successful example: Fork and use this commit: https://github.com/jasongitmail/super-sitemap/tree/44c0b0e20f8fafada7c0fbcd4a0c7223630f5fc4 The only change from the commit above is changing bun install to npm install.
    You can view the job output from this commit here: https://github.com/jasongitmail/super-sitemap/actions/runs/6789414175/job/18456545519
  3. To reproduce, push either commit to Github and then check the result from Github Actions.

Note:

  • The project uses Vitest and contains only one minimal tests for troubleshooting:
import { describe, expect, it } from 'vitest';

describe('sitemap.ts', () => {
  it('should run tests', () => {
    expect(1 + 1).toBe(2);
  });
});
  • I've tried various tweaks to Vitest's configuration and changing the install command was what fixed it on Github Actions. In all tweaks attempted, tests ran successfully locally.

What is the expected behavior?

The tests should run equally well irrespective of whether bun install or npm install is used within ci.yml

What do you see instead?

Error: No test suite found in file /home/runner/work/super-sitemap/super-sitemap/src/lib/sitemap.test.ts
You can view the error on Github Actions at: https://github.com/jasongitmail/super-sitemap/actions/runs/6789375785/job/18456422682

But the file does exist--the job step before the tests runs uses cat to output the contents of the tests file successfully.

Additional information

  • Tests work locally, even when bun install is used. The issue only occurs on Github Actions.
  • Vitest is run using node, NOT bun run --bun vitest because I know that does not work yet.
@jasongitmail jasongitmail added the bug Something isn't working label Nov 7, 2023
@Electroid Electroid added the npm Something that relates to the npm-compatible client label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working npm Something that relates to the npm-compatible client
Projects
None yet
Development

No branches or pull requests

2 participants