## Description With this in place, we just need client details to hook up to xray in order to receive open telemetry info from our load test suite. ## Type of change - [x] 🤖 Test ## Issue(s) * #902 ## Test Plan - [x] 💚 E2E
138 lines
4.5 KiB
YAML
138 lines
4.5 KiB
YAML
name: Nightly Load Testing
|
|
on:
|
|
schedule:
|
|
# every day at 01:59 (01:59am) UTC
|
|
# - cron: "59 1 * * *"
|
|
# temp, for testing: every 4 hours
|
|
- cron: "0 */4 * * *"
|
|
|
|
permissions:
|
|
# required to retrieve AWS credentials
|
|
id-token: write
|
|
contents: write
|
|
|
|
# cancel currently running jobs if a new version of the branch is pushed
|
|
concurrency:
|
|
group: load_testing-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
Load-Tests:
|
|
environment: Testing
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: src
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
# AWS creds
|
|
- name: Configure AWS credentials from Test account
|
|
uses: aws-actions/configure-aws-credentials@v1
|
|
with:
|
|
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
|
|
role-session-name: integration-testing
|
|
aws-region: us-east-1
|
|
|
|
- name: Build the otel-daemon
|
|
run: make build-otel-daemon
|
|
|
|
# TODO: write logs to a file in src/test_results for archival
|
|
- name: Run the otel-daemon
|
|
run: make otel-daemon
|
|
|
|
- name: Setup Golang with cache
|
|
uses: magnetikonline/action-golang-cache@v3
|
|
with:
|
|
go-version-file: src/go.mod
|
|
|
|
- run: mkdir test_results
|
|
|
|
# Install gotestfmt
|
|
- name: Set up gotestfmt
|
|
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
|
|
|
|
# run the tests
|
|
- name: Integration Tests
|
|
env:
|
|
AZURE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
|
|
AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
|
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
|
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
|
|
CORSO_M356_LOAD_TEST_USER_ID: ${{ secrets.CORSO_M356_LOAD_TEST_USER_ID }}
|
|
CORSO_LOAD_TESTS: true
|
|
run: |
|
|
set -euo pipefail
|
|
go test \
|
|
-count=1 \
|
|
-json \
|
|
-v \
|
|
--timeout 12h \
|
|
-blockprofile=block.prof \
|
|
-cpuprofile=cpu.prof \
|
|
-memprofile=mem.prof \
|
|
-mutexprofile=mutex.prof \
|
|
-trace=trace.out \
|
|
-outputdir=test_results \
|
|
./pkg/repository/repository_load_test.go \
|
|
2>&1 | tee ./test_results/goloadtest.log | gotestfmt -hide successful-tests
|
|
|
|
# currently, we're required to generate a unique folder for each factory
|
|
# production. Whenever possible, this should be reverted to increasing the
|
|
# item count of a single folder instead, to prevent overproduction of folders
|
|
# during restore.
|
|
- name: Set folder destination date
|
|
run: |
|
|
echo "NOW=$(date -u +"%Y-%m-%d_%H-%M-%S")" >> $GITHUB_ENV
|
|
|
|
# generate new entries to roll into the next load test
|
|
# only runs if the test was successful
|
|
- name: New Data Creation
|
|
working-directory: ./src/cmd/factory
|
|
env:
|
|
AZURE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
|
|
AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
|
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
|
CORSO_M356_LOAD_TEST_USER_ID: ${{ secrets.CORSO_M356_LOAD_TEST_USER_ID }}
|
|
run: |
|
|
go run . exchange emails \
|
|
--user ${{ env.CORSO_M356_LOAD_TEST_USER_ID }} \
|
|
--destination lt_${{ env.NOW }} \
|
|
--count 10
|
|
go run . exchange contacts \
|
|
--user ${{ env.CORSO_M356_LOAD_TEST_USER_ID }} \
|
|
--destination lt_${{ env.NOW }} \
|
|
--count 10
|
|
go run . exchange events \
|
|
--user ${{ env.CORSO_M356_LOAD_TEST_USER_ID }} \
|
|
--destination lt_${{ env.NOW }} \
|
|
--count 10
|
|
|
|
# cleanup folders produced by load test
|
|
- name: Restored Folder Purge
|
|
if: always()
|
|
working-directory: ./src
|
|
env:
|
|
AZURE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
|
|
AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
|
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
|
DELETE_FOLDER_PREFIX: "Corso_Restore_"
|
|
run: >
|
|
go run ./cmd/purge/purge.go
|
|
--user '*'
|
|
--prefix ${{ env.DELETE_FOLDER_PREFIX }}
|
|
|
|
- name: Put Down the Daemons Arisen
|
|
if: always()
|
|
run: docker kill otel-daemon
|
|
|
|
# package all artifacts for later review
|
|
- name: Upload Log, Profilers, Traces
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: load-test-profiling
|
|
path: src/test_results/*
|
|
if-no-files-found: error
|
|
retention-days: 14
|