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

[WIP] use junit 5.9.2 in targets #2208

Closed
wants to merge 1 commit into from
Closed

Conversation

cdietrich
Copy link
Member

use junit 5.9.2 in targets

Signed-off-by: Christian Dietrich <[email protected]>
@cdietrich cdietrich added this to the Release_2.31 milestone Apr 12, 2023
@@ -6,7 +6,6 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the container tycho fails to resolve
without you have to select junit4 for the junit4 tests in run as dialogs. did not find a nice solution yet
see discussion in #2197

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can create two launch configurations in the corresponding projects; one for JUnit4 and one for JUnit5.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is also about running single tests. currently in maintainance mode this is 50% of my usecases.
maybe there is also another option to make the vintage enginge visble to jdt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't the discussion mention that the JUnit5 classpath container makes the import packages superfluous? Just using the classpath container without import packages still makes the build fail?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont know.
the problem is we mix tests and a plugin.
and we need the imports for the plugin

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a plugin that is used in other plugins

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But in the the other projects, e.g., .dsl.tests, we always have the import packages or required packages for junit or jupiter anyway. I thought we'd never rely on the imported packages of xtext.testing.

I forgot to answer your question about running single tests: it's still possible, it's just that the first time it will try to run it with JUnit5, and you have to configure the single test launch configuration for JUnit4. If that's what you asked in previous comments. If you are talking about the annoyance of doing that, I agree ;) , that's why I was suggesting trying to stay with the classpath container.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this is what i mean. you have to selct junit 4 in the dialog.

i have doubts a plugin can have code in osgi that is not on classpath. but i am not an osgi expert.
am also not sure how to properly test this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do some experiments on a separate branch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also seem to export stuff from the test folder in manifest

@HannesWell
Copy link
Member

The class org.eclipse.xtend.ide.buildpath.Junit5LibClasspathAdder also maintains a list of junit bundles that probably has to be adapted too.
I wonder if it would be possible to make that more dynamic and use the BSN of those bundles that contain the corresponding Junit classes?

@cdietrich
Copy link
Member Author

Junit5LibClasspathAdder

this is a good question. it all is a mess and was even more with older eclipse and xtend versions.
wonder if we can use package imports there.
or a mix of both

@cdietrich
Copy link
Member Author

@LorenzoBettini @HannesWell any idea why this is not working

Bildschirmfoto 2023-04-13 um 12 50 16

@LorenzoBettini
Copy link
Contributor

@cdietrich I can reproduce it, but I have no idea why that's not working... even because that bundle is in the target platform...

@cdietrich
Copy link
Member Author

happens also in fresh eclipse.
created eclipse-pde/eclipse.pde#574 to clarify

@cdietrich
Copy link
Member Author

will close this one and create a rebased new on 2morrow

@cdietrich cdietrich closed this Apr 16, 2023
@cdietrich cdietrich deleted the cd_junit592intarget branch April 16, 2023 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants