Skip to content
Snippets Groups Projects
Commit e128f4cf authored by Marc Burnie [AWS]'s avatar Marc Burnie [AWS]
Browse files

adding AWS acceptance test job definition and making corrections to documentation

parent 4c297849
No related branches found
No related tags found
2 merge requests!957adding AWS acceptance test job definition and making corrections to documentation,!952Acceptance Testing for the One CI/CD Pipeline (New module)
......@@ -37,6 +37,7 @@ build/
### Integration tests ###
.gradle
**/allure-results/
### Environment Configuration ###
*.env
......
......@@ -34,6 +34,7 @@ variables:
IBM_HELM_DEPLOY_PATH: devops/ibm/ibm-storage-deploy
CORE_BUILD_SUBDIR: storage-core
ACCEPTANCE_TEST_DIR: "storage-acceptance-test"
CORE_COVERAGE_THRESHOLD: "80"
include:
- project: "osdu/platform/ci-cd-pipelines"
......@@ -253,15 +254,12 @@ core-acceptance-test:
needs: ["core-test"]
variables:
OPA_INTEGRATION_ENABLED: "true"
CORE_TESTING_DIR: "storage-acceptance-test"
CORE_TEST_PROJECT: "storage-acceptance-test"
CORE_TEST_SUBDIR: "storage-acceptance-test"
script:
- >
$MAVEN_BUILD . test-results.log
verify -DdisableXmlReport=true
--quiet
--file $CORE_TESTING_DIR/pom.xml
--file $ACCEPTANCE_TEST_DIR/pom.xml
--update-snapshots
aws-acceptance-test:
......@@ -277,9 +275,25 @@ aws-acceptance-test:
- !reference [.maven, before_script]
- !reference [.aws, before_script]
- !reference [.aws_variables, before_script]
variables:
OPA_INTEGRATION_ENABLED: "true"
script:
- echo "This job is expected to fail"
- exit 1
- export GROUP_ID=$DOMAIN
- export COGNITO_AUTH_TOKEN_URI=$(aws ssm get-parameter --name "/osdu/cognito/${COGNITO_NAME}/oauth/token-uri" --query Parameter.Value --output text --region $AWS_REGION)
- export COGNITO_ALLOWED_SCOPES=$(aws ssm get-parameter --name "/osdu/cognito/${COGNITO_NAME}/oauth/allowed-scopes" --query Parameter.Value --output text --region $AWS_REGION)
- export AWS_CLIENT_CREDENTIALS_CLIENT_ID=$(aws ssm get-parameter --name "/osdu/cognito/${COGNITO_NAME}/client/client-credentials/id" --query Parameter.Value --output text --region $AWS_REGION)
- export AWS_CLIENT_CREDENTIALS_CLIENT_SECRET=$(aws secretsmanager get-secret-value --secret-id /osdu/cognito/${COGNITO_NAME}/client-credentials-secret --query SecretString --output json --region $AWS_REGION | sed -e 's/\\\"/\"/g' -e 's/^.//g' -e 's/.$//g' | jq -r '.client_credentials_client_secret')
- export AWS_SERVICE_PRINCIPAL_AUTHORIZATION=$(echo -n "${AWS_CLIENT_CREDENTIALS_CLIENT_ID}:${AWS_CLIENT_CREDENTIALS_CLIENT_SECRET}" | base64)
- export INTEGRATION_TESTER_TOKEN=$(aws cognito-idp initiate-auth --region ${AWS_REGION} --auth-flow ${AWS_COGNITO_AUTH_FLOW} --client-id ${AWS_COGNITO_CLIENT_ID} --auth-parameters USERNAME=${AWS_COGNITO_AUTH_PARAMS_USER},PASSWORD=${AWS_COGNITO_AUTH_PARAMS_PASSWORD} --query AuthenticationResult.AccessToken --output text)
- export DATA_ROOT_TOKEN=$(curl --location ${COGNITO_AUTH_TOKEN_URI} --header "Content-Type:application/x-www-form-urlencoded" --header "Authorization:Basic ${AWS_SERVICE_PRINCIPAL_AUTHORIZATION}" --data-urlencode "grant_type=client_credentials" --data-urlencode ${COGNITO_ALLOWED_SCOPES} --http1.1 | jq -r '.access_token')
- export NO_DATA_ACCESS_TOKEN=$(aws cognito-idp initiate-auth --region ${AWS_REGION} --auth-flow ${AWS_COGNITO_AUTH_FLOW} --client-id ${AWS_COGNITO_CLIENT_ID} --auth-parameters USERNAME=${AWS_COGNITO_AUTH_PARAMS_USER_NO_ACCESS},PASSWORD=${AWS_COGNITO_AUTH_PARAMS_PASSWORD} --query AuthenticationResult.AccessToken --output text)
- >
$MAVEN_BUILD . test-results.log
verify -DdisableXmlReport=true
--quiet
--file $ACCEPTANCE_TEST_DIR/pom.xml
--update-snapshots
allow_failure: true
only:
variables:
......
......@@ -5,7 +5,7 @@ You will need to have the following environment variables defined.
| name | value | description | sensitive? | source |
|---------------------------|------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|------------|--------------------------------------------------------------|
| `GROUP_ID` | ex`opendes-gc.projects.com` | OSDU R2 to run tests under | no | - |
| `LEGAL_URL` | ex`http://localhsot:8080/api/legal/v1/` | Legal API endpoint | no | - |
| `LEGAL_URL` | ex`http://localhost:8080/api/legal/v1/` | Legal API endpoint | no | - |
| `STORAGE_URL` | ex`http://localhost:8080/api/storage/v2/` | Endpoint of storage service | no | - |
| `TENANT_NAME` | ex `opendes` | OSDU tenant used for testing | no | -- |
| `ENTITLEMENTS_URL` | ex`http://localhost:8080/api/entitlements/v2/` | Endpoint of entitlements service | no | - |
......@@ -36,7 +36,7 @@ Feature testing is controlled with the following environment variables:
| name | value | description |
|---------------------------|-------------------|---------------------------------------------------------------------------|
| `TEST_REPLAY_ENABLED` | `true` OR `false` | Controls Replay API tests. |
| `COLABORATION_ENABLED` | `true` OR `false` | Controls collaboration feature tests. |
| `COLLABORATION_ENABLED` | `true` OR `false` | Controls collaboration feature tests. |
| `OPA_INTEGRATION_ENABLED` | `true` OR `false` | Used to adjust assertions if integration with OPA\Policy enabled\disabled |
......@@ -62,7 +62,7 @@ Execute following command to build code and run all the integration tests:
# Note: this assumes that the environment variables for integration tests as outlined
# above are already exported in your environment.
# build + install integration test core
$ (cd testing/storage-test-core/ && mvn clean test)
$ (cd storage-acceptance-test && mvn clean test)
```
## License
......
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