CI/CD Arch Unit massive use #875
-
I've been working with the idea of testing all new source code projects from my company with the Arch Unit. These projects needs to have a standardized architecture. Reading the documentation, I didn't find any useful information about how to test components hidding the tests from developers (the only solution that I found was this topic on StackOverflow). I don't want to show the rules and tests for developers, including not allowing changing them. What are the possible solutions to this problem? Should I create a stage where these tests are injected in the code temporarily and execute the test? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I think what you can do is creating a new (sub?) project (maven or grade) and pulling in the Code to test as a dependency, since ArchUnit scans the whole classpath using a Dependency does the Trick. Then in this subproject/repository you can define your rules and have seperate access permissions for the rule project |
Beta Was this translation helpful? Give feedback.
-
Hey, one possibility would also be to include it into your CI/CD pipeline on an artifact level 🤔 I.e. all the JARs produced on CI are passed on to some other job in the pipeline that does effectively
Could also just have a determined input folder and check all the JARs in there, so the pipeline job would be independent on the concrete projects and would not need to update dependencies, etc., but whatever the previous job supplies as input will be checked 🤷♂️ Otherwise you can follow the approach that @nbrugger-tgm mentioned, e.g. create a project where you depend on the produced artifacts from your artifact repository (e.g. Nexus). But then you need to either create the dependencies dynamically or update that project when new projects to test pop up. For further ideas I would probably need some more constraints 😉 Like how do you imagine it to be integrated into your CI? Do you imagine a separate job like outlined before or are you looking for some fully transparent injection into the project under test (which will likely only work if you have a fairly standardized build system for every project) |
Beta Was this translation helpful? Give feedback.
Hey, one possibility would also be to include it into your CI/CD pipeline on an artifact level 🤔 I.e. all the JARs produced on CI are passed on to some other job in the pipeline that does effectively
Could also just have a determined input folder and check all the JARs in there, so the pipeline job would be independent on the concrete projects and would not need to update dependencies, etc., but whatever the previous job supplies as input will be checked 🤷♂️
Otherwise you can follow the approach that @nbrugger-tgm mentioned, e.g. create a project where you depend on the produced ar…