GH-370: Enable ScriptProcessor tests back (#419)
* GH-370: Enable ScriptProcessor tests back Fixes https://github.com/spring-cloud/stream-applications/issues/370 * Update dependencies for `script-processor` * Add `maven-surefire-plugin` to `script-processor` POM and specify `--add-opens` for Ruby requirements * Mark all JavaScript tests with `@EnabledIfSystemProperty` against `org.graalvm.language.js.home` which is available only if GraalVM with `js` component enabled * Fix `NewlineAtEndOfFile` rule for Checkstyle since on Windows the line end is `crlf` * Add `components: 'js'` to GraalVM installation steps for all the GH action scripts * * Add dependencies for `graal-sdk` and `org.graalvm.js` to make JavaScript working on a plain JVM
This commit is contained in:
2
.github/workflows/ci-pr.yml
vendored
2
.github/workflows/ci-pr.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
with:
|
||||
version: 'latest'
|
||||
java-version: '17'
|
||||
# components: 'native-image' # add when starting native builds.
|
||||
components: 'js'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: 'Configure: cache for maven dependencies'
|
||||
uses: actions/cache@v3
|
||||
|
||||
10
.github/workflows/common.yml
vendored
10
.github/workflows/common.yml
vendored
@@ -186,7 +186,7 @@ jobs:
|
||||
with:
|
||||
version: 'latest'
|
||||
java-version: ${{ needs.parameters.outputs.jdk_build }}
|
||||
# components: 'native-image' # add when starting native builds.
|
||||
components: 'js'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: 'Configure: cache for maven dependencies'
|
||||
uses: actions/cache@v3
|
||||
@@ -277,7 +277,7 @@ jobs:
|
||||
with:
|
||||
version: 'latest'
|
||||
java-version: ${{ needs.parameters.outputs.jdk_build }}
|
||||
# components: 'native-image' # add when starting native builds.
|
||||
components: 'js'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: 'Configure: cache for maven dependencies'
|
||||
uses: actions/cache@v3
|
||||
@@ -357,7 +357,7 @@ jobs:
|
||||
with:
|
||||
version: 'latest'
|
||||
java-version: ${{ needs.parameters.outputs.jdk_build }}
|
||||
# components: 'native-image' # add when starting native builds.
|
||||
components: 'js'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: 'Configure: cache for maven dependencies'
|
||||
uses: actions/cache@v3
|
||||
@@ -437,7 +437,7 @@ jobs:
|
||||
with:
|
||||
version: 'latest'
|
||||
java-version: ${{ needs.parameters.outputs.jdk_build }}
|
||||
# components: 'native-image' # add when starting native builds.
|
||||
components: 'js'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: 'Configure: cache for maven dependencies'
|
||||
uses: actions/cache@v3
|
||||
@@ -514,7 +514,7 @@ jobs:
|
||||
with:
|
||||
version: 'latest'
|
||||
java-version: ${{ needs.parameters.outputs.jdk_build }}
|
||||
# components: 'native-image' # add when starting native builds.
|
||||
components: 'js'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: 'Configure: cache for maven dependencies'
|
||||
uses: actions/cache@v3
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<jruby-complete.version>9.0.5.0</jruby-complete.version>
|
||||
<jython-standalone.version>2.7.2</jython-standalone.version>
|
||||
<jruby-complete.version>9.3.9.0</jruby-complete.version>
|
||||
<jython-standalone.version>2.7.3</jython-standalone.version>
|
||||
<apache-ivy.version>2.5.1</apache-ivy.version>
|
||||
<graalvm.version>22.3.0</graalvm.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -26,6 +27,17 @@
|
||||
<artifactId>spring-integration-groovy</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.graalvm.sdk</groupId>
|
||||
<artifactId>graal-sdk</artifactId>
|
||||
<version>${graalvm.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.graalvm.js</groupId>
|
||||
<artifactId>js</artifactId>
|
||||
<version>${graalvm.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.groovy</groupId>
|
||||
<artifactId>groovy-json</artifactId>
|
||||
@@ -78,6 +90,17 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<argLine>
|
||||
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
|
||||
--add-opens java.base/java.io=ALL-UNNAMED
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2022 the original author or authors.
|
||||
* Copyright 2015-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,7 +19,6 @@ package org.springframework.cloud.stream.app.processor.script;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
@@ -46,7 +45,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class ScriptProcessorIntegrationTests {
|
||||
|
||||
@Disabled
|
||||
@Test
|
||||
public void testJavascriptFunctions() throws IOException {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
@@ -68,7 +66,6 @@ public class ScriptProcessorIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled
|
||||
@Test
|
||||
public void testJavascriptVariableTake1() {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
@@ -88,7 +85,6 @@ public class ScriptProcessorIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled
|
||||
@Test
|
||||
public void testJavascriptVariableTake2() {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
@@ -104,7 +100,7 @@ public class ScriptProcessorIntegrationTests {
|
||||
|
||||
processorInput.send(new GenericMessage<>(9));
|
||||
Message<byte[]> sourceMessage = processorOutput.receive(10000, "scriptProcessorFunction-out-0");
|
||||
assertThat(new String(sourceMessage.getPayload())).isEqualTo("45.0");
|
||||
assertThat(new String(sourceMessage.getPayload())).isEqualTo("45");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +142,6 @@ public class ScriptProcessorIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled
|
||||
@Test
|
||||
public void testRubyScript() {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
@@ -165,7 +160,6 @@ public class ScriptProcessorIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled
|
||||
@Test
|
||||
public void testRubyScriptComplex() {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
@@ -220,7 +214,6 @@ public class ScriptProcessorIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled
|
||||
@Test
|
||||
public void testGroovyToJavascript() {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(
|
||||
@@ -241,7 +234,8 @@ public class ScriptProcessorIntegrationTests {
|
||||
}
|
||||
|
||||
@EnableAutoConfiguration
|
||||
@Import({ScriptProcessorConfiguration.class})
|
||||
@Import(ScriptProcessorConfiguration.class)
|
||||
public static class ScriptProcessorTestConfiguration {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
<property name="headerFile" value="${checkstyle.header.file}"/>
|
||||
<property name="fileExtensions" value="java,groovy"/>
|
||||
</module>
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck">
|
||||
<property name="lineSeparator" value="lf"/>
|
||||
</module>
|
||||
|
||||
<module name="NewlineAtEndOfFile"/>
|
||||
|
||||
<!-- TreeWalker Checks -->
|
||||
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
|
||||
|
||||
Reference in New Issue
Block a user