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

Knime 5.1 Continuation #13

Merged
merged 24 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c264a1c
Update to JDK 16 and KNIME 4.0 - 6.0
sroughley Jul 18, 2023
39ca84e
Updated to allow 5.1 builds
sroughley Jul 18, 2023
a3bc298
Added extra test args to run from mvn in jdk17
sroughley Jul 18, 2023
02c77eb
Breaking surefire argLIne with newlines
sroughley Jul 18, 2023
a9280a5
Updated jacoco version
sroughley Jul 18, 2023
a43948a
Added jacoco excludes
sroughley Jul 18, 2023
6f09e2e
Corrected pom.xml
sroughley Jul 18, 2023
ba414e3
Another pom.xml correction
sroughley Jul 18, 2023
0b78c17
Completed jacoco version update
sroughley Jul 18, 2023
bb7e524
Yet more pom.xml corrections
sroughley Jul 18, 2023
205d94f
Allowed org.knime.workbench.repository v <6.0.0
sroughley Jul 18, 2023
57a4255
Updated for WorkflowContext changes KNIME 4.7 onwards
sroughley Jul 18, 2023
12b17e2
Added extra tequirements to tests pom.xml
sroughley Jul 18, 2023
cc93d61
Updated README and work towards multi-version builds
sroughley Jul 18, 2023
1c3fe6c
Reverted error in p2 pom.xml and associated error in README.md
sroughley Jul 18, 2023
90dc174
Extracted jacoco version to variable
sroughley Jul 18, 2023
07fa787
Updated version to 1.0.4 and updated changelog
sroughley Jul 18, 2023
f149eb0
Update node index
sverhoeven Nov 20, 2023
fce0672
Replace travis ci with github actions workflow
sverhoeven Nov 20, 2023
ff8f7d1
Default to KNIME 5.1 overridable to 4.7
sverhoeven Nov 20, 2023
a60b23b
Replace travis with gha some more
sverhoeven Nov 20, 2023
43cea58
Use latest maven-dependency-submission-action
sverhoeven Nov 20, 2023
8a82167
Replace codacy coverage report with GH actions
sverhoeven Nov 20, 2023
7b332d3
Less warnings during build
sverhoeven Nov 20, 2023
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
1 change: 1 addition & 0 deletions .github/badges/jacoco.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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

- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: tests/target/jacoco/report/jacoco.csv

- name: Commit and push the badge (if it changed)
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'commit badge'
add: '.github/badges/jacoco.svg'

- name: Upload JaCoCo coverage report
uses: actions/upload-artifact@v3
with:
name: jacoco-report
path: tests/target/jacoco/report/

# 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@v3
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
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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)
[![Java CI with Maven](https://github.com/3D-e-Chem/knime-testflow/actions/workflows/ci.yml/badge.svg)](https://github.com/3D-e-Chem/knime-testflow/actions/workflows/ci.yml)
![Coverage](.github/badges/jacoco.svg)
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.55805.svg)](http://dx.doi.org/10.5281/zenodo.55805)

The Knime Testing Framework can run a test workflow either:
Expand Down Expand Up @@ -34,12 +34,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 +83,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 +102,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
Loading