-
Notifications
You must be signed in to change notification settings - Fork 1
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
Initial solution of Integration tests control. #185
Conversation
- 'sbt test' now does no run Integration tests - To run IT ot DB tests is needed to call extra command defined in .sbtrc
database/src/test/scala/za/co/absa/atum/database/runs/CreateOrUpdateAdditionalDataTest.scala
Outdated
Show resolved
Hide resolved
server/src/test/scala/za/co/absa/atum/server/api/controller/CheckpointControllerSpec.scala
Outdated
Show resolved
Hide resolved
server/src/test/scala/za/co/absa/atum/server/aws/AwsSecretsProviderSpec.scala
Outdated
Show resolved
Hide resolved
Updated chapter in readme. file.
README.md
Outdated
|
||
### Test controls | ||
|
||
The project uses the `.sbtrc` [(link)](https://www.scala-sbt.org/1.x/docs/Best-Practices.html#.sbtrc) file to manage and control the execution of integration tests. The Integration tests are the ones with the tag `Integration test.` Below are the commands configured in the `.sbtrc` file to facilitate different testing scenarios: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tag IntegrationTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit - cb82439.
server/src/test/scala/za/co/absa/atum/server/api/controller/PartitioningControllerSpec.scala
Outdated
Show resolved
Hide resolved
...a/za/co/absa/atum/server/api/database/runs/functions/CreatePartitioningIfNotExistsSpec.scala
Outdated
Show resolved
Hide resolved
README.md
Outdated
``` | ||
alias test=; testOnly -- -l IntegrationTest | ||
|
||
# `-l IntegrationTest`: This switch excludes all tests labeled as `IntegrationTest,` allowing only only executing unit tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# `-l IntegrationTest`: This switch excludes all tests labeled as `IntegrationTest,` allowing only only executing unit tests. | |
# `-l IntegrationTest`: This switch excludes all tests labeled as `IntegrationTest,` allowing only executing unit tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit - 3be6f06.
@@ -50,7 +50,7 @@ jobs: | |||
- name: Add coverage to PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, is this unit test coverage or combined? What does sbt jacoco
do?
If it runs sbt test
under the hood, which excludes the ITs (I assume this is what's happening, judging by the output of sbt jacoco
on my localhost), then it might make sense to update the naming/titles/sentences in the jacoco YAML files - so that things are a bit more explicit & bot comments generated in PRs would reflect that.
Also, please rename this file to something like jacoco_check_agent.yml
(we have _server
already so it would be more obvious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the overview:
- agent - unit test only (no IT/DB test in module)
- model - unit test only (no IT/DB test in module)
- database - db test only (no IT/Unit test in module)
- server - integration test only (no Unit/DB test in module)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but the naming of the files (potentially also steps) still deserves improving, such as this jacoco_check.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I am open to proposals.
Current naming is trying to be self-descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so jacoco_check.yml
-> jacoco_check_agent.yml
/ jacoco_check_agent_model.yml
❓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be done, yes. Byt why?
I would suggest to do future review here after project fixes issue with multiple java version need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, let's address this outside of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finished the review for now. The biggest thing I'd like to be changed definitely is the scope of these tags and then few improvements/answers regarding the YML jacoco file(s).
JaCoCo model module code coverage report - scala 2.13.11Build Failed |
JaCoCo server module code coverage report - scala 2.13.11
|
.../atum/server/api/database/runs/functions/CreatePartitioningIfNotExistsIntegrationTests.scala
Outdated
Show resolved
Hide resolved
|
||
# CPS QA types aliases | ||
# * Unit tests | ||
alias test=; testOnly *UnitTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is, that tasks that include testing like assembly
don't take aliases into account and run them according to original definition. This creates an IMHO inconsistent behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This problem can be solved by adding this line into module settings in build.sbt.
(assembly / test) := {},
Is that acceptable for modules with Integration tests and external dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the commit where with the proposed solution - ed76338
- Added examples how to manage tests in rest of sbt commands (assembly, publish).
build.sbt
Outdated
jacocoExcludes := jacocoProjectExcludes() | ||
jacocoExcludes := jacocoProjectExcludes(), | ||
(assembly / test) := {}, | ||
(publish / test) := { (Test / testOnly).toTask(" *UnitTests").value } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a space here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it could be removed.
This item depends on: |
Depends on #196