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

[backend] fix code coverage #5748

Merged
merged 3 commits into from
Jan 30, 2024
Merged

[backend] fix code coverage #5748

merged 3 commits into from
Jan 30, 2024

Conversation

labo-flg
Copy link
Member

This PR fixes code coverage (all credits to @richard-julien 🙌)

The plugin vitestMigrationPlugin was turning the global pattern *.js in database/migration.js into real JS code, introducing several lines into the code. However, the resulting source mapping was not updated.

This introduced a shift in the code base as displayed in the coverage reports.

We are not testing migrations scripts, so we can safely turn of this plugin. This meant refactoring the initialization phase so that vitest won't ever import migration.js during test setup.

I've added a small change to the test base to check for coverage improvement, and reporting on the right lines of code.

This is working properly:
image

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 497 lines in your changes are missing coverage. Please review.

Comparison is base (605eb54) 66.14% compared to head (bafc094) 64.78%.
Report is 3 commits behind head on master.

Files Patch % Lines
...pencti-graphql/src/database/data-initialization.js 0.00% 254 Missing ⚠️
opencti-platform/opencti-graphql/src/managers.js 0.00% 221 Missing ⚠️
...ti-platform/opencti-graphql/src/database/engine.js 29.41% 12 Missing ⚠️
...cti-platform/opencti-graphql/src/initialization.js 0.00% 5 Missing ⚠️
...-platform/opencti-graphql/src/database/rabbitmq.js 40.00% 3 Missing ⚠️
opencti-platform/opencti-graphql/src/boot.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5748      +/-   ##
==========================================
- Coverage   66.14%   64.78%   -1.37%     
==========================================
  Files         513      515       +2     
  Lines       60805    60815      +10     
  Branches     4447     4849     +402     
==========================================
- Hits        40220    39398     -822     
- Misses      20585    21417     +832     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@richard-julien richard-julien merged commit f120d49 into master Jan 30, 2024
10 checks passed
@richard-julien richard-julien deleted the oob/codecov branch January 30, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants