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

Lower requirements of pde.junit.runtime and simplify/clean-up its code #765

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

HannesWell
Copy link
Member

@HannesWell HannesWell commented Sep 22, 2023

This PR aims to lower the lower requirements of pde.junit.runtime to Java-1.8 and Eclipse Indigo (supporting 12 year old Eclipse seems sufficient to me).

Fixes #733

The second commit applies those lowering of requirements and the first one cleans up and simplifies the code (yes even with those low requirements that's possible).
I checked it with a Juno TP and the Plugin complied successfully. My only attempt to start a JUnit Plugin Test failed, but this might be due to some missing Plugins in my TP and I didn't investigate this further.
Of course it would be ideal to have a JUnit test for that, but it will probably need some significant time to download a Indigo TP since I had the impression that the P2-Repo has been moved to some slower server.

@vogella FYI

@github-actions
Copy link

github-actions bot commented Sep 22, 2023

Test Results

   267 files   -        6     267 suites   - 6   54m 8s ⏱️ - 17m 57s
3 341 tests +       1  3 309 ✔️ ±       0  30 💤 ±  0  2 +2 
7 596 runs   - 2 721  7 528 ✔️  - 2 698  66 💤  - 24  2 +2 

For more details on these failures, see this check.

Results for commit f60018c. ± Comparison against base commit 3dd8aa8.

♻️ This comment has been updated with latest results.

@HannesWell HannesWell force-pushed the supportTestingOldEclipse branch from 7e44e19 to 93a354a Compare September 23, 2023 11:52
@HannesWell HannesWell force-pushed the supportTestingOldEclipse branch 3 times, most recently from cd4f03a to 8356477 Compare September 24, 2023 09:36
@HannesWell
Copy link
Member Author

Looks like the Maven-Toolchain is not correctly configured for the GH runners:
Error: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:4.0.2:compile (default-compile) on project org.eclipse.pde.junit.runtime: useJDK = BREE configured, but no toolchain of type 'jdk' with id 'JavaSE-1.8' found. See https://maven.apache.org/guides/mini/guide-using-toolchains.html -> [Help 1]

Although the setup-java action says it's creating the toolchains.xml.
IIRC I noticed a similar issue in the past that the toolchains.xml was completly overwritten by each java version so that only the last one was eventually contained.

Run actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
  with:
    java-version: 8
  11
  17
  
    distribution: temurin
    cache: maven
    java-package: jdk
    check-latest: false
    server-id: github
    server-username: GITHUB_ACTOR
    server-password: GITHUB_TOKEN
    overwrite-settings: true
    job-status: success
    token: ***
Installed distributions
  Resolved Java 8.0.382+5 from tool-cache
  Setting Java 8.0.382+5 as the default
  Creating toolchains.xml for JDK version 8 from temurin
  Writing to /home/runner/.m2/toolchains.xml
  
  Java configuration:
    Distribution: temurin
    Version: 8.0.382+5
    Path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.382-5/x64
  
  Resolved Java 11.0.20+1 from tool-cache
  Setting Java 11.0.20+1 as the default
  Creating toolchains.xml for JDK version 11 from temurin
  Overwriting existing file /home/runner/.m2/toolchains.xml
  
  Java configuration:
    Distribution: temurin
    Version: 11.0.20+1
    Path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.20-1/x64
  
  Resolved Java 17.0.8+1 from tool-cache
  Setting Java 17.0.8+1 as the default
  Creating toolchains.xml for JDK version 17 from temurin
  Overwriting existing file /home/runner/.m2/toolchains.xml
  
  Java configuration:
    Distribution: temurin
    Version: 17.0.8+1
    Path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.8-1/x64

@laeubi
Copy link
Contributor

laeubi commented Sep 25, 2023

IIRC I noticed a similar issue in the past that the toolchains.xml was completly overwritten by each java version so that only the last one was eventually contained.

Can you open an issue about that at setup-java action? You might want to use the upload action or similar to get the content of the generated file directly, maybe the problem is more that the version is not as expected, e.g. Tycho requires that either the version is specified as 1.8 or you have the id set to JavaSE-1.8 at least the ID is different and maybe it is using 8 as a version string as well...

@HannesWell HannesWell force-pushed the supportTestingOldEclipse branch from 8356477 to 2783577 Compare September 25, 2023 18:39
@HannesWell
Copy link
Member Author

You might want to use the upload action or similar to get the content of the generated file directly, maybe the problem is more that the version is not as expected, e.g. Tycho requires that either the version is specified as 1.8 or you have the id set to JavaSE-1.8 at least the ID is different and maybe it is using 8 as a version string as well...

Good point! I believe to have same dark memories that this was a problem, but lets see what the log says.

@HannesWell HannesWell force-pushed the supportTestingOldEclipse branch 2 times, most recently from b4cf8e3 to f8ed91d Compare September 25, 2023 18:44
@HannesWell
Copy link
Member Author

HannesWell commented Sep 25, 2023

You might want to use the upload action or similar to get the content of the generated file directly, maybe the problem is more that the version is not as expected, e.g. Tycho requires that either the version is specified as 1.8 or you have the id set to JavaSE-1.8 at least the ID is different and maybe it is using 8 as a version string as well...

Good point! I believe to have same dark memories that this was a problem, but lets see what the log says.

Yep, that's the problem. The version is 8.

<?xml version="1.0"?>
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>8</version>
      <vendor>temurin</vendor>
      <id>temurin_8</id>
    </provides>
    <configuration>
      <jdkHome>/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.382-5/x64</jdkHome>
    </configuration>
  </toolchain>
[...]
</toolchains>

Created eclipse-platform/eclipse.platform.releng.aggregator#1399 to set the ids.
Good that someone updated the documentation about that recently: eclipse-tycho/tycho#2379

@HannesWell HannesWell force-pushed the supportTestingOldEclipse branch from 87f2dce to f60018c Compare September 25, 2023 20:56
@HannesWell HannesWell merged commit f5c8301 into eclipse-pde:master Sep 25, 2023
@HannesWell HannesWell deleted the supportTestingOldEclipse branch September 25, 2023 21:23
@HannesWell
Copy link
Member Author

IIRC I noticed a similar issue in the past that the toolchains.xml was completly overwritten by each java version so that only the last one was eventually contained.

Can you open an issue about that at setup-java action? You might want to use the upload action or similar to get the content of the generated file directly, maybe the problem is more that the version is not as expected, e.g. Tycho requires that either the version is specified as 1.8 or you have the id set to JavaSE-1.8 at least the ID is different and maybe it is using 8 as a version string as well...

Thanks again for this hint.

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.

JUnit Plug-in tests cannot be started if an older target platform is used
3 participants