Skip to content
Snippets Groups Projects
Commit 1f0cee02 authored by Guillaume Caillet's avatar Guillaume Caillet
Browse files

AWS Fixing testVerifyNotificationReceived integration test

parent 538edae0
No related branches found
No related tags found
1 merge request!417AWS sync dev to master
Checking pipeline status
......@@ -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
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
......@@ -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;
}
......
......@@ -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"));
}
}
......@@ -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();
......
......@@ -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);
}
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment