Skip to content

Commit

Permalink
Further ITs target platform setup simplification
Browse files Browse the repository at this point in the history
Rely more on autosetting it.
  • Loading branch information
akurtakov committed Dec 12, 2023
1 parent 40a40a4 commit 0dc20f2
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@
<module>product.bundle-based</module>
</modules>

<properties>
<tycho-version>0.8.0-SNAPSHOT</tycho-version>
<p2.repo>http://download.eclipse.org/eclipse/updates/4.23</p2.repo>
</properties>

<repositories>
<repository>
<id>p2</id>
<layout>p2</layout>
<url>${p2.repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<repository>
<id>galileo</id>
<layout>p2</layout>
<url>${p2.repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
2 changes: 1 addition & 1 deletion tycho-its/projects/iu.product/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<repository>
<id>repo</id>
<layout>p2</layout>
<url>${test-data-repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
7 changes: 1 addition & 6 deletions tycho-its/projects/p2Inf.hostRequireFragment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@
<module>fragments</module>
</modules>

<properties>
<tycho-version>0.22.0-SNAPSHOT</tycho-version>
<p2Repository>http://download.eclipse.org/eclipse/updates/4.3</p2Repository>
</properties>

<repositories>
<repository>
<id>junitRuntime</id>
<layout>p2</layout>
<url>${p2Repository}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<repositories>
<repository>
<id>e352</id>
<url>${repo.url}</url>
<url>${target-platform}</url>
<layout>p2</layout>
</repository>
</repositories>
Expand Down
2 changes: 1 addition & 1 deletion tycho-its/projects/product.duplicateIUs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<repository>
<id>test-data-repo</id>
<layout>p2</layout>
<url>${test-data-repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<repository>
<id>repository</id>
<layout>p2</layout>
<url>${repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<repository>
<id>repository</id>
<layout>p2</layout>
<url>${repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
2 changes: 1 addition & 1 deletion tycho-its/projects/surefire.junit47/categories/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<repository>
<id>kepler</id>
<layout>p2</layout>
<url>${kepler-repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<repository>
<id>2019-09</id>
<layout>p2</layout>
<url>${2019-09-repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
2 changes: 1 addition & 1 deletion tycho-its/projects/surefire.p2InstalledRuntime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<repositories>
<repository>
<id>test-repo</id>
<url>${p2.repo.url}</url>
<url>${target-platform}</url>
<layout>p2</layout>
</repository>
</repositories>
Expand Down
6 changes: 1 addition & 5 deletions tycho-its/projects/tycho-ds/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
<artifactId>tycho.ds</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
<tycho-version>3.0.0-SNAPSHOT</tycho-version>
<repo-url>https://download.eclipse.org/releases/2022-03/</repo-url>
</properties>

<repositories>
<repository>
<id>featureRepo</id>
<layout>p2</layout>
<url>${repo-url}</url>
<url>${target-platform}</url>
</repository>
</repositories>
<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class ProductP2TargetPlatformResolverTest extends AbstractTychoIntegrationTest {
@Test
public void testBasic() throws Exception {
Verifier verifier = getVerifier("/TYCHO0294ProductP2TargetPlatformResolver");
verifier.addCliOption("-Dp2.repo=" + P2Repositories.ECLIPSE_LATEST.toString());
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class LocalRepositoryCrosstalkTest extends AbstractTychoIntegrationTest {
@Test
public void test() throws Exception {
// run bundle 2 test first with latest eclipse
Verifier v01 = getVerifier("/TYCHO0367localRepositoryCrosstalk/bundle02", false);
v01.addCliOption("-Dp2.repo=" + P2Repositories.ECLIPSE_LATEST.toString());
Verifier v01 = getVerifier("/TYCHO0367localRepositoryCrosstalk/bundle02");
v01.executeGoal("install");
v01.verifyErrorFreeLog();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import org.apache.maven.it.VerificationException;
import org.apache.maven.it.Verifier;
import org.eclipse.tycho.TychoConstants;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.junit.Test;

Expand Down Expand Up @@ -63,8 +62,7 @@ public void testLibEntry() throws Exception {

@Test
public void testDSComponents() throws Exception {
Verifier verifier = getVerifier("tycho-ds", false, true);
verifier.setSystemProperty("repo-url", TychoConstants.ECLIPSE_LATEST);
Verifier verifier = getVerifier("tycho-ds", true, true);
// first test to consume from target platform
verifyDs(verifier);
// now test consume from maven directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.P2RepositoryTool;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class ProductWithIUTest extends AbstractTychoIntegrationTest {

@Test
public void testRootFilesFromIUPackagingInstalledAndInRepo() throws Exception {
Verifier verifier = getVerifier("iu.product", false);
verifier.addCliOption("-Dtest-data-repo=" + P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("iu.product");
verifier.executeGoal("package");
verifier.verifyErrorFreeLog();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class MultiplatformReactorTest extends AbstractTychoIntegrationTest {

@Test
public void testMultiplatformReactorBuild() throws Exception {
Verifier verifier = getVerifier("multiPlatform.reactor", false);
verifier.addCliOption("-Dtarget-platform=" + P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("multiPlatform.reactor");
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil;
import org.junit.Test;

public class HostRequiresFragmentWithP2InfTest extends AbstractTychoIntegrationTest {

@Test
public void testBuildAndTestWithHostRequiringOwnFragment() throws Exception {
Verifier verifier = getVerifier("/p2Inf.hostRequireFragment", false);
verifier.addCliOption("-Dp2Repository=" + ResourceUtil.P2Repositories.ECLIPSE_LATEST);
Verifier verifier = getVerifier("/p2Inf.hostRequireFragment");

// Test that
// - the install-time dependency from the host to its fragment can be disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class RepoRefLocationP2RepositoryIntegrationTest extends AbstractTychoInt
public void testRefLocation() throws Exception {

List<RepositoryReference> allRepositoryReferences = buildAndGetRepositoryReferences(
"/p2Repository.repositoryRef.location",
v -> v.addCliOption("-Dtest-data-repo=" + ResourceUtil.P2Repositories.ECLIPSE_LATEST.toString()));
"/p2Repository.repositoryRef.location", v -> v.addCliOption("-Dtest-data-repo="
+ ResourceUtil.P2Repositories.ECLIPSE_LATEST.toString().replace("/", "//")));

assertEquals(4, allRepositoryReferences.size());
assertThat(allRepositoryReferences,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
*******************************************************************************/
package org.eclipse.tycho.test.pomDependencyConsider;

import static org.eclipse.tycho.test.util.ResourceUtil.P2Repositories.ECLIPSE_LATEST;

import java.util.List;

import org.apache.maven.it.Verifier;
Expand All @@ -25,8 +23,7 @@ public class PomDependencySystemScopedTest extends AbstractTychoIntegrationTest
@Test
public void testSystemScopedDependenciesIgnored() throws Exception {
// project with pomDependency=consider and checked-in nested jar
Verifier verifier = getVerifier("pomDependencyConsider.systemScope", false);
verifier.addCliOption("-Drepo.url=" + ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("pomDependencyConsider.systemScope");
// fails on second resolver invocation in TestMojo
// if (injected) system-scoped dependencies are not filtered out for
// pomDependency=consider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class ProductDuplicateIUsTest extends AbstractTychoIntegrationTest {

@Test
public void testMultipleProductsNoDuplicateIUs() throws Exception {
Verifier verifier = getVerifier("product.duplicateIUs", false);
verifier.addCliOption("-Dtest-data-repo=" + P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("product.duplicateIUs");
verifier.executeGoal("integration-test");
verifier.verifyErrorFreeLog();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,20 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class ReexportedRequireBundleTest extends AbstractTychoIntegrationTest {

@Test
public void testBundleNativeCode() throws Exception {
Verifier verifier = getVerifier("/resolver.reexportBundle/transitively.require.org.eclipse.osgi");
verifier.addCliOption("-Drepo=" + P2Repositories.ECLIPSE_LATEST.toString());
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}

@Test
public void testOrgEclipseCoreExpressions() throws Exception {
Verifier verifier = getVerifier("/resolver.reexportBundle/org.eclipse.core.expressions");
verifier.addCliOption("-Drepo=" + P2Repositories.ECLIPSE_LATEST.toString());
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class CategoriesTest extends AbstractTychoIntegrationTest {

@Test
public void testIncludeExcludeCategories() throws Exception {
Verifier verifier = getVerifier("/surefire.junit47/categories", false);
verifier.addCliOption("-Dkepler-repo=" + P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("/surefire.junit47/categories");
verifier.addCliOption("-Dgroups=tycho.demo.itp01.tests.FastTests");
verifier.addCliOption("-DexcludedGroups=tycho.demo.itp01.tests.SlowTests");
verifier.executeGoal("verify");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class JUnit5TempDirTest extends AbstractTychoIntegrationTest {

@Test
public void testJUnit5Runner() throws Exception {
Verifier verifier = getVerifier("/surefire.junit5tempdir/bundle.test", false);
verifier.addCliOption("-D2019-09-repo=" + P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("/surefire.junit5tempdir/bundle.test");
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();
String projectBasedir = verifier.getBasedir();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ public class P2InstalledTestRuntimeTest extends AbstractTychoIntegrationTest {

@Test
public void testProvisionAppAndRunTest() throws Exception {
Verifier verifier = getVerifier("surefire.p2InstalledRuntime", false);
verifier.addCliOption("-Dp2.repo.url=" + ResourceUtil.P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("surefire.p2InstalledRuntime");
verifier.addCliOption("-PprovisionProduct");
verifier.executeGoals(List.of("clean", "integration-test"));
verifier.verifyErrorFreeLog();
}

@Test
public void testRunTestOnProvisionedApp() throws Exception {
Verifier verifier = getVerifier("surefire.p2InstalledRuntime", false);
verifier.addCliOption("-Dp2.repo.url=" + ResourceUtil.P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("surefire.p2InstalledRuntime");
verifier.addCliOption("-PuseProvisionedProduct");
verifier.addCliOption("-DproductClassifier=" + getProductClassifier());
verifier.executeGoals(List.of("clean", "integration-test"));
Expand All @@ -44,7 +42,7 @@ public void testRunTestOnProvisionedApp() throws Exception {
@Test
public void testDifferentHarnessVersions() throws Exception {
Verifier verifier = getVerifier("surefire.p2InstalledRuntime", false);
verifier.addCliOption("-Dp2.repo.url=" + ResourceUtil.P2Repositories.ECLIPSE_OXYGEN.toString());
verifier.addCliOption("-Dtarget-platform=" + ResourceUtil.P2Repositories.ECLIPSE_OXYGEN.toString());
// Use different TP for test bundle and product under test
verifier.addCliOption("-Dother.p2.repo.url=" + ResourceUtil.P2Repositories.ECLIPSE_LATEST.toString());
verifier.addCliOption("-PuseProvisionedProduct");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TargetPlatformFilteringIntegrationTest extends AbstractTychoIntegra
public void test() throws Exception {
Verifier verifier = getVerifier("target.restriction.filter", false);
verifier.addCliOption("-De342-repo=" + "https:////download.eclipse.org/releases/2021-06/");
verifier.addCliOption("-De352-repo=" + P2Repositories.ECLIPSE_LATEST.toString());
verifier.addCliOption("-De352-repo=" + P2Repositories.ECLIPSE_LATEST.toString().replace("/", "//"));
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();
}
Expand Down

0 comments on commit 0dc20f2

Please sign in to comment.