Commit 0c689863 authored by Mikhail Piatliou (EPAM)'s avatar Mikhail Piatliou (EPAM) Committed by Oleksandr Kosse (EPAM)
Browse files

Configure integration tests for notification service (GONRG-1104)

parent 191b303b
......@@ -21,8 +21,10 @@
# OSDU_GCP_SERVICE_ACCOUNT
# OSDU_GCP_INTEGRATION_TESTER
# OSDU_GCP_NO_DATA_ACCESS_TESTER
.osdu-gcp-variables:
variables:
# services' urls
OSDU_GCP_STORAGE_HOSTNAME: os-storage-attcrcktoa-uc.a.run.app
OSDU_GCP_LEGALTAG_API: https://os-legal-attcrcktoa-uc.a.run.app/api/legal/v1
OSDU_GCP_CRS_API: https://os-crs-converter-gae-dot-nice-etching-277309.appspot.com/api/crs/v2
......@@ -81,15 +83,17 @@
CRON_JOB_EXPECTED_IP: 0:0:0:0:0:0:0:1
SUBSCRIBER_PRIVATE_KEY_ID: $OSDU_GCP_SUBSCRIBER_PRIVATE_KEY_ID
SUBSCRIBER_SECRET: $OSDU_GCP_SUBSCRIBER_SECRET
DE_OPS_TESTER: $OSDU_GCP_R3_OPS_TESTER
DE_ADMIN_TESTER: $OSDU_GCP_R3_ADMIN_TESTER
DE_EDITOR_TESTER: $OSDU_GCP_R3_EDITOR_TESTER
DE_NO_ACCESS_TESTER: $OSDU_GCP_R3_NO_ACCESS_TESTER
REGISTER_BASE_URL: https://os-register-attcrcktoa-uc.a.run.app/
CLIENT_TENANT: nonexistenttenant
OSDU_TENANT: osdu
SUBSCRIPTION_ID: $OSDU_GCP_REGISTER_SUBSCRIPTION_ID
REGISTER_CUSTOM_PUSH_URL: https://os-register-attcrcktoa-uc.a.run.app/api/register/v1/test/challenge/1
CLIENT_TENANT: nonexistenttenant
OSDU_TENANT: osdu
REGISTER_BASE_URL: https://os-register-attcrcktoa-uc.a.run.app/
# variables for notification tests
HMAC_SECRET: $OSDU_GCP_SUBSCRIBER_SECRET
REGISTER_CUSTOM_PUSH_URL_HMAC: https://os-register-attcrcktoa-uc.a.run.app/api/register/v1/test/challenge/hmac-integration-test
ENVIRONMENT: DEV_GKE
TOPIC_ID: records-changed
NOTIFICATION_BASE_URL: $OSDU_GCP_NOTIFICATION_URL
# variables for legal tests
MY_TENANT_PROJECT: osdu
MY_TENANT: osdu
......@@ -98,10 +102,10 @@
osdu-gcp-containerize:
stage: containerize
needs: [ "compile-and-unit-test" ]
needs: ["compile-and-unit-test"]
extends: .osdu-gcp-variables
image: google/cloud-sdk
cache: { }
cache: {}
script:
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
- gcloud config set project $OSDU_GCP_PROJECT
......@@ -113,14 +117,24 @@ osdu-gcp-containerize:
osdu-gcp-deploy:
image: google/cloud-sdk
needs: [ "osdu-gcp-containerize" ]
needs: ["osdu-gcp-containerize"]
stage: deploy
extends: .osdu-gcp-variables
cache: { }
cache: {}
script:
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
- gcloud config set project $OSDU_GCP_PROJECT
- gcloud run deploy $OSDU_GCP_APPLICATION_NAME --image gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_SERVICE-$OSDU_GCP_VENDOR:$CI_COMMIT_SHORT_SHA --platform managed --region $OSDU_GCP_CLOUDRUN_REGION --allow-unauthenticated --service-account $OSDU_GCP_SERVICE_ACCOUNT --memory 512M --set-env-vars=$OSDU_GCP_ENV_VARS
- >
gcloud beta run deploy
$OSDU_GCP_APPLICATION_NAME
--image gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_SERVICE-$OSDU_GCP_VENDOR:$CI_COMMIT_SHORT_SHA
--platform managed
--region $OSDU_GCP_CLOUDRUN_REGION
--allow-unauthenticated
--service-account $OSDU_GCP_SERVICE_ACCOUNT
--memory 512M
$OSDU_GCP_CLOUD_RUN_PARAMETERS
--set-env-vars=$OSDU_GCP_ENV_VARS
- gcloud run services update-traffic $OSDU_GCP_APPLICATION_NAME --platform managed --region $OSDU_GCP_CLOUDRUN_REGION --to-latest
only:
variables:
......@@ -132,7 +146,7 @@ osdu-gcp-test:
- .osdu-gcp-variables
- .maven
stage: integration
needs: [ "osdu-gcp-deploy" ]
needs: ["osdu-gcp-deploy"]
allow_failure: true
variables:
WORKFLOW_HOST: $OSDU_GCP_WORKFLOW_SERVICE_URL
......@@ -142,6 +156,10 @@ osdu-gcp-test:
DELIVERY_HOST: $OSDU_GCP_DELIVERY_SERVICE_URL
SEARCH_HOST: $OSDU_GCP_SEARCH_HOST
STORAGE_HOST: $OSDU_GCP_STORAGE_URL
DE_OPS_TESTER: $OSDU_GCP_R3_OPS_TESTER
DE_ADMIN_TESTER: $OSDU_GCP_R3_ADMIN_TESTER
DE_EDITOR_TESTER: $OSDU_GCP_R3_EDITOR_TESTER
DE_NO_ACCESS_TESTER: $OSDU_GCP_R3_NO_ACCESS_TESTER
STORAGE_URL: $OSDU_GCP_STORAGE_URL
DEPLOY_ENV: empty
LEGAL_URL: $OSDU_GCP_LEGAL_HOST_URL
......@@ -153,13 +171,13 @@ osdu-gcp-test:
script:
- export GCP_DEPLOY_FILE=$(echo $OSDU_GCP_DEPLOY_FILE)
- >
mvn
--batch-mode
--settings=$CI_PROJECT_DIR/.mvn/community-maven.settings.xml
-f testing/pom.xml
verify
--projects $OSDU_GCP_SERVICE-test-core,$OSDU_GCP_SERVICE-test-gcp
2>&1 | tee test-results.log
mvn
--batch-mode
--settings=$CI_PROJECT_DIR/.mvn/community-maven.settings.xml
-f testing/pom.xml
verify
--projects $OSDU_GCP_SERVICE-test-core,$OSDU_GCP_SERVICE-test-gcp
2>&1 | tee test-results.log
only:
variables:
- $OSDU_GCP == 'true' && $OSDU_GCP_INT_TEST_TYPE != 'python'
......@@ -179,7 +197,7 @@ osdu-gcp-test-python:
MY_TENANT: osdu
stage: integration
image: python:3.7
needs: [ "osdu-gcp-deploy" ]
needs: ["osdu-gcp-deploy"]
allow_failure: false
script:
- cd testing/unit_test_gcp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment