diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 342908b2ac3338cddbf74f805983c9dbeb7deb6a..3840a1f6b9ad80cfa7559d07be554668f604cdac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,12 +39,10 @@ include: file: "cloud-providers/gc-global.yml" - project: "osdu/platform/ci-cd-pipelines" - file: "cloud-providers/aws-global.yml" + file: "cloud-providers/ibm.yml" - - project: "osdu/platform/ci-cd-pipelines" - file: "cloud-providers/aws-maven.yml" + # aws + - local: "devops/aws/pipeline/override-stages.yml" - - project: "osdu/platform/ci-cd-pipelines" - file: "cloud-providers/ibm.yml" + - local: "devops/gc/pipeline/override-stages.yml" - - local: "devops/gc/pipeline/override-stages.yml" \ No newline at end of file diff --git a/devops/aws/pipeline/override-stages.yml b/devops/aws/pipeline/override-stages.yml new file mode 100644 index 0000000000000000000000000000000000000000..16fb9baf7e4788cbf4a6ad3f0d0cad54986633b0 --- /dev/null +++ b/devops/aws/pipeline/override-stages.yml @@ -0,0 +1,20 @@ +include: + - project: "osdu/platform/ci-cd-pipelines" + file: "cloud-providers/aws-global.yml" + - project: "osdu/platform/ci-cd-pipelines" + file: "cloud-providers/aws-global-variables.yml" + - project: "osdu/platform/ci-cd-pipelines" + file: "cloud-providers/aws-global.yml" + - project: "osdu/platform/ci-cd-pipelines" + file: "cloud-providers/aws-maven.yml" + +aws-test-java: + script: + - export KUBECONFIG=/tmp/kubeconfig-${RANDOM}.yaml + - echo "ROLE $EKS_CLUSTER_MGMT_ROLE" + - echo "CLUSTER $EKS_CLUSTER_NAME" + - aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER_NAME --role-arn $EKS_CLUSTER_MGMT_ROLE + - chmod 600 $KUBECONFIG + + - $MAVEN_BUILD $INTEGRATION_TEST_DIR maven-aws-integration-test-output.log ${AWS_MAVEN_TEST_COMMAND_OVERRIDE:-test} --update-snapshots -DdisableXmlReport=true + diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/LegalTagUtils.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/LegalTagUtils.java index 0860938624cb9568baf43ab8e6b3f010502d6c5a..43fc4e536ecb1349b78dad6af60039221b2417a2 100644 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/LegalTagUtils.java +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/LegalTagUtils.java @@ -34,9 +34,6 @@ public class LegalTagUtils { protected static String getLegalUrl() { String legalUrl = System.getProperty("LEGAL_URL", System.getenv("LEGAL_URL")); - if (legalUrl == null || legalUrl.contains("-null")) { - legalUrl = "https://os-legal-dot-opendes.appspot.com/api/legal/v1/"; - } return legalUrl; } diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/RecordUtils.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/RecordUtils.java index adef2dece6f330791b0903c877a2d1a1c9f793ef..4c7516521b60be54f03de9e533b9912c397c3a84 100644 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/RecordUtils.java +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/RecordUtils.java @@ -77,16 +77,7 @@ public class RecordUtils { } public static String getAclSuffix(boolean isTestPartition) { - String environment = getEnvironment(); - //build.gradle currently throws exception if a variable is set to empty or not set at all - //workaround by setting it to an "empty" string to construct the url - if (!environment.isEmpty()) - environment = "." + environment; - - return String.format("%s%s.%s", TenantUtils.getTenantName(isTestPartition), environment, domain); + return String.format("%s.%s", TenantUtils.getTenantName(isTestPartition), domain); } - public static String getEnvironment() { - return System.getProperty("DEPLOY_ENV", System.getenv("DEPLOY_ENV")); - } } diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/StorageTestUtils.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/StorageTestUtils.java index befe028631c6ef0054f7308ea5773902e668b1b6..fd7a216d0a7b19ea6265eab24b2610e9b8b5895c 100644 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/StorageTestUtils.java +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/StorageTestUtils.java @@ -54,9 +54,6 @@ public class StorageTestUtils { public static String getApiPath(String api) throws Exception { String baseUrl = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")); - if (baseUrl == null || baseUrl.contains("-null")) { - baseUrl = "https://localhost:8443/api/storage/v2/"; - } URL mergedURL = new URL(baseUrl + api); System.out.println(mergedURL.toString()); return mergedURL.toString(); diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/TestNotificationsEndpoint.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/TestNotificationsEndpoint.java index 1da461784b5bc7b7513d4478e3c742d507d3b9ee..1809604630695c38de96bfc095eee2d7a7f1b75a 100644 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/TestNotificationsEndpoint.java +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/TestNotificationsEndpoint.java @@ -112,12 +112,14 @@ public class TestNotificationsEndpoint extends TestBase { //Run Bash File to fetch logs from register endpoint and verify that notification was received String bashFileToExecute = "src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh " + correlationId; + Process process = Runtime.getRuntime().exec(bashFileToExecute); process.waitFor(); + int exitValue = process.exitValue(); assertEquals(exitValue, 0); } catch (Exception e) { - System.out.println("Error while verifying notification service. Error = " + e.getMessage() + " Stack Trace = " + Arrays.toString(e.getStackTrace())); + throw e; } finally { awssubscriptionService.delete(subscriptionId_TestPartition); } diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh old mode 100644 new mode 100755 index 6832babe4761f27a9da3d986bc1194f32af61979..bacda8d64af7d7f2aa14789f7e97b372158ad0b0 --- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh +++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/subscriptions/verify_register-logs.sh @@ -1,8 +1,9 @@ -register_pod=$(kubectl get pods --all-namespaces -o=jsonpath='{range .items..metadata}{.name}{"\n"}{end}' | fgrep os-register-) -register_logs=$(kubectl logs $register_pod -n osdu-instance-$OSDU_INSTANCE_NAME-core --since=2m) +CORE_K8S_NAMESPACE="$AWS_SERVICE_NAMESPACE-core" +register_pod=$(kubectl get pods -n $CORE_K8S_NAMESPACE | grep "Running" | grep "os-register" | awk '{ print $1 }') +register_logs=$(kubectl logs $register_pod -n $CORE_K8S_NAMESPACE --since=2m) if echo $register_logs | grep $1; then - return 0 + exit 0 else - return 1 -fi \ No newline at end of file + exit 1 +fi