Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

xtext.tests says it bundles lib/simple.jar but it does not seem to be in jar #2035

Closed
cdietrich opened this issue Dec 5, 2022 · 27 comments
Closed
Milestone

Comments

@cdietrich
Copy link
Member

Bundle-ClassPath: lib/simple.jar,.

@cdietrich
Copy link
Member Author

@cdietrich
Copy link
Member Author

the one in extras does not say it.

@LorenzoBettini
Copy link
Contributor

That file is giving me headaches in #2052

The two tests:

  • org.eclipse.xtext.resource.ClassloaderClasspathUriResolverTest.testClasspathUriForFileInJar()
  • org.eclipse.xtext.resource.ClassloaderClasspathUriResolverTest.testClasspathUriForFileInJarWithFragment()
    fail because they can't find the simple.ecore stored in the JAR.
    I need to make "lib" a source folder, but still that test case must be run as a plug-in unit test to make it work, but that sounds wrong to me.

@cdietrich
Copy link
Member Author

cdietrich commented Jan 16, 2023

@LorenzoBettini can you check if arne found a solution last time
https://github.com/eclipse/xtext-core/tree/ade-newbuild
am also not sure about eclipse tests vs pure surefire tests

@LorenzoBettini
Copy link
Contributor

Actually, I found a solution for running that as a pure JUnit test from Eclipse: no need to set lib as a source folder, as long as you add the JAR in the launch:

gnome-shell-screenshot-duao1p

I guess those tests must be run as pure JUnit tests: many other tests in that project fail if run as plug-in tests.

@cdietrich
Copy link
Member Author

yes. but if we put the jar to the build.properties and manifest.
will it be on the classpath?

@LorenzoBettini
Copy link
Contributor

Only if we run that as a plug-in test I guess, at least when running in Eclipse.
With the launch configuration as above it works from Eclipse.
I have to check how it works from Maven when executed with maven-surefire (NOT tycho-surefire).

@LorenzoBettini
Copy link
Contributor

update: it works like a charm with maven-surefire :)
it looks like not all the same tests are run by maven-surefire: Eclipse runs more of them.
As it happened in .ide.tests, it's just that some test classes don't follow the convention for names, I'll check that.
However, in general, in that project only JUnit4 tests must be executed, right?

@cdietrich
Copy link
Member Author

yes, but there is also
/org.eclipse.xtext.testing/tests/org/eclipse/xtext/testing/tests/junit5/RunJUnit5Suite.java
to run junit5 tests with junit 4,
we also dont seem to have an extra test bundle there

@LorenzoBettini
Copy link
Contributor

But in that project, we don't need that JAR for tests... or did you mean something else?

@cdietrich
Copy link
Member Author

no but as of now none of the tests in core are executed as plugin tests

@LorenzoBettini
Copy link
Contributor

In fact. Currently, everything is executed with maven-surefire (NOT tycho-surefire) that corresponds to execute the tests from Eclipse as JUnit tests, which is what we want, don't we?

@cdietrich
Copy link
Member Author

yes this is what we want

@LorenzoBettini
Copy link
Contributor

OK! Then it's working. :)

@LorenzoBettini
Copy link
Contributor

All 12 projects build and all tests are green! :D

@cdietrich
Copy link
Member Author

nice

@LorenzoBettini
Copy link
Contributor

@cdietrich @szarnekow everything is working in Eclipse and in the CI (GitHub Actions).
I'd be ready to push the branch of my fork as a branch in the main Git repository to adjust the Jenkins build.
Before doing that, I'd like to know whether it's OK for you to leave the GitHub Actions in place. The benefits of GitHub Actions is that we can test also on macOS and Windows (it's already like that in my fork, and all the builds are green)

@cdietrich
Copy link
Member Author

cdietrich commented Jan 16, 2023

@LorenzoBettini does this also produce a local maven repo (aka publishing) yet.
for jenkins you should be able to create a new job at https://ci.eclipse.org/xtext/job/experimental/

@LorenzoBettini
Copy link
Contributor

That's another thing I have to try (first locally): I don't remember the syntax for deploying to a local repository and I'm still investigating.

For the moment it creates a p2 repository (I created a new project for that) in the same location as it was before.

@LorenzoBettini
Copy link
Contributor

@cdietrich I think I got it.
Can I leave the GitHub Actions anyway?

@cdietrich
Copy link
Member Author

i dont know if this will work or something needs to be enabled by admins

@LorenzoBettini
Copy link
Contributor

nothing has to be enabled IIRC for existing projects.
Otherwise, it's just a matter of opening a gitlab issue

@cdietrich
Copy link
Member Author

we can keep it for testing for now and later decide, am not sure how terrible eclipses quotas are

@LorenzoBettini
Copy link
Contributor

I've been using GitHub Actions for EMF Parsley last month, intensively during the new simrel, and it worked perfectly :)

@LorenzoBettini
Copy link
Contributor

OK, I'm ready to test it on Jenkinsfile, I'm going to push my branch on the main repo and let's see if I updated Jenkinsfile correctly...

@LorenzoBettini
Copy link
Contributor

GitHub Actions are running in the main xtext-core repository...

@cdietrich cdietrich added this to the Release_2.31 milestone Feb 23, 2023
@cdietrich
Copy link
Member Author

with no more gradle this is obsolete

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants