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
Based on the comments I see in #312, it seems like the plan is that a .micronaut directory in the root of the project is supposed to control test resource configuration as a backup if the build tool isn't used to run your tests - such as when you run a single test in a file in IntelliJ.
Actual Behaviour
However, if you run your test resources in a separate module and use the test-resource-consumer plugin in the other modules, those modules will fail to find the test resource module if you run tests w/o delegating to gradle.
This happens because the .micronaut directory is found in the test resource module, not in the root project directory module.
This could possibly be fixed with some custom configuration that sets test-resource configuration instructions in the root directory that delegates to the proper module.
Alternatively, since your consuming projects have to set up a dependency on the test resource module -
testResourcesService(project(":test-resources"))
it might be possible to somehow check this dependency's contents to figure out the proper .micronaut directory location instead.
Steps To Reproduce
Clone this example application listed below.
Run RedisCacheTest using gradle
Run the single test in RedisCacheTest using something like IntelliJ - this won't delegate to gradle and will instead use the IntelliJ runner.
In the first test, environment variables get set correctly.
In the second test, there are no environment variables, and the application module isn't aware of the test-resources/.micronaut/test-resources directory in the test-resources module.
Expected Behavior
Based on the comments I see in #312, it seems like the plan is that a
.micronaut
directory in the root of the project is supposed to control test resource configuration as a backup if the build tool isn't used to run your tests - such as when you run a single test in a file in IntelliJ.Actual Behaviour
However, if you run your test resources in a separate module and use the test-resource-consumer plugin in the other modules, those modules will fail to find the test resource module if you run tests w/o delegating to gradle.
This happens because the
.micronaut
directory is found in the test resource module, not in the root project directory module.This could possibly be fixed with some custom configuration that sets test-resource configuration instructions in the root directory that delegates to the proper module.
Alternatively, since your consuming projects have to set up a dependency on the test resource module -
testResourcesService(project(":test-resources"))
it might be possible to somehow check this dependency's contents to figure out the proper
.micronaut
directory location instead.Steps To Reproduce
RedisCacheTest
using gradleRedisCacheTest
using something like IntelliJ - this won't delegate to gradle and will instead use the IntelliJ runner.In the first test, environment variables get set correctly.
In the second test, there are no environment variables, and the
application
module isn't aware of thetest-resources/.micronaut/test-resources
directory in thetest-resources
module.Environment Information
Ran this locally w/ Mac OSX.
Uses JDK 17
Example Application
https://github.com/MT-Jacobs/mn-test-resource-module
Version
4.4.3
The text was updated successfully, but these errors were encountered: