-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLT-136 Run e2e tests on impl environment (#1283)
- Loading branch information
1 parent
bfc2a00
commit 18f6f82
Showing
4 changed files
with
93 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: end-to-end tests | ||
|
||
on: | ||
pull_request: | ||
workflow_call: | ||
workflow_dispatch: # Allow manual trigger | ||
|
||
# Ensure we have only one e2e test running at a time | ||
concurrency: | ||
group: e2e-test | ||
|
||
jobs: | ||
test: | ||
runs-on: self-hosted | ||
|
||
env: | ||
# Keystore location must be full path for spring framework | ||
AB2D_BFD_KEYSTORE_LOCATION: "${{ github.workspace }}/opt/ab2d/ab2d_bfd_keystore" | ||
AB2D_V2_ENABLED: 'true' | ||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Install Maven 3.6.3 | ||
run: | | ||
export PATH="$PATH:/opt/maven/bin" | ||
echo "PATH=$PATH" >> $GITHUB_ENV | ||
if mvn -v; then echo "Maven already installed" && exit 0; else echo "Installing Maven"; fi | ||
tmpdir="$(mktemp -d)" | ||
curl -LsS https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | tar xzf - -C "$tmpdir" | ||
sudo rm -rf /opt/maven | ||
sudo mv "$tmpdir/apache-maven-3.6.3" /opt/maven | ||
- name: Set env vars from AWS params in management account | ||
uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main | ||
env: | ||
AWS_REGION: ${{ vars.AWS_REGION }} | ||
with: | ||
params: | | ||
ARTIFACTORY_URL=/artifactory/url | ||
ARTIFACTORY_USER=/artifactory/user | ||
ARTIFACTORY_PASSWORD=/artifactory/password | ||
- name: Assume role in AB2D impl account | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: arn:aws:iam::${{ secrets.IMPL_ACCOUNT_ID }}:role/delegatedadmin/developer/ab2d-test-github-actions | ||
|
||
- name: Set env vars from AWS params in impl account | ||
uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main | ||
env: | ||
AWS_REGION: ${{ vars.AWS_REGION }} | ||
with: | ||
params: | | ||
AB2D_BFD_KEYSTORE_PASSWORD=/bfd/keystore-password | ||
OKTA_CLIENT_ID=/okta/test-pdp-100-id | ||
OKTA_CLIENT_PASSWORD=/okta/test-pdp-100-secret | ||
SECONDARY_USER_OKTA_CLIENT_ID=/okta/test-pdp-1000-id | ||
SECONDARY_USER_OKTA_CLIENT_PASSWORD=/okta/test-pdp-1000-secret | ||
- name: Create opt/ab2d directory and download keystore | ||
run: | | ||
mkdir -p opt/ab2d | ||
aws s3 cp s3://ab2d-east-impl-main/ab2d_imp_keystore $AB2D_BFD_KEYSTORE_LOCATION | ||
test -f $AB2D_BFD_KEYSTORE_LOCATION && echo "created keystore file" | ||
- name: Run e2e-bfd-test | ||
run: | | ||
mvn test -s settings.xml -pl e2e-bfd-test -am -Dtest=EndToEndBfdTests -DfailIfNoTests=false -Dusername=$ARTIFACTORY_USER -Dpassword=$ARTIFACTORY_PASSWORD -Drepository_url=$ARTIFACTORY_URL --no-transfer-progress | ||
- name: Run e2e-test | ||
env: | ||
E2E_ENVIRONMENT: 'IMPL' | ||
run: | | ||
mvn test -s settings.xml -pl e2e-test -am -Dtest=TestRunner -DfailIfNoTests=false -Dusername=$ARTIFACTORY_USER -Dpassword=$ARTIFACTORY_PASSWORD -Drepository_url=$ARTIFACTORY_URL --no-transfer-progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
okta-url: 'https://test.idp.idm.cms.gov/oauth2/aus2r7y3gdaFMKBol297/v1/token' | ||
base-url: 'https://internal-ab2d-east-impl-460119366.us-east-1.elb.amazonaws.com' | ||
base-url: 'https://impl.ab2d.cms.gov' |