Skip to content

Add JavaScript code coverage collection and aggregation#683

Merged
K20shores merged 3 commits intomainfrom
copilot/add-js-code-coverage
Nov 24, 2025
Merged

Add JavaScript code coverage collection and aggregation#683
K20shores merged 3 commits intomainfrom
copilot/add-js-code-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 24, 2025

Implements code coverage for JavaScript tests and aggregates with existing C++/Fortran coverage via codecov.

Changes

  • codecov.yml: Configures separate flags (cpp_fortran, javascript) and upload paths for aggregated coverage reporting

  • package.json: Adds c8 for coverage collection with lcov output to javascript-coverage/lcov.info

    "test:coverage": "c8 --reporter=lcov --reporter=text --reports-dir=javascript-coverage node --test javascript/tests/**/*.test.js"
  • .github/workflows/coverage.yml: New dedicated workflow with separate jobs for C++/Fortran (via Dockerfile.coverage) and JavaScript coverage collection, both uploading to codecov with appropriate flags

  • .github/workflows/docker.yml: Removes Dockerfile.coverage from matrix and coverage-specific steps (now in dedicated workflow)

  • .gitignore: Excludes coverage output directories (javascript-coverage/, coverage/, .nyc_output/, *.lcov)

Current JavaScript coverage: 92.19% statements, 70.58% branches, 89.7% functions.

Original prompt

This section details on the original issue you should resolve

<issue_title>Javascript code coverage</issue_title>
<issue_description>Now that we have more tests, we should collect code coverage reports for code coverage and add it to our upload

Acceptance criteria

  • Code coverage for javascript is collected
  • Code coverage is aggregated

Ideas

  • Follow what we do in chemistry cafe
    • Add a codecov.yml that knows where each report is and aggregates them
    • consider using vitest coverage, which would mean we need to use vite to build
      • explore other options
  • Right now, our coverage report for C++/Fortran is run in dockerfile.coverage
    • My suggestion is to create a new action dedicated to code coverage. Remove the run of dockerfile.coverage in the docker action
    • First run the c++/fortran coverage
    • Separately collect the JavaScript coverage
    • Then upload the coverage, relying on the codecov.yml to know where the files are to upload</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Collect and aggregate JavaScript code coverage reports Add JavaScript code coverage collection and aggregation Nov 24, 2025
Copilot AI requested a review from K20shores November 24, 2025 17:35
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.12%. Comparing base (f027b73) to head (dfc0f31).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #683      +/-   ##
==========================================
+ Coverage   78.86%   81.12%   +2.25%     
==========================================
  Files          54       65      +11     
  Lines        7136     7538     +402     
==========================================
+ Hits         5628     6115     +487     
+ Misses       1508     1423      -85     
Flag Coverage Δ
cpp_fortran 79.74% <ø> (?)
javascript 92.19% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@K20shores K20shores marked this pull request as ready for review November 24, 2025 19:35
@K20shores K20shores mentioned this pull request Nov 24, 2025
@K20shores K20shores merged commit f91fe87 into main Nov 24, 2025
125 of 164 checks passed
@K20shores K20shores deleted the copilot/add-js-code-coverage branch November 24, 2025 20:20
@K20shores K20shores mentioned this pull request Dec 1, 2025
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.

Javascript code coverage

4 participants