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

Introduce skipNativeTests in Maven plugin #179

Closed
1 task done
sbrannen opened this issue Dec 3, 2021 · 4 comments · Fixed by #193
Closed
1 task done

Introduce skipNativeTests in Maven plugin #179

sbrannen opened this issue Dec 3, 2021 · 4 comments · Fixed by #193
Assignees
Labels
enhancement New feature or request maven-plugin Related to Maven plugin
Milestone

Comments

@sbrannen
Copy link
Collaborator

sbrannen commented Dec 3, 2021

Overview

NativeBuildMojo has a skipNativeBuild property.

Whereas, NativeTestMojo has a skipTests property.

This means that you can skip the tests, but that skips the JVM tests and the native tests, since Maven Surefire looks for the same skipTests property.

Some workflows have the need to execute tests on the JVM using the agent in order to generate native configuration files but don't have the need to execute the tests within a native image.

We should therefore support such use cases via a command line similar to the following.

mvn -Pnative -Dagent=true -DskipNativeTests test

Deliverables

  • Introduce a skipNativeTests property to skip only the native tests.
@sbrannen sbrannen added enhancement New feature or request maven-plugin Related to Maven plugin labels Dec 3, 2021
@sbrannen sbrannen added this to the 0.9.9 milestone Dec 3, 2021
@sbrannen
Copy link
Collaborator Author

sbrannen commented Dec 3, 2021

As an alternative, it might be better to replace skipTests in NativeTestMojo with skipNativeTests.

skipTests would then only apply to Maven Surefire; whereas, skipNativeTests would only apply to the Native Build Tools.

@sdeleuze
Copy link
Collaborator

sdeleuze commented Dec 4, 2021

I tend to think that skipTests should still aply on both Surefire and NBT because:

  • Without JVM tests we can't run native test due to missing test ids
  • In term of semantics, it makes sense from POV to skip both

So this issue should be only about adding skipNativeTests without changing skipTests behavior.

@sbrannen
Copy link
Collaborator Author

sbrannen commented Dec 4, 2021

So this issue should be only about adding skipNativeTests without changing skipTests behavior.

We could certainly do it like that for now and change it later if we desire (see below).

Without JVM tests we can't run native test due to missing test ids

That's currently true, but if #76 gets implemented that would no longer be the case.

@sdeleuze sdeleuze modified the milestones: 0.9.9, 0.9.10 Dec 20, 2021
@sbrannen sbrannen self-assigned this Jan 10, 2022
sbrannen added a commit to sbrannen/native-build-tools that referenced this issue Jan 22, 2022
Prior to this commit, the NativeTestMojo had a `skipTests` property.
This meant that you could skip the tests, but that skipped the JVM
tests as well as the native tests, since Maven Surefire looks for the
same `skipTests` flag. In other words, there was previously no way to
execute the JVM tests and skip only the native tests.

This commit addresses this issue by introducing a new `skipNativeTests`
flag that allows the user to explicitly disable only native testing
support.

For example, this new feature enables workflows that need to execute
tests on the JVM using the agent in order to generate native
configuration files without having to execute the tests within a native
image. See the updated reference documentation for additional use cases.

Closes graalvm#179
@sbrannen
Copy link
Collaborator Author

PR #193 is ready for review.

sbrannen added a commit that referenced this issue Feb 1, 2022
Prior to this commit, the NativeTestMojo had a `skipTests` property.
This meant that you could skip the tests, but that skipped the JVM
tests as well as the native tests, since Maven Surefire looks for the
same `skipTests` flag. In other words, there was previously no way to
execute the JVM tests and skip only the native tests.

This commit addresses this issue by introducing a new `skipNativeTests`
flag that allows the user to explicitly disable only native testing
support.

For example, this new feature enables workflows that need to execute
tests on the JVM using the agent in order to generate native
configuration files without having to execute the tests within a native
image. See the updated reference documentation for additional use cases.

Closes #179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maven-plugin Related to Maven plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants