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

chore: Split long running integration tests and fast unit tests (DEV-1537) #2315

Merged
merged 36 commits into from Dec 2, 2022

Conversation

seakayone
Copy link
Collaborator

@seakayone seakayone commented Nov 30, 2022

Pull Request Checklist

Task Description/Number

Split tests into different source sets, so that long running integration tests are separated from faster unit tests.

Make sbt it run all tests from all sbt sub projects from the IntegrationTest configuration in sequence.

Make stb test run all tests from all sbt sub projects from the Test configuration in parallel.

Run integration and unit tests in parallel Github Action build jobs.

Move most tests to it source set and keep some zio-test unit tests in test source set.

Fix schema-core to run tests by adding zio-test-sbt to its dependencies.

Add documentation: README.md and internal docs.

Issue Number: DEV-1537

Basic Requirements

Please check if your PR fulfils the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix: represents bug fixes
  • Refactor: represents production code refactoring
  • Feature: represents a new feature
  • Documentation: documentation changes (no production code change)
  • Chore: maintenance tasks (no production code change)
  • Style: styles updates (no production code change)
  • Test: all about tests: adding, refactoring tests (no production code change)
  • Other... Please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Does this PR change client-test-data?

  • Yes (don't forget to update the JS-LIB team about the change)
  • No

@codecov
Copy link

codecov bot commented Dec 1, 2022

Codecov Report

Base: 86.95% // Head: 85.89% // Decreases project coverage by -1.05% ⚠️

Coverage data is based on head (bed666e) compared to base (bfe578a).
Patch coverage: 15.78% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2315      +/-   ##
==========================================
- Coverage   86.95%   85.89%   -1.06%     
==========================================
  Files         242      235       -7     
  Lines       28102    27916     -186     
==========================================
- Hits        24435    23978     -457     
- Misses       3667     3938     +271     
Impacted Files Coverage Δ
...p-shared/src/main/scala/dsp/config/AppConfig.scala 0.00% <0.00%> (ø)
...shared/src/main/scala/dsp/util/UuidGenerator.scala 0.00% <0.00%> (ø)
...sp-shared/src/main/scala/dsp/valueobjects/Id.scala 0.00% <0.00%> (-65.39%) ⬇️
...-shared/src/main/scala/dsp/valueobjects/User.scala 27.27% <15.38%> (-54.40%) ⬇️
...src/main/scala/dsp/valueobjects/LanguageCode.scala 75.00% <33.33%> (-25.00%) ⬇️
...p-shared/src/main/scala/dsp/valueobjects/Iri.scala 68.04% <66.66%> (-26.64%) ⬇️
...-shared/src/main/scala/dsp/valueobjects/Role.scala 0.00% <0.00%> (-100.00%) ⬇️
...d/src/main/scala/dsp/valueobjects/LangString.scala 31.57% <0.00%> (-68.43%) ⬇️
...shared/src/main/scala/dsp/valueobjects/Group.scala 60.00% <0.00%> (-40.00%) ⬇️
... and 30 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@seakayone seakayone force-pushed the wip/improve-test-setup branch 3 times, most recently from 4ea0a7b to 3b369ef Compare December 1, 2022 14:59
@seakayone seakayone changed the title Wip/improve test setup Split long running integration tests and fast unit tests Dec 1, 2022
@seakayone seakayone changed the title Split long running integration tests and fast unit tests chore: Split long running integration tests and fast unit tests (DEV-1537) Dec 2, 2022
@seakayone seakayone self-assigned this Dec 2, 2022
@seakayone seakayone marked this pull request as ready for review December 2, 2022 11:58
Copy link

@irinaschubert irinaschubert left a comment

Choose a reason for hiding this comment

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

LGTM

build.sbt Outdated
@@ -27,7 +24,8 @@ lazy val aggregatedProjects: Seq[ProjectReference] = Seq(webapi, sipi)

lazy val buildSettings = Seq(
organization := "org.knora",
version := (ThisBuild / version).value
version := (ThisBuild / version).value,
javaOptions += "-Xmx2G"

Choose a reason for hiding this comment

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

just curious: did you finally manage to make sbt take this parameter and actually use 2GB?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The OOM exception did not occur anymore. I will remove this setting here.

docs/05-internals/development/testing.md Outdated Show resolved Hide resolved
docs/05-internals/development/testing.md Outdated Show resolved Hide resolved
@@ -1,13 +1,12 @@
/*

Choose a reason for hiding this comment

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

I think it was decided that we should use this copyright header in all files. It was probably used inconsistently - but instead of deleting, you should probably add it where it is missing...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree, this should be automated though.

Copy link
Collaborator Author

@seakayone seakayone Dec 2, 2022

Choose a reason for hiding this comment

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

I guess that some build tool plugin could do this work for us.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

sounds good :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

=> #2317

seakayone and others added 5 commits December 2, 2022 15:13
Co-authored-by: irinaschubert <irina.schubert@dasch.swiss>
Co-authored-by: irinaschubert <irina.schubert@dasch.swiss>
…sSpec.scala

Co-authored-by: irinaschubert <irina.schubert@dasch.swiss>
@seakayone seakayone merged commit 5b4d601 into main Dec 2, 2022
@seakayone seakayone deleted the wip/improve-test-setup branch December 2, 2022 15:03
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.

None yet

2 participants