Convert groovy smoke tests to java #14795
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An alternative for #14731
This PR largely copies from #14731 The main difference is that #14731 puts test container management into
SmokeTestInstrumentationExtensionwhile this PR puts it into an abstract base class. Hopefully by not couplingSmokeTestInstrumentationExtensionwith our smoke tests it will be usable outside this project and provide users a better way for asserting the telemetry produced by the agent. For example we could use it in https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/examples/distro/smoke-tests/src/test/java/com/example/javaagent/smoketest/SmokeTest.java or in vendor distros.This PR retains the
@AppServerannotation from groovy and #14731 I like that it lets you easily run the some tests for one server version. If we'd go with@ParameterizedTestthen you'd always need to alter the test parameters to just keep the one version you wish to run. Also with@ParameterizedTestwe might need to merge all test cases into one method to void starting the same server multiple times. The benefit of using@ParameterizedTestwould be that it is an established pattern and the code would be much more compact. Could also try some dynamic test magic.