From 7f37e02fc955802baf5a1f8b02ecc5dd5d21d67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sun, 10 Dec 2023 17:50:53 +0100 Subject: [PATCH] Enable the pde-build tests Currently pde test are not executed what leads to regressions detected too late. This enables the tests based on a profile only executed for verification builds. --- .../build.properties | 4 +- build/org.eclipse.pde.build.tests/pom.xml | 188 ++++++++++++++++++ .../build/internal/tests/p2/P2TestCase.java | 4 + 3 files changed, 193 insertions(+), 3 deletions(-) create mode 100644 build/org.eclipse.pde.build.tests/pom.xml diff --git a/build/org.eclipse.pde.build.tests/build.properties b/build/org.eclipse.pde.build.tests/build.properties index 5279318b69..8951da097d 100644 --- a/build/org.eclipse.pde.build.tests/build.properties +++ b/build/org.eclipse.pde.build.tests/build.properties @@ -19,6 +19,4 @@ bin.includes = META-INF/,\ about.html,\ test.xml src.includes = about.html -jars.compile.order = . -pom.model.property.skipTests = true -pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings} +jars.compile.order = . \ No newline at end of file diff --git a/build/org.eclipse.pde.build.tests/pom.xml b/build/org.eclipse.pde.build.tests/pom.xml new file mode 100644 index 0000000000..7cc6d1c079 --- /dev/null +++ b/build/org.eclipse.pde.build.tests/pom.xml @@ -0,0 +1,188 @@ + + + 4.0.0 + + org.eclipse.pde + eclipse.pde.build + 4.31.0-SNAPSHOT + + org.eclipse.pde.build.tests + 1.4.300-SNAPSHOT + eclipse-test-plugin + + + + true + ${tests.ignoredWarnings} + + + + + + build-individual-bundles + + ${project.build.directory}/sdk-product + ${project.build.directory}/deltapack/eclipse + ${project.build.directory}/mirror-site + SDKProfile + + + + + org.eclipse.tycho + tycho-maven-plugin + + + org.eclipse.tycho + tycho-p2-director-plugin + ${tycho.version} + + ${sdkWorkDir} + ${sdkProfile} + true + + + + + install-sdk + + director + + pre-integration-test + + ${eclipse-p2-repo.url} + + + org.eclipse.sdk.ide + + + org.eclipse.tips.feature + true + + + org.eclipse.test + true + + + + + + + + org.eclipse.tycho.extras + tycho-p2-extras-plugin + ${tycho.version} + + + + mirror-deltapack + + mirror + + pre-integration-test + + ${mirrorDir} + + + ${eclipse-p2-repo.url} + + + + org.eclipse.platform.feature.group + org.eclipse.platform.source.feature.group + org.eclipse.rcp.feature.group + org.eclipse.rcp.source.feature.group + org.eclipse.platform.feature.group + org.eclipse.jdt.feature.group + org.eclipse.jdt.source.feature.group + org.eclipse.rcp.configuration.feature.group + org.eclipse.equinox.executable + org.eclipse.e4.rcp.feature.group + org.eclipse.e4.rcp.source.feature.group + + false + false + true + true + true + + + + + + + org.eclipse.tycho + tycho-eclipse-plugin + ${tycho.version} + + + repo-to-runnable + + eclipse-run + + pre-integration-test + + ${sdkWorkDir} + ${project.build.directory}/ws-repo + + -application + org.eclipse.equinox.p2.repository.repo2runnable + -source + file:${mirrorDir} + -destination + file:${deltaPackDir} + + + + + + + org.eclipse.tycho + tycho-surefire-plugin + + org.eclipse.sdk.ide + p2Installed + ${sdkWorkDir} + ${sdkProfile} + true + + + + pde-build-tests + + test + + + false + org.eclipse.pde.build.tests.PDEBuildTestSuite + + false + + ${project.build.directory}/ws-pde + + + + p2-tests + + test + + + false + org.eclipse.pde.build.tests.P2TestSuite + + true + + ${project.build.directory}/ws-p2 + + + + + + + + + diff --git a/build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java b/build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java index ecb2119269..f1064a637a 100644 --- a/build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java +++ b/build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java @@ -144,9 +144,13 @@ public URI createCompositeFromBase(IFolder repository) throws Exception { URI baseURI = repository.getLocationURI(); File base = new File(Platform.getInstallLocation().getURL().getPath()); + assertTrue("Install location " + base.getAbsolutePath() + " does not exists", base.exists()); base = new File(base, "p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile"); + assertTrue("SDKProfile " + base.getAbsolutePath() + " does not exists", base.exists()); File[] profiles = base.listFiles(); + assertNotNull("can't read folder " + base.getAbsolutePath(), profiles); Arrays.sort(profiles); + assertTrue("No profiles found in " + base.getAbsolutePath(), profiles.length > 0); File profile = profiles[profiles.length - 1]; CompositeMetadataRepository repo = (CompositeMetadataRepository) metadataManager.createRepository(baseURI,