-
Notifications
You must be signed in to change notification settings - Fork 282
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
Using multiple archunit.properties files #389
Comments
I have used ArchUnit in very large code bases, so I can try to give you some pointers of how I went for it. I still configured sth. like 8GB heap to import around 50000 classes with dependencies 😉 As for your second question about different configurations: First of all, ArchUnit will always use the
Note that this is one central configuration though, so if you use JUnit, it might make sense to add a JUnit 4 Rule / JUnit 5 extension to set the property before the test runs and reset it afterwards to avoid influencing other tests. |
@codecholeric awesome, thanks so much for your reply and suggestions. I'm off for a few days right now but I'll try out these suggestions when I'm back at work. |
I'll close this issue for now, feel free to reopen it if you have follow up questions! |
Firstly, thank you for the fantastic library. ArchUnit is great tool and I'm really enjoying using it.
I'm currently introducing and championing ArchUnit in a very large (e.g. multi million lines of code, many modules) app. A colleague of mine asked me this morning about out of memory problems he's getting with ArchUnit. My suspicion is that this is due to the library resolving all of the dependencies of the code he is testing. For some tests we want to use ArchUnit to enforce conventions on large amounts of code, such as my colleague is doing, and for these we will not want to resolve all dependencies to keep memory usage under control. For other tests we want to test the architecture of smaller sections of the codebase and for these we will want to resolve all of the dependencies. It seems that we would need different configuration for each of these different types of tests.
What would be the best way to achieve the above use cases? Is it possible to use multiple archunit.properties files in different modules? Would you consider adding that as a feature if not? Is a better solution to subclass the ClassFileImporter() and make the customizations there? Would using an import option work here also or would that not reduce the memory usage? Thanks in advance for any advice you have on this.
The text was updated successfully, but these errors were encountered: