You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ArchUnit tests are flaky, because they wok on the build level. Further some tests seem not to work properly.
Wanted
Working ArchUnit tests wihtout side effects.
Solution
We need to fix the resideInPackage (no working properly)
We need to fix the execution of the unit tests -> test classes are only available when tests were executed before executing the archunit tests:
write ArchUnitExtension annotation for Junit test,
test are only executed when sechub.archunit.buildfolder is set,
GH action: ./gradlew :sechub-archunit-test:test after build
add shell command to sdc.sh
We need to document if side effects still exists (e.g. with .because, when to use "sechub.archunit.ignoreFolders")
Ideas: archunit gradle plugin?
The text was updated successfully, but these errors were encountered:
An eclipse build does always compile all classes (also test classes etc.) and when we start the arch unit tests with eclipse we have (at least one) failing test(s) - e.g. CodingRulesTest complains about:
java.lang.AssertionError: ArchitectureViolation [Priority: MEDIUM] - Rule'no classes should access @Deprecated members, because there should be a better alternative'wasviolated (3times):
Method <com.mercedesbenz.sechub.domain.scan.product.sereco.SerecoReportProductExecutor.$SWITCH_TABLE$com$mercedesbenz$sechub$sharedkernel$ProductIdentifier()> getsfield <com.mercedesbenz.sechub.sharedkernel.ProductIdentifier.NESSUS> in (SerecoReportProductExecutor.java:35)
Method <com.mercedesbenz.sechub.domain.scan.product.sereco.SerecoReportProductExecutor.$SWITCH_TABLE$com$mercedesbenz$sechub$sharedkernel$ProductIdentifier()> getsfield <com.mercedesbenz.sechub.sharedkernel.ProductIdentifier.NETSPARKER> in (SerecoReportProductExecutor.java:35)
Method <com.mercedesbenz.sechub.storage.s3.AbstractAwsS3Storage$LogS3ProgressListener.$SWITCH_TABLE$com$amazonaws$event$ProgressEventType()> getsfield <com.amazonaws.event.ProgressEventType.BYTE_TRANSFER_EVENT> in (AbstractAwsS3Storage.java:277)
atcom.tngtech.archunit.lang.ArchRule$Assertions.assertNoViolation(ArchRule.java:94)
atcom.tngtech.archunit.lang.ArchRule$Assertions.check(ArchRule.java:86)
atcom.tngtech.archunit.lang.ArchRule$Factory$SimpleArchRule.check(ArchRule.java:165)
Which is correct, because we marked the product identifiers "NESSUS" and "NETSPARKER" as deprecated and did not ignore those.
But the CI/CD build does NOT fail. Reason is - as mentioned already before in issue description - that at gradle builds not all classes are compiled before they are tested by arch unit.
We could use this test as a canary that the changes, which will be done inside this issue, work. When it works the test will fail in gradle as well. Aftwards we should simply remove the deprecation parts from the product identifiers (because they are still in use by Sereco) or we add a ignore for this situation.
Situation
The ArchUnit tests are flaky, because they wok on the build level. Further some tests seem not to work properly.
Wanted
Working ArchUnit tests wihtout side effects.
Solution
write ArchUnitExtension annotation for Junit test,
test are only executed when sechub.archunit.buildfolder is set,
GH action: ./gradlew :sechub-archunit-test:test after build
add shell command to sdc.sh
The text was updated successfully, but these errors were encountered: