DataRepo Staging Smoke Tests #553
Workflow file for this run
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
name: DataRepo Staging Smoke Tests | |
env: | |
K8_CLUSTER: jade-master-us-central1 | |
GOOGLE_APPLICATION_CREDENTIALS: /tmp/staging-test-runner.json | |
GOOGLE_CLOUD_PROJECT: terra-datarepo-staging | |
GOOGLE_CLOUD_DATA_PROJECT: terra-datarepo-staging-data | |
JADE_USER_EMAIL: [email protected] | |
TDR_LOG_APPENDER: Console-Standard | |
on: | |
workflow_dispatch: | |
inputs: | |
relates-to-chart-releases: | |
description: 'optional: Chart releases (chart instances) related to or affected by the calling workflow' | |
required: false | |
type: string | |
default: 'datarepo-staging' | |
notify-slack-channels-upon-workflow-completion: | |
description: 'optional: comma separated slack channel(s) to notify on completion' | |
required: false | |
type: string | |
default: '#dsde-qa' | |
jobs: | |
test-runner-staging: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout jade-data-repo" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: "Setup Java 17" | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: "Fetch current staging version from /configuration endpoint" | |
id: configuration | |
run: | | |
staging_version=$(curl -s -X GET "https://data.staging.envs-terra.bio/configuration" -H "accept: application/json" | jq -r '.semVer|rtrimstr("-SNAPSHOT")') | |
echo "staging_version=${staging_version}" >> $GITHUB_OUTPUT | |
echo "Staging Version: $staging_version" | |
- name: "Checkout tag for DataBiosphere/jade-data-repo" | |
if: github.ref == 'refs/heads/develop' | |
run: | | |
git checkout ${{ steps.configuration.outputs.staging_version }} | |
echo "Current branch is ${{ github.ref }}" | |
- name: "Perform IAM policy cleanup for staging" | |
run: | | |
# write token | |
base64 --decode <<< ${{ secrets.TEST_RUNNER_B64_CREDENTIALS }} > ${GOOGLE_APPLICATION_CREDENTIALS} | |
gcloud auth activate-service-account --key-file ${GOOGLE_APPLICATION_CREDENTIALS} | |
./tools/cleanupPolicies.sh ${GOOGLE_CLOUD_DATA_PROJECT} | |
- name: "Add jade-k8-sa credentials to run as Harry Potter test users" | |
env: | |
# note: hack to overwrite the env var to grab the dev credentials too | |
GOOGLE_APPLICATION_CREDENTIALS: /tmp/jade-dev-account.json | |
run: | | |
# write token | |
base64 --decode <<< ${{ secrets.SA_B64_CREDENTIALS }} > ${GOOGLE_APPLICATION_CREDENTIALS} | |
- name: "Build and run Test Runner" | |
run: | | |
cd ${GITHUB_WORKSPACE}/${workingDir} | |
echo "Building Data Repo client library" | |
export TEST_RUNNER_SERVER_SPECIFICATION_FILE="staging.json" | |
export TEST_RUNNER_BILLING_PROFILE_NAME="stest1" | |
ENABLE_SUBPROJECT_TASKS=1 ./gradlew :datarepo-client:clean :datarepo-client:assemble | |
cd ${GITHUB_WORKSPACE}/${workingDir}/datarepo-clienttests | |
export ORG_GRADLE_PROJECT_datarepoclientjar=$(find .. -type f -name "datarepo-client*.jar") | |
echo "ORG_GRADLE_PROJECT_datarepoclientjar = ${ORG_GRADLE_PROJECT_datarepoclientjar}" | |
echo "Running test suite" | |
./gradlew runTest --args="suites/StagingSmokeTests.json tmp/TestRunnerResults" | |
echo "Collecting measurements" | |
./gradlew collectMeasurements --args="StagingSmokeTests.json tmp/TestRunnerResults" | |
echo "Uploading results" | |
./gradlew uploadResults --args="BroadJadeDev.json tmp/TestRunnerResults" | |
cd ${GITHUB_WORKSPACE}/${workingDir} | |
report-workflow: | |
uses: broadinstitute/sherlock/.github/workflows/client-report-workflow.yaml@main | |
with: | |
relates-to-chart-releases: ${{ inputs.relates-to-chart-releases }} | |
notify-slack-channels-upon-workflow-completion: ${{ inputs.notify-slack-channels-upon-workflow-completion }} | |
notify-slack-channels-upon-workflow-failure: ${{ vars.SLACK_NOTIFICATION_CHANNELS }} | |
notify-slack-channels-upon-workflow-retry: ${{ vars.SLACK_NOTIFICATION_CHANNELS }} | |
permissions: | |
id-token: write |