From 76e215c70db17eaeef893a4d46cfb93e43f183e2 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 10 Jan 2024 06:18:05 +0400 Subject: [PATCH] sb3 --- archive/build.gradle | 6 +-- .../PostgresArchiveDAOConfiguration.java | 2 +- build.gradle | 32 ++++++------- gradle/wrapper/gradle-wrapper.properties | 4 +- persistence/build.gradle | 4 +- run_tests.sh | 2 +- server/build.gradle | 44 +++++++++++------- .../conductor/OrkesConductorApplication.java | 3 +- .../config/SecurityDisabledConfig.java | 28 ------------ .../conductor/rest/WorkflowResourceSync.java | 3 +- .../src/main/resources/application.properties | 1 + server/src/main/resources/banner.txt | 8 ---- server/src/main/resources/logback-spring.xml | 2 +- .../client/e2e/AbstractConductorTest.java | 45 ++++++++++++------- .../client/e2e/ConductorStartupTest.java | 17 +++++-- .../client/e2e/DynamicForkOptionalTests.java | 13 +----- .../client/e2e/FailureWorkflowTests.java | 8 ---- .../conductor/client/e2e/HttpWorkerTests.java | 3 -- .../conductor/client/e2e/JSONJQTests.java | 5 +-- .../conductor/client/e2e/JavaSDKTests.java | 7 --- .../client/e2e/SubWorkflowInlineTests.java | 6 --- .../e2e/SubWorkflowTimeoutRetryTests.java | 10 +---- .../client/e2e/SubWorkflowVersionTests.java | 2 +- .../conductor/client/e2e/WaitTaskTest.java | 17 ++++--- .../client/e2e/WorkflowRetryTests.java | 6 --- .../conductor/client/e2e/util/Commons.java | 1 - 26 files changed, 116 insertions(+), 163 deletions(-) delete mode 100644 server/src/main/java/io/orkes/conductor/config/SecurityDisabledConfig.java diff --git a/archive/build.gradle b/archive/build.gradle index 1d7631f..f63b8f2 100644 --- a/archive/build.gradle +++ b/archive/build.gradle @@ -1,8 +1,8 @@ dependencies { - implementation "com.netflix.conductor:conductor-common:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-core:${versions.revConductor}" - implementation ("com.netflix.conductor:conductor-postgres-persistence:${versions.revConductor}") + implementation "org.conductoross:conductor-common:${versions.revConductor}" + implementation "org.conductoross:conductor-core:${versions.revConductor}" + implementation ("org.conductoross:conductor-postgres-persistence:${versions.revConductor}") implementation 'org.springframework.boot:spring-boot-starter' implementation 'org.springframework.boot:spring-boot-starter-data-jdbc' diff --git a/archive/src/main/java/io/orkes/conductor/dao/postgres/archive/PostgresArchiveDAOConfiguration.java b/archive/src/main/java/io/orkes/conductor/dao/postgres/archive/PostgresArchiveDAOConfiguration.java index e6ba455..67623e6 100644 --- a/archive/src/main/java/io/orkes/conductor/dao/postgres/archive/PostgresArchiveDAOConfiguration.java +++ b/archive/src/main/java/io/orkes/conductor/dao/postgres/archive/PostgresArchiveDAOConfiguration.java @@ -12,7 +12,6 @@ */ package io.orkes.conductor.dao.postgres.archive; -import javax.annotation.PostConstruct; import javax.sql.DataSource; import org.apache.logging.log4j.util.Strings; @@ -36,6 +35,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; +import jakarta.annotation.PostConstruct; import lombok.extern.slf4j.Slf4j; @Slf4j diff --git a/build.gradle b/build.gradle index 0ca8296..0c3e828 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ buildscript { dependencies { - classpath "org.springframework.boot:spring-boot-gradle-plugin:2.5.15" + classpath 'org.springframework.boot:spring-boot-gradle-plugin:3.1.4' classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.+' } } plugins { - id 'io.spring.dependency-management' version '1.0.11.RELEASE' + id 'io.spring.dependency-management' version '1.0.13.RELEASE' } ext { @@ -15,7 +15,7 @@ ext { springBootVersion = '2.7.6' versions = [ - revConductor : '3.15.0', + revConductor : '3.16.0', revTestContainer : '1.17.2', revGuava : '32.0.0-jre', revLog4j : '2.17.1', @@ -75,28 +75,30 @@ subprojects { } } - dependencies { + + dependencies { implementation('net.minidev:json-smart') { version { strictly '2.4.10' } } - implementation 'com.amazonaws:aws-java-sdk-s3:1.12.548' - implementation "redis.clients:jedis:${versions.revJedis}" - - implementation "org.apache.logging.log4j:log4j-core:${versions.revLog4j}!!" - implementation "org.apache.logging.log4j:log4j-api:${versions.revLog4j}!!" - implementation "org.apache.logging.log4j:log4j-slf4j-impl:${versions.revLog4j}!!" - implementation "org.apache.logging.log4j:log4j-jul:${versions.revLog4j}!!" - implementation "org.apache.logging.log4j:log4j-web:${versions.revLog4j}!!" - implementation "org.apache.logging.log4j:log4j-to-slf4j:${versions.revLog4j}!!" - + implementation('org.apache.logging.log4j:log4j-core') + implementation('org.apache.logging.log4j:log4j-api') + implementation('org.apache.logging.log4j:log4j-slf4j-impl') + implementation('org.apache.logging.log4j:log4j-jul') + implementation('org.apache.logging.log4j:log4j-web') + annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' compileOnly "org.projectlombok:lombok:${versions.revLombok}" annotationProcessor "org.projectlombok:lombok:${versions.revLombok}" - testAnnotationProcessor "org.projectlombok:lombok:${versions.revLombok}" implementation "org.apache.commons:commons-lang3:${versions.revCommonsLang}" + + testImplementation('org.springframework.boot:spring-boot-starter-test') + testImplementation('org.springframework.boot:spring-boot-starter-log4j2') + testAnnotationProcessor "org.projectlombok:lombok:${versions.revLombok}" + testImplementation 'junit:junit' + testImplementation "org.junit.vintage:junit-vintage-engine" } allprojects { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5925064..42ee1f5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=b586e04868a22fd817c8971330fec37e298f3242eb85c374181b12d637f80302 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionSha256Sum=a01b6587e15fe7ed120a0ee299c25982a1eee045abd6a9dd5e216b2f628ef9ac +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/persistence/build.gradle b/persistence/build.gradle index 0961126..0b82f27 100644 --- a/persistence/build.gradle +++ b/persistence/build.gradle @@ -2,8 +2,8 @@ dependencies { - implementation "com.netflix.conductor:conductor-common:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-core:${versions.revConductor}" + implementation "org.conductoross:conductor-common:${versions.revConductor}" + implementation "org.conductoross:conductor-core:${versions.revConductor}" compileOnly 'org.springframework.boot:spring-boot-starter' implementation "redis.clients:jedis:${versions.revJedis}" diff --git a/run_tests.sh b/run_tests.sh index 72ad715..862ec5d 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -3,7 +3,7 @@ docker build -f docker/DockerfileStandalone . -t conductor_test_container docker run -dit --name conductor_test_container -p 8899:8080 -p 4535:5000 -t conductor_test_container COUNTER=0 MAX_TIME=120 -while ! curl -s http://localhost:8899/api/metadata/workflow -o /dev/null +while ! curl -s http://localhost:8080/api/metadata/workflow -o /dev/null do echo "$(date) - still trying - since $COUNTER second, will wait for $MAX_TIME" sleep 1 diff --git a/server/build.gradle b/server/build.gradle index 53f3984..86cf102 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -6,21 +6,21 @@ jar { } dependencies { - implementation "com.netflix.conductor:conductor-common:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-core:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-redis-lock:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-grpc:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-rest:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-redis-concurrency-limit:${versions.revConductor}" - - implementation "com.netflix.conductor:conductor-http-task:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-awss3-storage:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-awssqs-event-queue:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-json-jq-task:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-amqp:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-nats:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-kafka:${versions.revConductor}" - implementation "com.netflix.conductor:conductor-metrics:${versions.revConductor}" + implementation "org.conductoross:conductor-common:${versions.revConductor}" + implementation "org.conductoross:conductor-core:${versions.revConductor}" + implementation "org.conductoross:conductor-redis-lock:${versions.revConductor}" + implementation "org.conductoross:conductor-grpc:${versions.revConductor}" + implementation "org.conductoross:conductor-rest:${versions.revConductor}" + implementation "org.conductoross:conductor-redis-concurrency-limit:${versions.revConductor}" + + implementation "org.conductoross:conductor-http-task:${versions.revConductor}" + implementation "org.conductoross:conductor-awss3-storage:${versions.revConductor}" + implementation "org.conductoross:conductor-awssqs-event-queue:${versions.revConductor}" + implementation "org.conductoross:conductor-json-jq-task:${versions.revConductor}" + implementation "org.conductoross:conductor-amqp:${versions.revConductor}" + implementation "org.conductoross:conductor-nats:${versions.revConductor}" + implementation "org.conductoross:conductor-kafka:${versions.revConductor}" + implementation "org.conductoross:conductor-metrics:${versions.revConductor}" implementation "io.orkes.queues:orkes-conductor-queues:${versions.revOrkesQueues}" implementation project(":orkes-conductor-archive") @@ -35,6 +35,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.springframework.boot:spring-boot-actuator-autoconfigure' implementation 'org.springframework.boot:spring-boot-starter-data-jdbc' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-security' @@ -48,9 +49,20 @@ dependencies { runtimeOnly 'com.netflix.spectator:spectator-reg-micrometer' implementation "io.micrometer:micrometer-registry-prometheus:1.7.5" - implementation "io.micrometer:micrometer-core:1.8.0" + implementation "io.micrometer:micrometer-core:1.11.4" + + + +// implementation "com.netflix.spectator:spectator-reg-metrics3:${revSpectator}" +// implementation "com.netflix.spectator:spectator-reg-micrometer:${revSpectator}" +// implementation "io.prometheus:simpleclient:${revPrometheus}" +// implementation "io.micrometer:micrometer-registry-prometheus:${revMicrometer}" + + + implementation "com.jayway.jsonpath:json-path:${versions.revJsonPath}" + implementation "redis.clients:jedis:${versions.revJedis}" testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' diff --git a/server/src/main/java/io/orkes/conductor/OrkesConductorApplication.java b/server/src/main/java/io/orkes/conductor/OrkesConductorApplication.java index dfe77c2..a216a2f 100644 --- a/server/src/main/java/io/orkes/conductor/OrkesConductorApplication.java +++ b/server/src/main/java/io/orkes/conductor/OrkesConductorApplication.java @@ -19,8 +19,6 @@ import java.util.List; import java.util.Properties; -import javax.annotation.PostConstruct; - import org.apache.commons.lang3.StringUtils; import org.springdoc.core.customizers.OpenApiCustomiser; import org.springframework.beans.factory.annotation.Autowired; @@ -46,6 +44,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.servers.Server; +import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/server/src/main/java/io/orkes/conductor/config/SecurityDisabledConfig.java b/server/src/main/java/io/orkes/conductor/config/SecurityDisabledConfig.java deleted file mode 100644 index 4384f1e..0000000 --- a/server/src/main/java/io/orkes/conductor/config/SecurityDisabledConfig.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2022 Orkes, Inc. - *

- * Licensed under the Orkes Community License (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *

- * https://github.com/orkes-io/licenses/blob/main/community/LICENSE.txt - *

- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package io.orkes.conductor.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -public class SecurityDisabledConfig extends WebSecurityConfigurerAdapter { - - public SecurityDisabledConfig() { - super(true); // Disable defaults - } - - @Override - protected void configure(HttpSecurity http) throws Exception {} -} diff --git a/server/src/main/java/io/orkes/conductor/rest/WorkflowResourceSync.java b/server/src/main/java/io/orkes/conductor/rest/WorkflowResourceSync.java index be86452..1a5086e 100644 --- a/server/src/main/java/io/orkes/conductor/rest/WorkflowResourceSync.java +++ b/server/src/main/java/io/orkes/conductor/rest/WorkflowResourceSync.java @@ -15,8 +15,6 @@ import java.util.ArrayList; import java.util.concurrent.*; -import javax.annotation.PostConstruct; - import org.springframework.web.bind.annotation.*; import com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest; @@ -27,6 +25,7 @@ import com.google.common.util.concurrent.Uninterruptibles; import io.swagger.v3.oas.annotations.Operation; +import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; diff --git a/server/src/main/resources/application.properties b/server/src/main/resources/application.properties index ba5e3ec..f273525 100644 --- a/server/src/main/resources/application.properties +++ b/server/src/main/resources/application.properties @@ -66,6 +66,7 @@ conductor.app.taskOutputPayloadSizeThreshold=102400 conductor.app.taskInputPayloadSizeThreshold=102400 # Additional modules for metrics collection exposed to Datadog (optional) +management.datadog.metrics.export.enabled=false management.metrics.export.datadog.enabled=${conductor.metrics-datadog.enabled:false} management.metrics.export.datadog.api-key=${conductor.metrics-datadog.api-key:} diff --git a/server/src/main/resources/banner.txt b/server/src/main/resources/banner.txt index 8587db1..4375537 100644 --- a/server/src/main/resources/banner.txt +++ b/server/src/main/resources/banner.txt @@ -1,11 +1,4 @@ - ______ .______ __ ___ _______ _______. - / __ \ | _ \ | |/ / | ____| / | -| | | | | |_) | | ' / | |__ | (----` -| | | | | / | < | __| \ \ -| `--' | | |\ \----.| . \ | |____.----) | - \______/ | _| `._____||__|\__\ |_______|_______/ - ______ ______ .__ __. _______ __ __ ______ .___________. ______ .______ / | / __ \ | \ | | | \ | | | | / || | / __ \ | _ \ | ,----'| | | | | \| | | .--. || | | | | ,----'`---| |----`| | | | | |_) | @@ -13,4 +6,3 @@ | `----.| `--' | | |\ | | '--' || `--' | | `----. | | | `--' | | |\ \----. \______| \______/ |__| \__| |_______/ \______/ \______| |__| \______/ | _| `._____| -Licensed under Orkes Conductor Community License diff --git a/server/src/main/resources/logback-spring.xml b/server/src/main/resources/logback-spring.xml index 667d859..8c7f890 100644 --- a/server/src/main/resources/logback-spring.xml +++ b/server/src/main/resources/logback-spring.xml @@ -5,7 +5,7 @@ class="ch.qos.logback.core.ConsoleAppender"> - %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable + %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1}): %msg%n%throwable diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/AbstractConductorTest.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/AbstractConductorTest.java index 15fd02f..837743a 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/AbstractConductorTest.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/AbstractConductorTest.java @@ -1,22 +1,37 @@ +/* + * Copyright 2024 Orkes, Inc. + *

+ * Licensed under the Orkes Community License (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + *

+ * https://github.com/orkes-io/licenses/blob/main/community/LICENSE.txt + *

+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ package io.orkes.conductor.client.e2e; -import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.List; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.testcontainers.containers.GenericContainer; + import com.netflix.conductor.common.config.ObjectMapperProvider; import com.netflix.conductor.common.metadata.workflow.WorkflowDef; import com.netflix.conductor.sdk.workflow.executor.WorkflowExecutor; + import io.orkes.conductor.client.ApiClient; import io.orkes.conductor.client.http.OrkesMetadataClient; import io.orkes.conductor.client.http.OrkesTaskClient; import io.orkes.conductor.client.http.OrkesWorkflowClient; + +import com.fasterxml.jackson.databind.ObjectMapper; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.testcontainers.containers.GenericContainer; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.List; @Slf4j public abstract class AbstractConductorTest { @@ -31,7 +46,10 @@ public abstract class AbstractConductorTest { protected static io.orkes.conductor.client.MetadataClient metadataClient; protected static WorkflowExecutor executor; - protected static final String[] workflows = new String[]{"/metadata/rerun.json", "/metadata/popminmax.json", "/metadata/fail.json"}; + protected static final String[] workflows = + new String[] { + "/metadata/rerun.json", "/metadata/popminmax.json", "/metadata/fail.json" + }; @SneakyThrows @BeforeAll @@ -46,7 +64,8 @@ public static final void setup() { for (String workflow : workflows) { InputStream resource = AbstractConductorTest.class.getResourceAsStream(workflow); - WorkflowDef workflowDef = objectMapper.readValue(new InputStreamReader(resource), WorkflowDef.class); + WorkflowDef workflowDef = + objectMapper.readValue(new InputStreamReader(resource), WorkflowDef.class); metadataClient.updateWorkflowDefs(List.of(workflowDef), true); } } @@ -55,10 +74,4 @@ public static final void setup() { public static void cleanup() { executor.shutdown(); } - - - - - } - diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/ConductorStartupTest.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/ConductorStartupTest.java index 5cc34cb..3bef638 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/ConductorStartupTest.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/ConductorStartupTest.java @@ -1,12 +1,21 @@ +/* + * Copyright 2024 Orkes, Inc. + *

+ * Licensed under the Orkes Community License (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + *

+ * https://github.com/orkes-io/licenses/blob/main/community/LICENSE.txt + *

+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ package io.orkes.conductor.client.e2e; import org.junit.jupiter.api.Test; public class ConductorStartupTest extends AbstractConductorTest { - @Test - public void test() { - - } + public void test() {} } diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/DynamicForkOptionalTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/DynamicForkOptionalTests.java index 7b2f085..ed51e11 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/DynamicForkOptionalTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/DynamicForkOptionalTests.java @@ -27,9 +27,6 @@ import com.netflix.conductor.common.run.Workflow; import io.orkes.conductor.client.*; -import io.orkes.conductor.client.http.OrkesMetadataClient; -import io.orkes.conductor.client.http.OrkesTaskClient; -import io.orkes.conductor.client.http.OrkesWorkflowClient; import io.orkes.conductor.client.model.*; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -71,12 +68,8 @@ public void testTaskDynamicForkOptional() { fanoutTasks.add(workflowTask); input.put("xdt" + i, Map.of("k1", "v1")); - } - - - Map output = new HashMap<>(); output.put("dynamicTasks", fanoutTasks); @@ -173,7 +166,6 @@ public void testTaskDynamicForkOptional() { metadataClient.unregisterWorkflowDef(workflowName1, 1); } - @Test public void testLargeFork() { @@ -208,7 +200,6 @@ public void testLargeFork() { fanoutTasks.add(workflowTask); input.put("xdt" + i, Map.of("k1", "v1")); - } Map output = new HashMap<>(); @@ -220,7 +211,7 @@ public void testLargeFork() { workflow = workflowClient.getWorkflow(workflowId, true); for (Task task : workflow.getTasks()) { - if(!task.getStatus().isTerminal()) { + if (!task.getStatus().isTerminal()) { taskResult = new TaskResult(); taskResult.setWorkflowInstanceId(workflowId); taskResult.setTaskId(task.getTaskId()); @@ -230,8 +221,6 @@ public void testLargeFork() { } workflow = workflowClient.getWorkflow(workflowId, true); System.out.println("workflow status: " + workflow.getStatus()); - - } @Test diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/FailureWorkflowTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/FailureWorkflowTests.java index b811b03..f6039a3 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/FailureWorkflowTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/FailureWorkflowTests.java @@ -15,8 +15,6 @@ import java.util.*; import java.util.concurrent.TimeUnit; -import com.netflix.conductor.common.metadata.tasks.Task; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -27,13 +25,7 @@ import com.netflix.conductor.common.metadata.workflow.WorkflowTask; import com.netflix.conductor.common.run.Workflow; -import io.orkes.conductor.client.ApiClient; import io.orkes.conductor.client.MetadataClient; -import io.orkes.conductor.client.TaskClient; -import io.orkes.conductor.client.WorkflowClient; -import io.orkes.conductor.client.http.OrkesMetadataClient; -import io.orkes.conductor.client.http.OrkesTaskClient; -import io.orkes.conductor.client.http.OrkesWorkflowClient; import lombok.extern.slf4j.Slf4j; diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/HttpWorkerTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/HttpWorkerTests.java index 6b59ccd..1785a5d 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/HttpWorkerTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/HttpWorkerTests.java @@ -16,7 +16,6 @@ import java.util.concurrent.TimeUnit; import org.junit.After; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import com.netflix.conductor.common.metadata.tasks.Task; @@ -27,8 +26,6 @@ import com.netflix.conductor.common.run.Workflow; import io.orkes.conductor.client.*; -import io.orkes.conductor.client.http.OrkesMetadataClient; -import io.orkes.conductor.client.http.OrkesWorkflowClient; import static org.junit.jupiter.api.Assertions.*; import static org.testcontainers.shaded.org.awaitility.Awaitility.await; diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/JSONJQTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/JSONJQTests.java index ed89585..8d33ca7 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/JSONJQTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/JSONJQTests.java @@ -25,16 +25,13 @@ import com.netflix.conductor.common.metadata.workflow.WorkflowTask; import com.netflix.conductor.common.run.Workflow; -import io.orkes.conductor.client.ApiClient; -import io.orkes.conductor.client.WorkflowClient; -import io.orkes.conductor.client.http.OrkesWorkflowClient; import io.orkes.conductor.client.e2e.util.Commons; import com.google.common.util.concurrent.Uninterruptibles; import static org.junit.jupiter.api.Assertions.assertEquals; -public class JSONJQTests extends AbstractConductorTest{ +public class JSONJQTests extends AbstractConductorTest { @Test public void testJQOutputIsReachableWhenSyncSystemTaskIsNext() { diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/JavaSDKTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/JavaSDKTests.java index a89ed9d..ac5b9b6 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/JavaSDKTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/JavaSDKTests.java @@ -24,19 +24,12 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.netflix.conductor.client.http.MetadataClient; -import com.netflix.conductor.client.http.TaskClient; -import com.netflix.conductor.client.http.WorkflowClient; import com.netflix.conductor.common.run.Workflow; import com.netflix.conductor.sdk.workflow.def.ConductorWorkflow; import com.netflix.conductor.sdk.workflow.def.tasks.SimpleTask; import com.netflix.conductor.sdk.workflow.def.tasks.Switch; -import com.netflix.conductor.sdk.workflow.executor.WorkflowExecutor; import com.netflix.conductor.sdk.workflow.task.WorkerTask; -import io.orkes.conductor.client.ApiClient; -import io.orkes.conductor.client.OrkesClients; - import static org.junit.jupiter.api.Assertions.*; public class JavaSDKTests extends AbstractConductorTest { diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowInlineTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowInlineTests.java index 7ce596f..b077efe 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowInlineTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowInlineTests.java @@ -28,13 +28,7 @@ import com.netflix.conductor.common.metadata.workflow.WorkflowTask; import com.netflix.conductor.common.run.Workflow; -import io.orkes.conductor.client.ApiClient; import io.orkes.conductor.client.MetadataClient; -import io.orkes.conductor.client.TaskClient; -import io.orkes.conductor.client.WorkflowClient; -import io.orkes.conductor.client.http.OrkesMetadataClient; -import io.orkes.conductor.client.http.OrkesTaskClient; -import io.orkes.conductor.client.http.OrkesWorkflowClient; import io.orkes.conductor.client.model.WorkflowStatus; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowTimeoutRetryTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowTimeoutRetryTests.java index c672d18..b75e943 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowTimeoutRetryTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowTimeoutRetryTests.java @@ -22,10 +22,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.netflix.conductor.client.http.MetadataClient; -import com.netflix.conductor.client.http.TaskClient; -import com.netflix.conductor.client.http.WorkflowClient; -import com.netflix.conductor.common.config.ObjectMapperProvider; import com.netflix.conductor.common.metadata.tasks.Task; import com.netflix.conductor.common.metadata.tasks.TaskResult; import com.netflix.conductor.common.metadata.tasks.TaskType; @@ -34,12 +30,9 @@ import com.netflix.conductor.common.metadata.workflow.WorkflowTask; import com.netflix.conductor.common.run.Workflow; -import io.orkes.conductor.client.AuthorizationClient; -import io.orkes.conductor.client.OrkesClients; import io.orkes.conductor.client.automator.TaskRunnerConfigurer; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.util.concurrent.Uninterruptibles; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -50,7 +43,8 @@ @Slf4j public class SubWorkflowTimeoutRetryTests extends AbstractConductorTest { - private static TypeReference> WORKFLOW_DEF_LIST = new TypeReference>() {}; + private static TypeReference> WORKFLOW_DEF_LIST = + new TypeReference>() {}; private static final String WORKFLOW_NAME = "integration_test_wf_with_sub_wf"; diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowVersionTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowVersionTests.java index 3c51c17..12d27ea 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowVersionTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/SubWorkflowVersionTests.java @@ -32,8 +32,8 @@ import com.netflix.conductor.common.run.Workflow; import io.orkes.conductor.client.*; -import io.orkes.conductor.client.model.*; import io.orkes.conductor.client.e2e.util.RegistrationUtil; +import io.orkes.conductor.client.model.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/WaitTaskTest.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/WaitTaskTest.java index 6575b51..b0c002f 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/WaitTaskTest.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/WaitTaskTest.java @@ -31,10 +31,9 @@ public class WaitTaskTest extends AbstractConductorTest { - - @Test - public void testWaitTimeout() throws ExecutionException, InterruptedException, TimeoutException { + public void testWaitTimeout() + throws ExecutionException, InterruptedException, TimeoutException { ConductorWorkflow> workflow = new ConductorWorkflow<>(executor); workflow.setName("wait_task_test"); workflow.setVersion(1); @@ -46,9 +45,15 @@ public void testWaitTimeout() throws ExecutionException, InterruptedException, assertNotNull(run); assertEquals(Workflow.WorkflowStatus.COMPLETED, run.getStatus()); assertEquals(1, run.getTasks().size()); - long timeToExecute = run.getTasks().get(0).getEndTime() - run.getTasks().get(0).getScheduledTime(); - System.out.println("Wait task completed in " + timeToExecute + " millis - should have completed in around 2 second mark"); + long timeToExecute = + run.getTasks().get(0).getEndTime() - run.getTasks().get(0).getScheduledTime(); + System.out.println( + "Wait task completed in " + + timeToExecute + + " millis - should have completed in around 2 second mark"); // Ensure the wait completes within 1sec buffer - assertTrue(timeToExecute < 3000, "Wait task did not complete in time, took " + timeToExecute + " millis"); + assertTrue( + timeToExecute < 3000, + "Wait task did not complete in time, took " + timeToExecute + " millis"); } } diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/WorkflowRetryTests.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/WorkflowRetryTests.java index c653b00..8db319c 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/WorkflowRetryTests.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/WorkflowRetryTests.java @@ -16,7 +16,6 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.testcontainers.shaded.com.google.common.util.concurrent.Uninterruptibles; import com.netflix.conductor.common.metadata.tasks.Task; import com.netflix.conductor.common.metadata.tasks.TaskResult; @@ -25,9 +24,6 @@ import com.netflix.conductor.common.run.Workflow; import com.netflix.conductor.common.run.WorkflowSummary; -import io.orkes.conductor.client.http.OrkesMetadataClient; -import io.orkes.conductor.client.http.OrkesTaskClient; -import io.orkes.conductor.client.http.OrkesWorkflowClient; import io.orkes.conductor.client.model.*; import lombok.extern.slf4j.Slf4j; @@ -272,6 +268,4 @@ private void terminateExistingRunningWorkflows(String workflowName) { } }); } - - } diff --git a/test-harness/src/test/java/io/orkes/conductor/client/e2e/util/Commons.java b/test-harness/src/test/java/io/orkes/conductor/client/e2e/util/Commons.java index 91e4841..6e33b69 100644 --- a/test-harness/src/test/java/io/orkes/conductor/client/e2e/util/Commons.java +++ b/test-harness/src/test/java/io/orkes/conductor/client/e2e/util/Commons.java @@ -21,7 +21,6 @@ public class Commons { public static String OWNER_EMAIL = "example@orkes.io"; public static int WORKFLOW_VERSION = 1; - public static TaskDef getTaskDef() { TaskDef taskDef = new TaskDef(); taskDef.setName(Commons.TASK_NAME);