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

Breaking change / Regression due to dependency upgrade to 0.23+: rules fail when no matching class was found #59

Closed
1 of 3 tasks
tiffmaelite opened this issue Apr 11, 2022 · 1 comment · Fixed by #60

Comments

@tiffmaelite
Copy link

Summary

[0.23.0 changelog of ArchUnit|https://github.com/TNG/ArchUnit/releases] mentions:

ArchRules will now by default reject evaluating if the set passed to the should-clause is empty. This prevents implementation errors like picking a package in that()... that doesn't even exist and thus composing a rule that doesn't check anything (compare the user guide; see TNG/ArchUnit#774; thanks a lot @oberprah)
[...]
You can restore the old behavior by setting the ArchUnit property archRule.failOnEmptyShould=false

Type of Issue

It is a :

  • bug / regression
  • request
  • question regarding the documentation

Motivation

Being able to define rule set in parent Maven file without knowing in advance if the module will contain classes satisfying the test.

Current Behavior (since 2.9.0)

  • <rule>com.societegenerale.commons.plugin.rules.TestClassesNamingRuleTest</rule>
    fails on modules with no test classes
  • <rule>com.societegenerale.commons.plugin.rules.NoPrefixForInterfacesRuleTest</rule>
    fails on modules without interfaces
  • etc

Expected Behavior (in 2.8.0)

Build succeeds on modules without Java classes as well as on the ones which do not satisfy the "that" conditions of all defined rules in the build configuration.
i.e. set globally archRule.failOnEmptyShould = true for this build-plugin

Steps to Reproduce (for bugs)

See "current behavior"

Your Environment

  • Version used:
  • OS and version:
  • Version of libs used:
@tiffmaelite
Copy link
Author

tiffmaelite commented Apr 12, 2022

@vincent-fuchs thank you for your quick reaction time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant