Skip to content

Commit

Permalink
Merge pull request #12 from sroughley/knime_5.1
Browse files Browse the repository at this point in the history
Knime 5.1
  • Loading branch information
sverhoeven authored Nov 20, 2023
2 parents 34348fc + a60b23b commit 87eaaf0
Show file tree
Hide file tree
Showing 18 changed files with 196 additions and 63 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Verify
run: xvfb-run mvn -B verify
- name: Package
run: mvn -B package

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
8 changes: 8 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>2.7.5</version>
</extension>
</extensions>
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
The file is formatted as described on http://keepachangelog.com/.

## [1.0.4] - 2023-11-20

### Changes

- Builds by default with KNIME 5.1, can be configured to build with KNIME 4.7 [#10](https://github.com/3D-e-Chem/knime-testflow/issues/10)

## [Unreleased]

### Changes
Expand Down
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Test Knime workflows from a Junit test.

[![Build Status](https://travis-ci.org/3D-e-Chem/knime-testflow.svg?branch=master)](https://travis-ci.org/3D-e-Chem/knime-testflow)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ba09652161144d9abbe4827fd16bbaec)](https://www.codacy.com/app/3D-e-Chem/knime-testflow?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=3D-e-Chem/knime-testflow&amp;utm_campaign=Badge_Grade)
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.55805.svg)](http://dx.doi.org/10.5281/zenodo.55805)

Expand Down Expand Up @@ -34,12 +33,12 @@ To make use of in a Tycho based project add to the `<repositories>` tag of the `
In the `Require-Bundle` attribute of the `META-INF/MANIFEST.MF` of the tests module add
```
nl.esciencecenter.e3dchem.knime.testing.plugin;bundle-version="[1.0.0,2.0.0)",
org.knime.testing;bundle-version="[4.0.0,5.0.0)",
org.knime.testing;bundle-version="[4.0.0,6.0.0)",
```

## 3. Add test workflow

Create a test workflow as described in the "Testing Framework" manual that you get when you install the "KNIME Testing Framework" (look in plugins/org.knime.testing_x.y.z/doc/Regression Tests.pdf).
Create a test workflow as described in the ["Testing Framework" manual](https://github.com/knime/knime-core/blob/bf6f8c378694d5a435ef29cb469a7ced26ffca9f/org.knime.testing/doc/Regression%20Tests.pdf).

Place the workflow as a directory inside the `src/knime/` directory of the tests module.

Expand Down Expand Up @@ -83,13 +82,13 @@ mvn verify

The test results can be found in the `T E S T S` section of the standard output.

## 6. Add GUI testing to Travis-CI.
## 6. Add GUI testing on GitHub actions.

As you might have noticed during the previouse step, running test will quickly show some dialogs and windows.
To show graphical user elements an X-server is required, sadly Travis-CI does not run an X-server.
A temporary X-server can be run with Xvfb, which is luckily available on all Travis-CI environments.
To show graphical user elements an X-server is required, sadly GitHub actions does not run an X-server.
A temporary X-server can be run with Xvfb, which is luckily available on all GitHub actions environments.

Prepend `xvfb-run` before the `mvn verify` command in the `.travis.yml` file.
Prepend `xvfb-run` before the `mvn verify` command in the `.github/workflows/*.yml` file.

For example
```
Expand All @@ -102,18 +101,24 @@ script: xvfb-run mvn verify -B
mvn verify
```

An Eclipse update site will be made in `p2/target/repository` repository.
An Eclipse update site will be made in `p2/target/repository/` repository.
The update site can be used to perform a local installation.
By default this will compile against KNIME AP v5.1, using the [KNIME-AP-5.1](targetPlatform/KNIME-AP-5.1.target) file.
To build instead for KNIME AP v4.7, use:
```
mvn verify -Dknime.version=4.7
```


# Development

Steps to get development environment setup based on https://github.com/knime/knime-sdk-setup#sdk-setup:

1. Install Java 8
1. Install Java 17
2. Install Eclipse for [RCP and RAP developers](https://www.eclipse.org/downloads/packages/release/2018-12/r/eclipse-ide-rcp-and-rap-developers)
3. Configure Java 8 inside Eclipse Window > Preferences > Java > Installed JREs
3. Configure Java 17 inside Eclipse Window > Preferences > Java > Installed JREs
4. Import this repo as an Existing Maven project
5. Activate target platform by going to Window > Preferences > Plug-in Development > Target Platform and check the `KNIME Analytics Platform (4.0) - nl.esciencecenter.e3dchem.knime.testing.targetplatform/KNIME-AP-4.0.target` target definition.
5. Activate target platform by going to Window > Preferences > Plug-in Development > Target Platform and check the `KNIME Analytics Platform (5.1) - nl.esciencecenter.e3dchem.knime.testing.targetplatform/KNIME-AP-5.1.target` target definition.

During import the Tycho Eclipse providers must be installed.

Expand Down
2 changes: 1 addition & 1 deletion p2/category.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<bundle id="nl.esciencecenter.e3dchem.knime.testing.plugin" version="1.0.3.qualifier">
<bundle id="nl.esciencecenter.e3dchem.knime.testing.plugin" version="1.0.4.qualifier">
<category name="nl.esciencecenter.3D-e-Chem"/>
</bundle>
<category-def name="nl.esciencecenter.3D-e-Chem" label="KNIME 3D-e-Chem Contributions">
Expand Down
2 changes: 1 addition & 1 deletion p2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>nl.esciencecenter.e3dchem.knime.testing</artifactId>
<groupId>nl.esciencecenter.e3dchem.knime.testing</groupId>
<version>1.0.3-SNAPSHOT</version>
<version>1.0.4-SNAPSHOT</version>
</parent>
<artifactId>nl.esciencecenter.e3dchem.knime.testing.p2</artifactId>
<packaging>eclipse-repository</packaging>
Expand Down
12 changes: 6 additions & 6 deletions plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test Knime workflows from a JUnit test
Bundle-SymbolicName: nl.esciencecenter.e3dchem.knime.testing.plugin;singleton:=true
Bundle-Version: 1.0.3.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Version: 1.0.4.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Vendor: Netherlands eScience Center
Require-Bundle: org.knime.workbench.repository;bundle-version="[4.0.0,5.0.0)",
org.knime.workbench.core;bundle-version="[4.0.0,5.0.0)",
org.knime.testing;bundle-version="[4.0.0,5.0.0)",
org.junit;bundle-version="[4.8.0,5.0.0)",
Require-Bundle: org.knime.workbench.repository;bundle-version="[4.0.0,6.0.0)",
org.knime.workbench.core;bundle-version="[4.0.0,6.0.0)",
org.knime.testing;bundle-version="[4.0.0,6.0.0)",
org.junit;bundle-version="[4.8.0,6.0.0)",
org.apache.log4j;bundle-version="[1.2.15,1.3.0)"
Bundle-ClassPath: .
Export-Package: nl.esciencecenter.e3dchem.knime.testing
2 changes: 1 addition & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>nl.esciencecenter.e3dchem.knime.testing</groupId>
<artifactId>nl.esciencecenter.e3dchem.knime.testing</artifactId>
<version>1.0.3-SNAPSHOT</version>
<version>1.0.4-SNAPSHOT</version>
</parent>
<artifactId>nl.esciencecenter.e3dchem.knime.testing.plugin</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
import org.knime.core.node.workflow.SingleNodeContainer;
import org.knime.core.node.workflow.SubNodeContainer;
import org.knime.core.node.workflow.WorkflowManager;
import org.knime.core.util.GUIDeadlockDetector;
import org.knime.core.util.ThreadUtils;
import org.knime.testing.core.TestrunConfiguration;

import org.knime.testing.node.config.TestConfigNodeModel;
Expand Down Expand Up @@ -128,7 +128,7 @@ private void internalRun() {
(usage.getMax() - usage.getUsed()) / 1024.0 / 1024.0);
message += "\n" + formatter.out().toString();
formatter.close();
message += "\nThread status:\n" + GUIDeadlockDetector.createStacktrace();
message += "\nThread status:\n" + ThreadUtils.getJVMStacktraces();
}
NodeLogger.getLogger(WorkflowExecuteTest.class).info(message);
collector.addError(new Throwable(message));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import org.knime.core.node.ExecutionMonitor;
import org.knime.core.node.InvalidSettingsException;
import org.knime.core.node.workflow.UnsupportedWorkflowVersionException;
import org.knime.core.node.workflow.WorkflowContext;
import org.knime.core.node.workflow.contextv2.WorkflowContextV2;
import org.knime.core.node.workflow.WorkflowLoadHelper;
import org.knime.core.node.workflow.WorkflowManager;
import org.knime.core.node.workflow.WorkflowPersistor.LoadResultEntry.LoadResultEntryType;
Expand Down Expand Up @@ -121,10 +121,8 @@ static WorkflowManager loadWorkflow(final WorkflowTest test, final ErrorCollecto
* {@inheritDoc}
*/
@Override
public WorkflowContext getWorkflowContext() {
WorkflowContext.Factory fac = new WorkflowContext.Factory(workflowDir);
fac.setMountpointRoot(testcaseRoot);
return fac.createContext();
public WorkflowContextV2 getWorkflowContext() {
return WorkflowContextV2.forTemporaryWorkflow(workflowDir.toPath(), null);
}
};

Expand Down
33 changes: 26 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>nl.esciencecenter.e3dchem.knime.testing</groupId>
<artifactId>nl.esciencecenter.e3dchem.knime.testing</artifactId>
<version>1.0.3-SNAPSHOT</version>
<version>1.0.4-SNAPSHOT</version>
<packaging>pom</packaging>

<scm>
Expand All @@ -18,22 +18,41 @@
<url>https://github.com/3D-e-Chem/knime-testflow/issues</url>
</issueManagement>
<ciManagement>
<system>Travis CI</system>
<url>http://travis-ci.org/3D-e-Chem/knime-testflow</url>
<system>GitHub Actions</system>
<url>https://github.com/3D-e-Chem/knime-testflow/actions</url>
</ciManagement>

<prerequisites>
<maven>3.0</maven>
</prerequisites>

<properties>
<tycho.version>1.4.0</tycho.version>
<tycho.extras.version>1.4.0</tycho.extras.version>
<tycho.version>2.7.5</tycho.version>
<tycho.extras.version>${tycho.version}</tycho.extras.version>
<tycho.test.jvmArgs>-Xmx512m</tycho.test.jvmArgs>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.version>0.8.10</jacoco.version>
<java.version>17</java.version>
<maven.compiler.version>3.10.1</maven.compiler.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<tycho.scmUrl>scm:git:https://github.com/3D-e-Chem/knime-testflow.git</tycho.scmUrl>
<target.file>KNIME-AP-4.0</target.file>
<knime.version>5.1</knime.version>
<target.file>KNIME-AP-${knime.version}</target.file>
<!-- following required if running mvn from JDK17 -->
<knime.ini.testArgs>--add-opens=java.security.jgss/sun.security.jgss.krb5=ALL-UNNAMED
--add-opens=java.base/sun.security.ssl=ALL-UNNAMED
--add-opens=java.base/sun.security.util=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/java.nio.channels=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens=java.base/sun.nio=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED
--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED
-Dmisc.io.testing=true</knime.ini.testArgs>
</properties>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="KNIME Analytics Platform (4.0)" sequenceNumber="1512743962">
<?pde version="3.8"?><target name="KNIME Analytics Platform (4.7)" sequenceNumber="1512743962">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.knime.features.explorer.serverspace.feature.group" version="0.0.0"/>
Expand All @@ -12,13 +12,13 @@
<unit id="org.knime.features.js.quickforms.feature.group" version="0.0.0"/>
<unit id="org.knime.features.json.feature.group" version="0.0.0"/>
<unit id="org.knime.features.personalproductivity.feature.group" version="0.0.0"/>
<unit id="org.knime.features.testingapplication.feature.group" version="0.0.0"/>
<unit id="org.knime.features.testing.application.feature.group" version="0.0.0"/>
<unit id="org.knime.features.xml.feature.group" version="0.0.0"/>
<unit id="org.knime.targetPlatform.feature.group" version="0.0.0"/>
<repository location="https://update.knime.org/analytics-platform/4.0/"/>
<repository location="https://update.knime.org/analytics-platform/4.7/"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<launcherArgs>
<vmArgs>-server
-Dsun.java2d.d3d=false
Expand Down
37 changes: 37 additions & 0 deletions targetplatform/KNIME-AP-5.1.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="KNIME Analytics Platform (5.1)" sequenceNumber="1512743962">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<!-- unit id="com.knime.features.explorer.serverspace.feature.group" version="0.0.0"/ -->
<unit id="org.knime.features.base.feature.group" version="0.0.0"/>
<unit id="org.knime.features.dbdrivers.feature.group" version="0.0.0"/>
<unit id="org.knime.features.ensembles.feature.group" version="0.0.0"/>
<unit id="org.knime.features.ext.itemset.feature.group" version="0.0.0"/>
<unit id="org.knime.features.ext.jep.feature.group" version="0.0.0"/>
<unit id="org.knime.features.ext.poi.feature.group" version="0.0.0"/>
<unit id="org.knime.features.js.quickforms.feature.group" version="0.0.0"/>
<unit id="org.knime.features.json.feature.group" version="0.0.0"/>
<unit id="org.knime.features.personalproductivity.feature.group" version="0.0.0"/>
<unit id="org.knime.features.testing.application.feature.group" version="0.0.0"/>
<unit id="org.knime.features.xml.feature.group" version="0.0.0"/>
<unit id="org.knime.targetPlatform.feature.group" version="0.0.0"/>
<repository location="https://update.knime.org/analytics-platform/5.1/"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<launcherArgs>
<vmArgs>-server
-Dsun.java2d.d3d=false
-Dosgi.classloader.lock=classname
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-XX:+UseG1GC
-ea
-Dorg.eclipse.swt.internal.gtk.cairoGraphics=false
-Dorg.eclipse.swt.internal.gtk.useCairo=false
-Dorg.eclipse.swt.browser.IEVersion=10001
-Dsun.awt.noerasebackground=true
-Dsun.net.client.defaultReadTimeout=0
-Dorg.eclipse.swt.internal.gtk.disablePrinting</vmArgs>
</launcherArgs>
</target>
2 changes: 1 addition & 1 deletion targetplatform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Contributors:
<parent>
<artifactId>nl.esciencecenter.e3dchem.knime.testing</artifactId>
<groupId>nl.esciencecenter.e3dchem.knime.testing</groupId>
<version>1.0.3-SNAPSHOT</version>
<version>1.0.4-SNAPSHOT</version>
</parent>

</project>
8 changes: 4 additions & 4 deletions tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests
Bundle-SymbolicName: nl.esciencecenter.e3dchem.knime.testing.tests
Bundle-Version: 1.0.3.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Version: 1.0.4.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.junit;bundle-version="4.12.0",
org.knime.core;bundle-version="[4.0.0,5.0.0)",
org.knime.base;bundle-version="[4.0.0,5.0.0)",
org.knime.core;bundle-version="[4.0.0,6.0.0)",
org.knime.base;bundle-version="[4.0.0,6.0.0)",
nl.esciencecenter.e3dchem.knime.testing.plugin
Bundle-Vendor: Your Name
Bundle-ClassPath: .
Expand Down
Loading

0 comments on commit 87eaaf0

Please sign in to comment.