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

Add Provide-Capability OSGi header to engine bundles #2544

Closed
wants to merge 1 commit into from

Conversation

kriegfrj
Copy link
Contributor

@kriegfrj kriegfrj commented Feb 4, 2021

Adds

  • Provide-Capability: org.junit.platform.engine;org.junit.platform.engine=junit-vintage;version:Version="${project.version}" to junit-vintage-engine
  • Provide-Capability: org.junit.platform.engine;org.junit.platform.engine=junit-jupiter;version:Version="${project.version}" to junit-jupiter-engine

Fixes #2100.

I hereby agree to the terms of the JUnit Contributor License Agreement.

@bjhargrave
Copy link
Contributor

We should also add org.junit.platform.engine to the OSGi Capability Namespace registry.

@marcphilipp
Copy link
Member

Tentatively slated for 5.8 M1 solely for the purpose of team discussion.

@marcphilipp
Copy link
Member

@kriegfrj Spotless is not happy with the formatting: https://scans.gradle.com/s/zdxufq62y5kri#failure

@kriegfrj
Copy link
Contributor Author

kriegfrj commented Feb 4, 2021

@kriegfrj Spotless is not happy with the formatting: https://scans.gradle.com/s/zdxufq62y5kri#failure

Thanks - ran ./gradlew spotlessApply and force-pushed.

@kriegfrj
Copy link
Contributor Author

kriegfrj commented Feb 4, 2021

I might have to try and recruit @rotty3000 to have a look at the failing verifyOSGi test tasks. The bundles themselves look ok (I think) so it's a problem with the verify task not finding them?

> Task :junit-jupiter-engine:verifyOSGi FAILED
Resolution failed. Capabilities satisfying the following requirements could not be found:
    [<<INITIAL>>]
      ? osgi.identity: (osgi.identity=junit-jupiter-engine)

> Task :junit-vintage-engine:verifyOSGi FAILED
Resolution failed. Capabilities satisfying the following requirements could not be found:
    [<<INITIAL>>]
      ? osgi.identity: (osgi.identity=junit-vintage-engine)

@marcphilipp marcphilipp modified the milestones: 5.8 M1, 5.8 M2/RC1 Feb 7, 2021
@rotty3000
Copy link
Contributor

I will take a look this week. Thanks for your patience.

@rotty3000
Copy link
Contributor

reviewing the issue...

@rotty3000
Copy link
Contributor

@kriegfrj You'll laugh when you see what was wrong ;)

diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts
index 0fa4de3259..b11624c6d2 100644
--- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts
+++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts
@@ -32,7 +32,7 @@ tasks {
                 Provide-Capability:\
                     org.junit.platform.engine;\
                         org.junit.platform.engine='junit-jupiter';\
-                        version:Version=${project.version}
+                        version:Version="${'$'}{version_cleanup;${project.version}}"
             """)
         }
     }
diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts
index 8546e232cb..1621a9c65c 100644
--- a/junit-vintage-engine/junit-vintage-engine.gradle.kts
+++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts
@@ -60,7 +60,7 @@ tasks {
                 Provide-Capability:\
                     org.junit.platform.engine;\
                         org.junit.platform.engine='junit-vintage';\
-                        version:Version=${project.version}
+                        version:Version="${'$'}{version_cleanup;${project.version}}"
             """)
         }
     }

@kriegfrj
Copy link
Contributor Author

@kriegfrj You'll laugh when you see what was wrong. ;)

:laugh: So @rotty3000 wins the quote-of-the-week award.

@marcphilipp , I think this one is ready for review/ merge.

@marcphilipp
Copy link
Member

@kriegfrj Could you please rebase this on main?

@marcphilipp marcphilipp modified the milestones: 5.8 RC1, 5.8 M2 May 13, 2021
@marcphilipp
Copy link
Member

I've done so myself and pushed your commit to main. Thanks!

@kriegfrj
Copy link
Contributor Author

So sorry, slipped off the radar. Thank you for taking care of it!

@kriegfrj kriegfrj deleted the 2100-osgi-capability branch May 14, 2021 12:02
rotty3000 added a commit to rotty3000/junit5 that referenced this pull request Jun 28, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params depend on junit-platform-commons
- junit-platform-commons Requires a org.junit.platform.engine=*
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable having either junit-jupiter OR junit-vintage on your test classpath

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
rotty3000 added a commit to rotty3000/junit5 that referenced this pull request Jun 28, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params depend on junit-platform-commons
- junit-platform-commons Requires a org.junit.platform.engine=*
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable having either junit-jupiter OR junit-vintage on your test classpath

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
rotty3000 added a commit to rotty3000/junit5 that referenced this pull request Jun 28, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params depend on junit-platform-commons
- junit-platform-commons Requires a org.junit.platform.engine=*
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable having either junit-jupiter OR junit-vintage on your test classpath

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
rotty3000 added a commit to rotty3000/junit5 that referenced this pull request Jun 29, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params Requires a org.junit.platform.engine=junit-jupiter
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable by consuming junit-jupiter-api & junit-jupiter-params in your tests OR in the case of vintage
having @requirement(namespace = "org.junit.platform.engine", name = "junit-vintage")

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
rotty3000 added a commit to rotty3000/junit5 that referenced this pull request Jun 30, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params Requires a org.junit.platform.engine=junit-jupiter
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable by consuming junit-jupiter-api & junit-jupiter-params in your tests OR in the case of vintage
having @requirement(namespace = "org.junit.platform.engine", name = "junit-vintage")

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
rotty3000 added a commit to rotty3000/junit5 that referenced this pull request Jul 3, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params Requires a org.junit.platform.engine=junit-jupiter
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable by consuming junit-jupiter-api & junit-jupiter-params in your tests OR in the case of vintage
having @requirement(namespace = "org.junit.platform.engine", name = "junit-vintage")

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
rotty3000 added a commit to rotty3000/junit5 that referenced this pull request Oct 28, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params Requires a org.junit.platform.engine=junit-jupiter
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable by consuming junit-jupiter-api & junit-jupiter-params in your tests OR in the case of vintage
having @requirement(namespace = "org.junit.platform.engine", name = "junit-vintage")

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
rotty3000 added a commit to rotty3000/junit5 that referenced this pull request Oct 28, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params Requires a org.junit.platform.engine=junit-jupiter
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable by consuming junit-jupiter-api & junit-jupiter-params in your tests OR in the case of vintage
having @requirement(namespace = "org.junit.platform.engine", name = "junit-vintage")

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
marcphilipp pushed a commit that referenced this pull request Oct 29, 2021
What this means is that merely by consuming the Jupiter client APIs results in requiring a fully fleshed out runtime including launcher as follows
- junit-jupiter-api & junit-jupiter-params Requires a org.junit.platform.engine=junit-jupiter
- junit-jupiter-engine Provides org.junit.platform.engine=junit-jupiter
- junit-vintage-engine Provides org.junit.platform.engine=junit-vintage
- junit-jupiter-engine & junit-vintage-engine Requires org.junit.platform.launcher=junit-platform-launcher
- junit-platform-launcher Provides org.junit.platform.launcher=junit-platform-launcher

The solution is solvable by consuming junit-jupiter-api & junit-jupiter-params in your tests OR in the case of vintage
having @requirement(namespace = "org.junit.platform.engine", name = "junit-vintage")

Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
runningcode pushed a commit to runningcode/junit5 that referenced this pull request Feb 15, 2023
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.

OSGi capability namespace for TestEngines
4 participants