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

Configuring Kover for unit tests shards on CI #585

Open
trupin opened this issue Mar 27, 2024 · 2 comments
Open

Configuring Kover for unit tests shards on CI #585

trupin opened this issue Mar 27, 2024 · 2 comments
Assignees
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed

Comments

@trupin
Copy link

trupin commented Mar 27, 2024

Hi Kover Team!

I have a CI which runs unit tests on multiple shards. I want to configure Kover to make it run a subset of projects. So, say my shards are configured this way

shard1:
- projectA
- projectB

shard2:
- projectC
- projectD

I want to configure Kover in such a way so that when I select to run the tests in shard1, it runs the tests of projectA and projectB and generates a coverage report.

So my first question is, what is the recommended way to configure that?

My second question is about the merge feature of Kover. Say I run Kover for shard1, it will run the tests of projectA and projectB. Now, projectA has tests that hit some code located in projectC (in shard2). Will Kover be able to merge that coverage and show it in the report?

The reason I'm asking is because I haven't been able to find the right configuration to test it yet, but it would help me to know whether that is supported out of the box.

Thanks in advance for your help!

@trupin trupin added Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Mar 27, 2024
@shanshin
Copy link
Collaborator

Hi,
could you please clarify, this is how you are setting up the merge report now, for example, for only projectA and projectB projects.
Are you using convention plugin or subprojects { ... } block?

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed and removed S: untriaged Status: issue reported but unprocessed labels Mar 28, 2024
@shanshin
Copy link
Collaborator

shanshin commented Mar 28, 2024

About second question:
you may create binary report with koverBinaryReport task and from the these reports, you can generate a readable report (HTML or XML) by Kover CLI.

I think we can add a special task class, with which users can create own report generation tasks, like

tasks.create<KoverCustomHtmlReport>("myHtml") {
  inputReports.addAll(file("report-from-shard1.ic"), file("report-from-shard2.ic"))

  htmlDir = layout.buildDirectory.dir("my-html")
}

See #588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants