96 lines
2.8 KiB
YAML
96 lines
2.8 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
|
|
|
|
- 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
|
|
|
|
# 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
|
|
|
|
# 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_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
|
|
|
|
# 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
|
|
|
|
# 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 }}
|
|
|