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

#313 - add code coverage support #314

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ because all rows in dataframe must have the same schema.
So if you have multiple incompatible types of avro data in a dataframe you must first sort them out to several dataframes.
One for each schema. Then you can use Abris and convert the avro data.

## How to measure code coverage
```shell
./mvn clean verify -Pcode-coverage,scala-2.12
or
./mvn clean verify -Pcode-coverage,scala-2.13
```
Code coverage reports will be generated on paths:
```
{local-path}\ABRiS\target\jacoco
```

---

Expand Down
49 changes: 47 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@

<!--Tests-->
<scalatestplus.mockito.version>3.1.2.0</scalatestplus.mockito.version>
<scalatest.version>3.1.4</scalatest.version>
<scalatest.maven.plugin.version>2.0.2</scalatest.maven.plugin.version>
<scalatest.version>3.2.14</scalatest.version>
<scalatest.maven.plugin.version>2.2.0</scalatest.maven.plugin.version>
<jacoco.version>0.8.8</jacoco.version>

<scala.maven.plugin.version>3.3.2</scala.maven.plugin.version>

Expand Down Expand Up @@ -334,6 +335,13 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the plugin coordinates need to be declared here? Seem like doing it once in code-coverage profile should be enough.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. It can be removed from build/plugins section. Tested locally. Current presence is not source of failure. There is planned another related improvement - excludes. I will remove it here. Are you ok with that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thanks


</plugins>
</build>

Expand Down Expand Up @@ -552,6 +560,43 @@
</plugins>
</build>
</profile>

<profile>
<id>code-coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<!-- examples of class excluding -->
<!-- excludes>
<exclude>za/co/absa/enceladus/migrations/continuous/EntityVersionMap.class</exclude>
<exclude>za/co/absa/enceladus/rest_api/exceptions/ValidationException.class</exclude>
</excludes -->
</configuration>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/jacoco</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>