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

Enable the pde-build tests #998

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build/org.eclipse.pde.build.tests/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .
188 changes: 188 additions & 0 deletions build/org.eclipse.pde.build.tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.pde</groupId>
<artifactId>eclipse.pde.build</artifactId>
<version>4.31.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.pde.build.tests</artifactId>
<version>1.4.300-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>

<properties>
<!-- This is used in the ibuilds where the tycho test execution is
DISABLED and instead we rely on the test.xml! -->
<skipTests>true</skipTests>
<ignoredWarnings>${tests.ignoredWarnings}</ignoredWarnings>
</properties>

<profiles>
<profile>
<!-- Only enable this for individual bundles builds as otherhwise the ibuild repository is not aviable and we might run into problems -->
<id>build-individual-bundles</id>
<properties>
<sdkWorkDir>${project.build.directory}/sdk-product</sdkWorkDir>
<deltaPackDir>${project.build.directory}/deltapack/eclipse</deltaPackDir>
<mirrorDir>${project.build.directory}/mirror-site</mirrorDir>
<sdkProfile>SDKProfile</sdkProfile>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<destination>${sdkWorkDir}</destination>
<profile>${sdkProfile}</profile>
<installFeatures>true</installFeatures>
</configuration>
<executions>
<!-- first provision an install of the current eclipse IDE -->
<execution>
<id>install-sdk</id>
<goals>
<goal>director</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<repositories>${eclipse-p2-repo.url}</repositories>
<install>
<iu>
<id>org.eclipse.sdk.ide</id>
</iu>
<iu>
<id>org.eclipse.tips.feature</id>
<feature>true</feature>
</iu>
<iu>
<id>org.eclipse.test</id>
<feature>true</feature>
</iu>
</install>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<!-- provision an deltapack -->
<execution>
<id>mirror-deltapack</id>
<goals>
<goal>mirror</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<destination>${mirrorDir}</destination>
<source>
<repository>
<url>${eclipse-p2-repo.url}</url>
</repository>
</source>
<ius>
<iu><id>org.eclipse.platform.feature.group</id></iu>
<iu><id>org.eclipse.platform.source.feature.group</id></iu>
<iu><id>org.eclipse.rcp.feature.group</id></iu>
<iu><id>org.eclipse.rcp.source.feature.group</id></iu>
<iu><id>org.eclipse.platform.feature.group</id></iu>
<iu><id>org.eclipse.jdt.feature.group</id></iu>
<iu><id>org.eclipse.jdt.source.feature.group</id></iu>
<iu><id>org.eclipse.rcp.configuration.feature.group</id></iu>
<iu><id>org.eclipse.equinox.executable</id></iu>
<iu><id>org.eclipse.e4.rcp.feature.group</id></iu>
<iu><id>org.eclipse.e4.rcp.source.feature.group</id></iu>
</ius>
<includeOptional>false</includeOptional>
<includeNonGreedy>false</includeNonGreedy>
<followStrictOnly>true</followStrictOnly>
<followOnlyFilteredRequirements>true</followOnlyFilteredRequirements>
<latestVersionOnly>true</latestVersionOnly>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- TODO provide as mojo in p2-plugin! -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-eclipse-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>repo-to-runnable</id>
<goals>
<goal>eclipse-run</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<installation>${sdkWorkDir}</installation>
<work>${project.build.directory}/ws-repo</work>
<applicationArgs>
<arg>-application</arg>
<arg>org.eclipse.equinox.p2.repository.repo2runnable</arg>
<arg>-source</arg>
<arg>file:${mirrorDir}</arg>
<arg>-destination</arg>
<arg>file:${deltaPackDir}</arg>
</applicationArgs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<product>org.eclipse.sdk.ide</product>
<testRuntime>p2Installed</testRuntime>
<work>${sdkWorkDir}</work>
<profileName>${sdkProfile}</profileName>
<skipTests>true</skipTests> <!-- this supress the default execution -->
laeubi marked this conversation as resolved.
Show resolved Hide resolved
</configuration>
<executions>
<execution>
<id>pde-build-tests</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skipTests>false</skipTests>
<testClass>org.eclipse.pde.build.tests.PDEBuildTestSuite</testClass>
<systemProperties>
<pde.build.includeP2>false</pde.build.includeP2>
</systemProperties>
<osgiDataDirectory>${project.build.directory}/ws-pde</osgiDataDirectory>
</configuration>
</execution>
<execution>
<id>p2-tests</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skipTests>false</skipTests>
<testClass>org.eclipse.pde.build.tests.P2TestSuite</testClass>
<systemProperties>
<pde.build.includeP2>true</pde.build.includeP2>
</systemProperties>
<osgiDataDirectory>${project.build.directory}/ws-p2</osgiDataDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading