Skip to content
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

Running ./gradlew test should not require Docker #1411

Merged

Conversation

roxspring
Copy link
Contributor

@roxspring roxspring commented Dec 5, 2023

Annotated MySqlIntegrationTests with @DisabledInAotMode to avoid requiring Docker.

Tested by running within Docker (ironically) using the following Dockerfile in the project root:

FROM gradle:8.4-jdk17
WORKDIR /work
COPY . .
RUN gradle test

Before docker build . fails, ending:

26.70 
26.70 > Task :processTestAot FAILED
26.73 
26.73 FAILURE: Build failed with an exception.
26.73 
26.73 * What went wrong:
26.73 Execution failed for task ':processTestAot'.
26.73 > Process 'command '/opt/java/openjdk/bin/java'' finished with non-zero exit value 1
26.73 
26.73 * Try:
26.73 > Run with --stacktrace option to get the stack trace.
26.73 > Run with --info or --debug option to get more log output.
26.73 > Run with --scan to get full insights.
26.73 > Get more help at https://help.gradle.org.
26.73 
26.73 Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
26.73 
26.73 You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
26.73 
26.73 For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
26.73 4 actionable tasks: 2 executed, 2 up-to-date
26.73 
26.73 BUILD FAILED in 26s
------
Dockerfile:4
--------------------
   2 |     WORKDIR /work
   3 |     COPY . .
   4 | >>> RUN gradle test
   5 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c gradle test" did not complete successfully: exit code: 1

After docker build . passes, ending:

 => [3/4] COPY . .                                                                                                                                                                                    0.4s
 => [4/4] RUN gradle test                                                                                                                                                                            65.4s
 => exporting to image                                                                                                                                                                                0.5s
 => => exporting layers                                                                                                                                                                               0.5s
 => => writing image sha256:0fc88e7f71d309ee256cfec71061df1f797acd72ea4f7db47ca87f0623acbc50                                                                                                          0.0s 

Closes #1307

@pivotal-cla
Copy link

@roxspring Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@roxspring
Copy link
Contributor Author

@pivotal-cla This is an Obvious Fix

@pivotal-cla
Copy link

@roxspring This Pull Request contains an obvious fix. Signing the Contributor License Agreement is not necessary.

@dsyer dsyer merged commit d69204f into spring-projects:main Dec 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gradle build fails when Docker is not available
3 participants