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

Coverage is not properly calculated #5519

Closed
charlesBochet opened this issue May 21, 2024 · 6 comments
Closed

Coverage is not properly calculated #5519

charlesBochet opened this issue May 21, 2024 · 6 comments
Assignees

Comments

@charlesBochet
Copy link
Member

charlesBochet commented May 21, 2024

Scope & Context

We have recently updated the way storybook tests are run. However, the coverage does not seems to be properly computed anymore on the CI:

See:
image

As you can see, only a few files (probably the one impacted by the tests) are taken into account. We would like the whole packages/twenty-front to be considered (actually it should respect includes/excludes specified in nyc.config.cjs)

Technical inputs

To reproduce run:

  • npx nx run twenty-front:storybook:static:test --configuration=modules
  • or npx nx run twenty-front:storybook:static:test --configuration=pages

The coverage is properly computed if we run the following commands

  • npx nx run twenty-front:storybook:build (this is not scoped on modules / pages)
  • then npx nx run twenty-front:storybook:test --configuration=modules
  • or npx nx run twenty-front:storybook:test --configuration=pages
@charlesBochet
Copy link
Member Author

@gitstart-twenty Could you have a look? It needs some strong investigation skills!

Copy link
Contributor

gitstart-app bot commented May 22, 2024

Here is the GitStart Ticket for this issue: https://clients.gitstart.com/twenty/5449/tickets/TWNTY-5519

@charlesBochet
Copy link
Member Author

@gitstart-twenty The command have been updated, here is how to reproduce the issue today:

Dev (hot reload) serve:

  • npx nx run twenty-front:storybook:serve:dev
  • npx nx run twenty-front:storybook:test --configuration=modules

Static serve:

  • npx nx run twenty-front:storybook:serve:static
  • npx nx run twenty-front:storybook:test --configuration=modules
image

As you can see, most of the files are missing from the code coverage computation (it seems that the coverage only takes files touched by tests into account)

@charlesBochet
Copy link
Member Author

As you pointed @gitstart-twenty, changes were made in the following commit: 6683ffb?diff=split&w=0

I believe that the problem was already there in the commit above but if you checkout before this commit and run:

  • npx nx run twenty-front:storybook:build
  • npx nx run twenty-front:storybook:test --configuration=modules

the coverage was correct.

The goal of this ticket is to use the current commands but have the coverage properly computed

@gitstart-twenty
Copy link
Contributor

Thank you. We will work on it.

@Bonapara Bonapara moved this from 🆕 New to 📋 Backlog in 🎯 Roadmap & Sprints Jan 10, 2025
@charlesBochet
Copy link
Member Author

This has been investigated and fixed by @prastoin, closing this issue in #9448

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants