diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 621fb56a..26ec7f97 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,4 +44,5 @@ jobs: with: skip-test: ${{ github.event.inputs.skip-test == 'true' }} kestra-version: ${{ github.event.inputs.kestra-version }} + java-version: '25' secrets: inherit diff --git a/build.gradle b/build.gradle index 5fdcf52b..425807ea 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ repositories { } } -final targetJavaVersion = JavaVersion.VERSION_21 +final targetJavaVersion = JavaVersion.VERSION_25 java { sourceCompatibility = targetJavaVersion @@ -91,6 +91,7 @@ dependencies { testImplementation group: "io.kestra", name: "repository-memory", version: kestraVersion testImplementation group: "io.kestra", name: "runner-memory", version: kestraVersion testImplementation group: "io.kestra", name: "storage-local", version: kestraVersion + testImplementation group: "io.kestra", name: "indexer", version: kestraVersion // test testImplementation "org.junit.jupiter:junit-jupiter-engine" diff --git a/gradle.properties b/gradle.properties index 60c246ab..f201de5a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ version=1.0.0-SNAPSHOT -kestraVersion=1.2.5 +kestraVersion=2.0.0-SNAPSHOT diff --git a/src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java b/src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java index e3e6cfa1..f6d2eb15 100644 --- a/src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java +++ b/src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java @@ -1,7 +1,11 @@ package io.kestra.plugin.templates; +import io.kestra.core.exceptions.InternalException; import io.kestra.core.junit.annotations.ExecuteFlow; import io.kestra.core.junit.annotations.KestraTest; +import io.kestra.core.runners.RunContextFactory; +import io.kestra.core.services.TaskOutputService; +import jakarta.inject.Inject; import org.junit.jupiter.api.Test; import io.kestra.core.models.executions.Execution; @@ -17,10 +21,13 @@ */ @KestraTest(startRunner = true) // This annotation starts an embedded Kestra for tests class ExampleRunnerTest { + @Inject + private TaskOutputService taskOutputService; + @Test @ExecuteFlow("flows/example.yaml") - void flow(Execution execution) { + void flow(Execution execution) throws InternalException { assertThat(execution.getTaskRunList(), hasSize(3)); - assertThat(((Map)execution.getTaskRunList().get(2).getOutputs().get("child")).get("value"), is("task-id")); + assertThat(((Map) taskOutputService.getOutputs(execution.getTaskRunList().get(2)).get("child")).get("value"), is("task-id")); } } diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 636ef672..919190e4 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -7,3 +7,9 @@ kestra: type: local local: base-path: /tmp/unittest + worker: + controllers: + type: STATIC + static: + endpoints: + - host: localhost