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

fix issues with build dependencies and test execution #1278

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

codecholeric
Copy link
Collaborator

I noticed that some parts of the build are broken:

  • the source set jdk9main doesn't declare its dependency on the compiled classes of main which randomly leads to build fails
  • the test execution of tests with the JUnit Jupiter engine is actually not running during regular CI anymore
    This fixes both these issues and removes some obsolete configuration from the build.

@codecholeric codecholeric requested a review from hankem March 26, 2024 20:55
Copy link
Member

@hankem hankem left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

Before GitHub offered Windows runners we had to use Jenkins from time to time to run the tests on Windows slaves.
This hasn't been used anymore for years and I don't see any reason to maintain this anymore.

Signed-off-by: Peter Gafert <peter.gafert@archunit.org>
Strangely this still worked in many cases,
even though `jdk9main` is depending on the output of the regular `main` source set,
since it's reusing some of the code.
When I tried to run `./gradlew test` alone now,
`:archunit:compileJdk9mainJava` constantly failed unless this setting was fixed.

Signed-off-by: Peter Gafert <peter.gafert@archunit.org>
When migrating the build configuration to plugins,
we accidentally disabled JUnit 5 tests being executed during CI.
Since we don't have many such tests and nothing ever broke there,
this went unnoticed until now.
The reason is that there is a generic piece
of configuration in `java-testing-conventions.gradle`
that reacts to `archUnitTest.hasSlowTests == true`,
and if `true` and the property `allTests` not set,
configures JUnit 4 to exclude the Category `Slow`.
Unfortunately, this also switches the test execution completely back to JUnit 4,
disabling any JUnit 5 tests to be run.
And since we configure this in `afterEvaluate`,
it actually overwrites the test configuration of the concrete module.
Ironically, we don't even have any `Slow` tests in modules
where we use JUnit 5.
Thus, we can simply disable `archUnitTest.hasSlowTests` for those.
We include a check for now to make sure that this will never be set again
for modules that contain JUnit 5 tests.

Signed-off-by: Peter Gafert <peter.gafert@archunit.org>
We don't have any slow tests in this module,
so we don't need any slow test configuration.

Signed-off-by: Peter Gafert <peter.gafert@archunit.org>
@codecholeric codecholeric force-pushed the fix-build-execution branch from 7584c41 to 96d38be Compare April 9, 2024 20:59
@codecholeric codecholeric merged commit ae1bbb6 into main Apr 9, 2024
21 checks passed
@codecholeric codecholeric deleted the fix-build-execution branch April 9, 2024 21:21
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.

2 participants