From 3d52cb18f972f2305184df03683c83350e660bfe Mon Sep 17 00:00:00 2001 From: Keepers Date: Tue, 1 Nov 2022 16:34:20 -0600 Subject: [PATCH] run the otel-daemon alongside load tests (#1357) ## 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] :robot: Test ## Issue(s) * #902 ## Test Plan - [x] :green_heart: E2E --- .github/workflows/load_test.yml | 47 ++++++++++++++++++++------------- src/Makefile | 16 ++++++++++- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/.github/workflows/load_test.yml b/.github/workflows/load_test.yml index 44de42602..3b0bdc488 100644 --- a/.github/workflows/load_test.yml +++ b/.github/workflows/load_test.yml @@ -26,6 +26,21 @@ jobs: 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: @@ -37,14 +52,6 @@ jobs: - 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: @@ -69,16 +76,6 @@ jobs: -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 # currently, we're required to generate a unique folder for each factory # production. Whenever possible, this should be reverted to increasing the @@ -124,3 +121,17 @@ jobs: 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 diff --git a/src/Makefile b/src/Makefile index 32d24267b..a5a365c34 100644 --- a/src/Makefile +++ b/src/Makefile @@ -32,13 +32,27 @@ build-otel-daemon: docker build -t xray-daemon . otel-daemon: + results_dir=$$PWD/test_results; \ + cd ./testfiles/otel_daemon; \ + docker run \ + -d \ + -e AWS_REGION \ + -v ~/.aws/:/root/.aws/:ro \ + --name otel-daemon \ + -p 2000:2000/udp \ + --rm \ + xray-daemon \ + --local-mode \ + --log-level debug + +local-daemon: results_dir=$$PWD/test_results; \ cd ./testfiles/otel_daemon; \ docker run \ --attach STDOUT \ -e AWS_REGION \ -v ~/.aws/:/root/.aws/:ro \ - --name xray-daemon \ + --name otel-daemon \ -p 2000:2000/udp \ --rm \ xray-daemon \