Migrate utils module Groovy tests to Java tests#11569
Conversation
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
| StableConfigSource stableConfigSource = | ||
| new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG); | ||
|
|
||
| // Create ConfigProvider via reflection (constructor is private) |
There was a problem hiding this comment.
the alternative was having this test file a stableconfig subfolder so that package-private safeToString() can be accessed 🤔
| // spotless:on | ||
|
|
||
| @ParameterizedTest | ||
| @MethodSource("containerInfoParsedFromFileContentArguments") |
There was a problem hiding this comment.
This MethodSource was kept for readability -- TableTest requires inputs to be on one line
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54ccc2aa75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
LGTM, left minor comments about code style
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
LGTM in general, left couple of comments.
A general notice: consider to review tests one more time and probably collapse more of them to TableTest format. TableTest supports various collections OOTB, like Map, List, Array,...
Sure I was mainly transferring the tests as close to 1:1 as possible, but I can squash more into TableTests. Thanks for the reviews! |
| @TableTest({ | ||
| "scenario | sunJavaCommand | envVars | expectedServiceName ", | ||
| "null command | null | [:] | ", | ||
| "empty command | '' | [:] | ", | ||
| "all blanks | ' ' | [:] | ", | ||
| "class in command | org.example.App -Dfoo=bar arg2 arg3 | [:] | org.example.App ", | ||
| "jar in command | foo/bar/example.jar -Dfoo=bar arg2 arg3 | [:] | example ", | ||
| "real sun command | | [:] | datadog.trace.api.env.CapturedEnvironmentTest$ServiceNamePrinter", | ||
| "azure site name | foo/bar/example.jar -Dfoo=bar arg2 arg3 | [DD_AZURE_APP_SERVICES: 1, WEBSITE_SITE_NAME: siteService] | siteService ", | ||
| "site name no azure | foo/bar/example.jar -Dfoo=bar arg2 arg3 | [WEBSITE_SITE_NAME: siteService] | example ", | ||
| "azure flag no site | foo/bar/example.jar -Dfoo=bar arg2 arg3 | [DD_AZURE_APP_SERVICES: true] | example " | ||
| }) | ||
| void capturesServiceName( | ||
| String sunJavaCommand, Map<String, String> envVars, String expectedServiceName) | ||
| throws IOException, InterruptedException { | ||
| assertEquals(expectedServiceName, forkAndRunProperties(sunJavaCommand, envVars)); | ||
| } |
|
/merge --commit-message "Migrate utils module Groovy tests to Java tests" |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Migrate Groovy tests in the
utilsmodule to Java without changing any functionalityIntroduce TableTest converter for boxed values
Motivation
This is part of a broader initiative to migrate all testing in this repo to JUnit
Additional Notes
Confirmation that we did not lose tests (note that a few tests were combined in this PR):
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)Jira ticket: [PROJ-IDENT]