Skip to content

Add JaCoCo code-coverage reporting#919

Closed
philipwhiuk wants to merge 2 commits into
quickfix-j:masterfrom
philipwhiuk:qfj-addJacoco
Closed

Add JaCoCo code-coverage reporting#919
philipwhiuk wants to merge 2 commits into
quickfix-j:masterfrom
philipwhiuk:qfj-addJacoco

Conversation

@philipwhiuk

Copy link
Copy Markdown
Contributor

@chrjohn chrjohn mentioned this pull request Jan 3, 2025
@chrjohn

chrjohn commented Jan 3, 2025

Copy link
Copy Markdown
Member

Thanks @philipwhiuk
I assume this needs to be integrated into some kind of github action?

@philipwhiuk

Copy link
Copy Markdown
Contributor Author

Probably - I'll take a look at doing that for here (we use a separate build system internally so I haven't looked at it).

@the-thing

Copy link
Copy Markdown
Collaborator

This change is correct. I was doing integration with github actions + coverage recently in another project. Later it might want to exclude some things from the report e.g.

 <configuration>
     <excludes>
         <exclude>org/quickfixj/dictgenerator/**</exclude>
     </excludes>
 </configuration>

Next steps.

  1. Modify surefire plugin (argline is important)
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${maven.surefire.plugin.version}</version>
    <configuration>
        <argLine>@{argLine} -Dfile.encoding=${project.build.sourceEncoding}</argLine>
    </configuration>
</plugin>
  1. Generate token in CodeCov, Coveralls etc.

  2. Add task to upload - here CodeCov.

test-coverage:
  runs-on: ubuntu-latest
  name: Run tests and upload coverage
  steps:
    - uses: actions/checkout@v7
    - name: Set up JDK
      uses: actions/setup-java@v5
      with:
        distribution: 'temurin'
        java-version: 17
        cache: 'maven'
    - name: Test with Maven
      run: <QUICKFIX BUILD STRING>
    - name: Upload coverage reports to Codecov
      uses: codecov/codecov-action@v7
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        slug: quickfix-j/quickfixj
```

@chrjohn

chrjohn commented Jul 23, 2026

Copy link
Copy Markdown
Member

@the-thing @philipwhiuk
Thank you for this. I compiled your information into #1285 .

@chrjohn chrjohn closed this Jul 23, 2026
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.

3 participants