Skip to content

test(website): generate Cobertura coverage with Vitest#2142

Closed
prasunsrivastav123-lang wants to merge 1 commit intoOWASP:masterfrom
prasunsrivastav123-lang:test/website-cobertura-coverage
Closed

test(website): generate Cobertura coverage with Vitest#2142
prasunsrivastav123-lang wants to merge 1 commit intoOWASP:masterfrom
prasunsrivastav123-lang:test/website-cobertura-coverage

Conversation

@prasunsrivastav123-lang
Copy link

Summary

Enable Cobertura coverage generation for the website project.

Changes

  • Added Vitest test configuration to vite.config.ts
  • Switched coverage provider to Istanbul
  • Output coverage in Cobertura format under coverage/

Notes

Coverage verified locally with:
npx vitest run --coverage

@sydseter
Copy link
Collaborator

sydseter commented Feb 4, 2026

Coverage needs to include coverage from all 3 projects: #1779

@sydseter sydseter closed this Feb 4, 2026
@prasunsrivastav123-lang
Copy link
Author

@sydseter Got it — coverage is produced separately for the website, Copi, and the converter. I’ve aligned the website to Cobertura with a consistent path and can apply the same to the other two so all three are included. Happy to proceed if that sounds good

@sydseter
Copy link
Collaborator

sydseter commented Feb 4, 2026

coverage is already generated here…

website:


config:

copi:

run: mix coveralls.cobertura --exclude test --import-cover cover

converter scripts:

run: pipenv run coverage run -m unittest discover -s "tests/scripts" -p "*_*test.py"

run: pipenv run coverage run -m unittest discover -s "tests/scripts" -p "*_*test.py"

These are the job actions doing the upload to qlty:

- uses: qltysh/qlty-action/coverage@a19242102d17e497f437d7466aa01b528537e899 # v2.2.0

- uses: qltysh/qlty-action/coverage@a19242102d17e497f437d7466aa01b528537e899 # v2.2.0

- uses: qltysh/qlty-action/coverage@a19242102d17e497f437d7466aa01b528537e899 # v2.2.0

@sydseter
Copy link
Collaborator

sydseter commented Feb 4, 2026

The problem is that the repository is a mono repository and qlty doesn’t understand that we have all this code in different places. So we need to stich together the coverage output and send it to qlty as one file or one folder and only one time. What ever works for qlty. I suspect that the qlty github action only can be run once per build which means that you need to create a separate github workflow that is triggered when master is built and that run tests and coverage for copi, website and python scripts (converter) and uploads all these results as one file or one folder to qlty.

If you have any questions regarding that, please ask.
To start, I would try doing this against your forked repository. If you are able to do so.

@prasunsrivastav123-lang
Copy link
Author

hey @sydseter
I’ve created a separate monorepo coverage workflow on my fork that runs tests for website, copi, and converter, collects all Cobertura outputs into a single coverage/ folder, and uploads to qlty once per build.
I’ve pushed the workflow and am validating the results against qlty now.
Please let me know if you’d prefer a single merged Cobertura file instead of a folder upload — otherwise I’ll proceed with the folder-based approach.

@sydseter
Copy link
Collaborator

sydseter commented Feb 4, 2026

Whatever works. I will be reviewing when I have time and get back to you asap.

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.

2 participants