From 44b0d89c92b063884683f7f14734ada82b0c87e6 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Tue, 27 Jun 2023 01:03:05 -0700 Subject: [PATCH] tests and ci --- .github/workflows/intgtest.yml | 13 ++++++++++--- .../client/worker/WorkflowExecutionTests.java | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/intgtest.yml b/.github/workflows/intgtest.yml index bd3312bb..642420d8 100644 --- a/.github/workflows/intgtest.yml +++ b/.github/workflows/intgtest.yml @@ -1,6 +1,13 @@ -name: Integration Tests +name: CI -on: workflow_dispatch +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: jobs: integration-test: @@ -18,7 +25,7 @@ jobs: run: | hostname echo "host is $HOSTNAME" - ./gradlew clean test -x check + ./gradlew clean test env: SDK_INTEGRATION_TESTS_SERVER_API_URL: ${{ secrets.SDK_INTEGRATION_TESTS_SERVER_API_URL }} SDK_INTEGRATION_TESTS_SERVER_KEY_ID: ${{ secrets.SDK_INTEGRATION_TESTS_SERVER_KEY_ID }} diff --git a/src/test/java/io/orkes/conductor/client/worker/WorkflowExecutionTests.java b/src/test/java/io/orkes/conductor/client/worker/WorkflowExecutionTests.java index 75c0d75a..0e3bfdc2 100644 --- a/src/test/java/io/orkes/conductor/client/worker/WorkflowExecutionTests.java +++ b/src/test/java/io/orkes/conductor/client/worker/WorkflowExecutionTests.java @@ -16,7 +16,9 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; +import com.google.common.util.concurrent.Uninterruptibles; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -55,10 +57,10 @@ public void init() { @Test @DisplayName("Test workflow completion") public void workflow() throws Exception { - List workflowIds = startWorkflows(10, Commons.WORKFLOW_NAME); + List workflowIds = startWorkflows(2, Commons.WORKFLOW_NAME); workflowIds.add(startWorkflow(Commons.WORKFLOW_NAME)); this.taskRunnerConfigurer.init(); - Thread.sleep(7 * 1000); + Uninterruptibles.sleepUninterruptibly(10, TimeUnit.SECONDS); workflowIds.forEach(workflowId -> validateCompletedWorkflow(workflowId)); this.taskRunnerConfigurer.shutdown(); }