mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-26 05:00:31 -05:00
Compare commits
3 Commits
dependabot
...
v0.9.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32ce62c0cd | ||
|
|
13bf5237e8 | ||
|
|
6060ca0129 |
@@ -19,7 +19,7 @@ import java.util.function.BiConsumer;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Helpers {
|
public class Helpers {
|
||||||
public static long FLOWS_COUNT = 65;
|
public static long FLOWS_COUNT = 66;
|
||||||
|
|
||||||
public static ApplicationContext applicationContext() throws URISyntaxException {
|
public static ApplicationContext applicationContext() throws URISyntaxException {
|
||||||
return applicationContext(
|
return applicationContext(
|
||||||
|
|||||||
6
core/src/test/resources/flows/valids/execution.yaml
Normal file
6
core/src/test/resources/flows/valids/execution.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
id: execution-start-date
|
||||||
|
namespace: io.kestra.tests
|
||||||
|
tasks:
|
||||||
|
- id: hello
|
||||||
|
type: io.kestra.core.tasks.debugs.Return
|
||||||
|
format: "{{ execution.startDate }}"
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
version=0.9.5
|
version=0.9.7
|
||||||
micronautVersion=3.9.0
|
micronautVersion=3.9.0
|
||||||
lombokVersion=1.18.26
|
lombokVersion=1.18.26
|
||||||
@@ -14,6 +14,9 @@ import java.time.ZonedDateTime;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
public abstract class JdbcMapper {
|
public abstract class JdbcMapper {
|
||||||
|
private static final DateTimeFormatter INSTANT_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||||
|
.withZone(ZoneOffset.UTC);
|
||||||
|
private static final DateTimeFormatter ZONED_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
||||||
private static ObjectMapper MAPPER;
|
private static ObjectMapper MAPPER;
|
||||||
|
|
||||||
public static ObjectMapper of() {
|
public static ObjectMapper of() {
|
||||||
@@ -24,19 +27,14 @@ public abstract class JdbcMapper {
|
|||||||
module.addSerializer(Instant.class, new JsonSerializer<>() {
|
module.addSerializer(Instant.class, new JsonSerializer<>() {
|
||||||
@Override
|
@Override
|
||||||
public void serialize(Instant instant, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
|
public void serialize(Instant instant, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
|
||||||
jsonGenerator.writeString(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
jsonGenerator.writeString(INSTANT_FORMATTER.format(instant));
|
||||||
.withZone(ZoneOffset.UTC)
|
|
||||||
.format(instant)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
module.addSerializer(ZonedDateTime.class, new JsonSerializer<>() {
|
module.addSerializer(ZonedDateTime.class, new JsonSerializer<>() {
|
||||||
@Override
|
@Override
|
||||||
public void serialize(ZonedDateTime instant, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
|
public void serialize(ZonedDateTime instant, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
|
||||||
jsonGenerator.writeString(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
|
jsonGenerator.writeString(ZONED_DATE_TIME_FORMATTER.format(instant));
|
||||||
.format(instant)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.hasSize;
|
import static org.hamcrest.Matchers.hasSize;
|
||||||
|
import static org.hamcrest.Matchers.matchesPattern;
|
||||||
|
|
||||||
@MicronautTest(transactional = false)
|
@MicronautTest(transactional = false)
|
||||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS) // must be per-class to allow calling once init() which took a lot of time
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS) // must be per-class to allow calling once init() which took a lot of time
|
||||||
@@ -240,4 +241,11 @@ public abstract class JdbcRunnerTest {
|
|||||||
public void pauseRunTimeout() throws Exception {
|
public void pauseRunTimeout() throws Exception {
|
||||||
pauseTest.runTimeout(runnerUtils);
|
pauseTest.runTimeout(runnerUtils);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void executionDate() throws TimeoutException {
|
||||||
|
Execution execution = runnerUtils.runOne("io.kestra.tests", "execution-start-date", null, null, Duration.ofSeconds(60));
|
||||||
|
|
||||||
|
assertThat((String) execution.getTaskRunList().get(0).getOutputs().get("value"), matchesPattern("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user