Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories {
}
}

final targetJavaVersion = JavaVersion.VERSION_21
final targetJavaVersion = JavaVersion.VERSION_25

java {
sourceCompatibility = targetJavaVersion
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=1.0.0-SNAPSHOT
kestraVersion=1.2.5
kestraVersion=2.0.0-SNAPSHOT
11 changes: 9 additions & 2 deletions src/test/java/io/kestra/plugin/templates/ExampleRunnerTest.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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<String, Object>)execution.getTaskRunList().get(2).getOutputs().get("child")).get("value"), is("task-id"));
assertThat(((Map<String, Object>) taskOutputService.getOutputs(execution.getTaskRunList().get(2)).get("child")).get("value"), is("task-id"));
}
}
6 changes: 6 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ kestra:
type: local
local:
base-path: /tmp/unittest
worker:
controllers:
type: STATIC
static:
endpoints:
- host: localhost
Loading