Skip to content

Commit

Permalink
Merge pull request #3278 from LorenzoBettini/lb_2258
Browse files Browse the repository at this point in the history
Re-enabled Integration tests for xtend-archetype
  • Loading branch information
LorenzoBettini authored Dec 4, 2024
2 parents acc36ef + 6fc2ee3 commit 7dc3600
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 9 deletions.
3 changes: 1 addition & 2 deletions full-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

MVN_ARGS=(\
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dit-archetype-tests-skip=true \
)

# args parsing inspired by https://gist.github.com/jehiah/855086
Expand All @@ -22,7 +21,7 @@ while [ "$1" != "" ]; do
exit
;;
--no-tests)
MVN_ARGS+=(-DskipTests=true)
MVN_ARGS+=(-DskipTests=true -Dit-archetype-tests-skip=true)
;;
--local-repository)
MVN_ARGS+=" -Dmaven.repo.local=$VALUE"
Expand Down
5 changes: 5 additions & 0 deletions org.eclipse.xtend.maven.archetype/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To run the integration tests, the `maven.home` variable must defined, i.e., passed to the Maven build with `-Dmaven.home=...`.

For example, if the Maven executable is `/usr/local/bin/mvn`, you need to pass `-Dmaven.home=/usr/local` (i.e., without the `bin` subdirectory).

The Maven Invoker Plugin's goal `install` is attached to the `pre-integration-test` phase, in order to install the needed Maven artifacts of Xtext/Xtend into the `target/.m2test` folder, which will be then used by the integration test to build the test project generated from the archetype.
41 changes: 36 additions & 5 deletions org.eclipse.xtend.maven.archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

<properties>
<root-dir>${basedir}/..</root-dir>
<it-archetype-tests-skip>true</it-archetype-tests-skip>
<it-archetype-tests-skip>false</it-archetype-tests-skip>
<it-archetype-tests-debug>false</it-archetype-tests-debug>
<!-- The local Maven repository for our IT tests -->
<localMavenRepositoryPath>${project.basedir}/target/.m2test</localMavenRepositoryPath>
</properties>

<build>
Expand Down Expand Up @@ -49,18 +52,46 @@
</plugins>
</pluginManagement>
<plugins>
<!-- install test dependencies, including the xtend-maven-plugin in the local .m2 repository
that will be used by the integration test to build the test project generated with the archetype -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<extraArtifacts>
<!-- our BOM is not a dependency (it's just imported), thus, we must
install it explicitly in the local maven repository -->
<extraArtifact>org.eclipse.xtext:xtext-dev-bom:${project.version}:pom</extraArtifact>
</extraArtifacts>
<localRepositoryPath>${localMavenRepositoryPath}</localRepositoryPath>
</configuration>
<executions>
<execution>
<id>install dependencies in local test repo</id>
<phase>pre-integration-test</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<scope>test</scope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
<configuration>
<skip>${it-archetype-tests-skip}</skip>
<debug>true</debug>
<debug>${it-archetype-tests-debug}</debug>
<localRepositoryPath>${localMavenRepositoryPath}</localRepositoryPath>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
</goals>
<configuration><debug>true</debug></configuration>
<configuration>
<skip>${it-archetype-tests-skip}</skip>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -84,7 +115,7 @@
</file>
</activation>
<properties>
<it-tests-skip>true</it-tests-skip>
<it-archetype-tests-skip>true</it-archetype-tests-skip>
</properties>
</profile>
</profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<defaultValue>UTF-8</defaultValue>
</requiredProperty>
<requiredProperty key="javaVersion">
<defaultValue>1.8</defaultValue>
<defaultValue>17</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ sourceEncoding=UTF-8
groupId=integrationtest.group
artifactId=integrationtest.artifactId
version=1.0.0-SNAPSHOT
javaVersion=17
package=org.eclipse.xtend.xtend.archetype.integrationtest
packageInPathFormat=org/eclipse/xtend/xtend-archetype/integrationtest
4 changes: 4 additions & 0 deletions org.eclipse.xtend.maven.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.5.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
1 change: 0 additions & 1 deletion org.eclipse.xtend.maven.plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<extraArtifacts>
<!-- our BOM is not a dependency (it's just imported), thus, we must
Expand Down

0 comments on commit 7dc3600

Please sign in to comment.