Skip to content
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
34 changes: 34 additions & 0 deletions .github/workflows/pr_build_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,37 @@ jobs:
run: mvn spotless:check
- name: Build with Maven
run: MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"; mvn clean install -T 1C -B -C -e -fae -V -Dmaven.compiler.fork=true -Dsurefire.rerunFailingTestsCount=2 -Dassemblies=false -Djacoco.skip=true --file pom.xml

# Add a UI and run the UI tests only
ui-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: 21
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-m2-
${{ runner.os }}-
# SWT uses the GTK3 native bindings on Linux; Xvfb provides the virtual display.
- name: Install Xvfb and SWT GTK libraries
run: sudo apt-get update && sudo apt-get install -y xvfb libgtk-3-0
- name: Run SWTBot UI tests under Xvfb
run: >
xvfb-run -a --server-args="-screen 0 1280x1024x24"
mvn -B -V -Puitest -Dassemblies=false -Djacoco.skip=true package
- name: Upload SWTBot failure screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: swtbot-screenshots
path: '**/screenshots/**'
if-no-files-found: ignore
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ assemblies/debug/audit
# Monaco Editor files are downloaded at build time (see rap/pom.xml)
rap/src/main/resources/org/apache/hop/ui/hopgui/monaco/vs/
rap/src/main/resources/org/apache/hop/ui/hopgui/monaco/monaco-files.list

# Screenshots captured by SWTbot
screenshots/
15 changes: 15 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ pipeline {
}
}
}
stage('UI Tests (SWTBot)') {
when {
anyOf { changeset pattern: "^(?!docs).*^(?!integration-tests).*" , comparator: "REGEXP" ; equals expected: true, actual: params.FORCE_BUILD }
}
steps {
echo 'Running SWTBot UI tests under Xvfb'
sh "xvfb-run -a --server-args='-screen 0 1280x1024x24' mvn $MAVEN_PARAMS -Puitest -Dassemblies=false -Djacoco.skip=true test"
}
post {
always {
junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
archiveArtifacts(artifacts: '**/screenshots/**', allowEmptyArchive: true)
}
}
}
stage('Unzip Apache Hop'){
when {
anyOf { changeset pattern: "^(?!docs).*^(?!integration-tests).*" , comparator: "REGEXP" ; equals expected: true, actual: params.FORCE_BUILD }
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile.daily
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pipeline {
stage('Build & Test') {
steps {
echo 'Build & Test'
sh "mvn $MAVEN_PARAMS clean install"
sh "xvfb-run -a --server-args='-screen 0 1280x1024x24' mvn $MAVEN_PARAMS clean install"
}
}
stage('Code Quality') {
Expand Down
36 changes: 36 additions & 0 deletions lib-p2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.hop</groupId>
<artifactId>hop</artifactId>
<version>2.19.0-SNAPSHOT</version>
</parent>

<artifactId>hop-libs-p2</artifactId>
<packaging>pom</packaging>
<name>Hop p2 Libraries</name>
<description>Fetch Eclipse artifacts from P2</description>

<modules>
<module>swtbot</module>
<module>tm4e</module>
</modules>
</project>
162 changes: 162 additions & 0 deletions lib-p2/swtbot/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.hop</groupId>
<artifactId>hop-libs-p2</artifactId>
<version>2.19.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.eclipse</groupId>
<artifactId>org.eclipse.swtbot.swt.finder</artifactId>
<version>4.3.0</version>
<packaging>pom</packaging>
<name>Eclipse SWTBot Wrapper</name>

<properties>
<swtbot.download.dir>${project.build.directory}/download</swtbot.download.dir>
<swtbot.finder.file>org.eclipse.swtbot.swt.finder_4.3.0.202506021445.jar</swtbot.finder.file>
<swtbot.finder.jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</swtbot.finder.jar>
<swtbot.junit5.file>org.eclipse.swtbot.junit5_x_4.3.0.202506021445.jar</swtbot.junit5.file>
<swtbot.junit5.jar>${project.build.directory}/${project.artifactId}-${project.version}-junit5.jar</swtbot.junit5.jar>
<swtbot.plugins.url>https://download.eclipse.org/technology/swtbot/releases/${project.version}/plugins</swtbot.plugins.url>
</properties>

<!-- SWTBot's bundles Import-Package hamcrest, slf4j and (in SWTBotAssert) org.junit, so the
mirror declares them: anything depending on this wrapper gets the runtime stack transitively. -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.17</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>download-swtbot-finder</id>
<goals>
<goal>wget</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<url>${swtbot.plugins.url}/${swtbot.finder.file}</url>
<outputDirectory>${swtbot.download.dir}</outputDirectory>
<outputFileName>${swtbot.finder.file}</outputFileName>
</configuration>
</execution>
<execution>
<id>download-swtbot-junit5</id>
<goals>
<goal>wget</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<url>${swtbot.plugins.url}/${swtbot.junit5.file}</url>
<outputDirectory>${swtbot.download.dir}</outputDirectory>
<outputFileName>${swtbot.junit5.file}</outputFileName>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>prepare-swtbot-jars</id>
<goals>
<goal>run</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<target>
<copy file="${swtbot.download.dir}/${swtbot.finder.file}" overwrite="true" tofile="${swtbot.finder.jar}"></copy>
<copy file="${swtbot.download.dir}/${swtbot.junit5.file}" overwrite="true" tofile="${swtbot.junit5.jar}"></copy>
</target>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-swtbot-jars</id>
<goals>
<goal>attach-artifact</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<artifacts>
<artifact>
<file>${swtbot.finder.jar}</file>
<type>jar</type>
</artifact>
<artifact>
<file>${swtbot.junit5.jar}</file>
<type>jar</type>
<classifier>junit5</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>apache-release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion rcp/tm4e/pom.xml → lib-p2/tm4e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<parent>
<groupId>org.apache.hop</groupId>
<artifactId>hop-ui-rcp-parent</artifactId>
<artifactId>hop-libs-p2</artifactId>
<version>2.19.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
36 changes: 36 additions & 0 deletions plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,41 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>

<!-- SWTBot UI-test stack, available to any plugin that adds a @Tag("uitest") test extending
org.apache.hop.ui.testing.SwtBotTestBase. hop-ui/core/engine/SWT are already provided
above; these add the harness, the standalone look-and-feel impls, and the SWTBot jars
(hamcrest/slf4j/junit4 come transitively from the swtbot wrapper). All test-scope, so
non-UI plugins carry them on the test classpath only and are otherwise unaffected. -->
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-ui</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-ui-rcp</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>org.eclipse.swtbot.swt.finder</artifactId>
<version>${swtbot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>org.eclipse.swtbot.swt.finder</artifactId>
<version>${swtbot.version}</version>
<classifier>junit5</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<!-- The SWTBot UI-test stack above is on every plugin's test classpath. The @Tag("uitest")
gating and the uitest / swtbot-mac profiles are inherited from the root pom, so a plugin
needs no extra config to add a UI test extending org.apache.hop.ui.testing.SwtBotTestBase. -->
</project>
2 changes: 2 additions & 0 deletions plugins/transforms/abort/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
<packaging>jar</packaging>
<name>Hop Plugins Transforms Abort</name>

<!-- The SWTBot UI-test stack (harness, swtbot jars, rcp) and the @Tag("uitest") gating are all
inherited from the hop-plugins parent, so AbortDialogTest needs no extra config here. -->
</project>
Loading
Loading