Skip to content

Add coverage for testing in a native image #121

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

Closed
wilkinsona opened this issue Sep 30, 2022 · 3 comments
Closed

Add coverage for testing in a native image #121

wilkinsona opened this issue Sep 30, 2022 · 3 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Sep 30, 2022

Currently, all of the smoke tests run the tests on the JVM against an app running as a separate process (on the JVM using java -jar or as a native image). We should add something that exercises nativeTest with various things (slices, @SpringBootTest with a mock environment, @SpringBootTest with a web server, etc).

@wilkinsona wilkinsona added the type: enhancement A general enhancement label Sep 30, 2022
@mhalbritter mhalbritter self-assigned this Oct 21, 2022
@wilkinsona
Copy link
Member Author

This would have caught spring-projects/spring-boot#32848.

@mhalbritter
Copy link
Contributor

I pushed a change which executes the unit tests on the JVM and in a native image. The nativeAotTests task now depends on nativeTest. I removed the useless unit tests from most of the smoke tests.

The native unit tests can be seen for example in the command-line-runner smoke test.

@wilkinsona
Copy link
Member Author

wilkinsona commented Oct 28, 2022

I'd like to revisit this as I think it's resulted in individual smoke tests covering too many things. It feels like we might need two separate kinds of smoke test:

  1. An app smoke test that runs an AOT-processed app on the JVM or in a native image and tests it
  2. A test smoke test that runs AOT-processed tests on the JVM or in a native image

This separation will mean that we have four different tasks that can be run to test different things:

  1. app smoke test
    a. test the app on the JVM
    b test the app in a native image
  2. test smoke test
    a. Run the AOT-processed tests on the JVM
    b. Run the AOT-processed tests in a native image

These should be configured as separate tasks on CI so that the results provide as clear a picture as possible of what does and does not work.

@wilkinsona wilkinsona reopened this Oct 28, 2022
@wilkinsona wilkinsona self-assigned this Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants