Skip to content

Commit 1e2081a

Browse files
authored
feat: add performance testing workflow for PR workflow (#1079)
# Description This pull request introduces a new job for performance testing and modifies the existing workflow for network performance measurement. The main changes include adding a new performance test job to the `images.yaml` workflow and updating the `perf.yaml` workflow to streamline its execution. New performance test job: * [`.github/workflows/images.yaml`](diffhunk://#diff-d0a3d6684c78a148cbf0725d5fe8b5aab6431da05b698a82c9e015516f3020baR334-R366): Added a new job `perf` to run Retina Performance Tests after the `manifests` job completes successfully. This job includes steps for checking out the code, setting up Go, logging into Azure CLI, and running end-to-end tests with performance tags. Updates to network performance measurement workflow: * [`.github/workflows/perf.yaml`](diffhunk://#diff-1aa140a875fcb7cae6b4ada7e6e973c4d55179ad046f56465f9f0ec592f283caL4-L7): Removed the `workflow_run` trigger and replaced it with a scheduled trigger to run the workflow every 12 hours. * [`.github/workflows/perf.yaml`](diffhunk://#diff-1aa140a875fcb7cae6b4ada7e6e973c4d55179ad046f56465f9f0ec592f283caL23): Removed the condition to check for `workflow_run` or `merge_group` events in the `perf_test` job. * [`.github/workflows/perf.yaml`](diffhunk://#diff-1aa140a875fcb7cae6b4ada7e6e973c4d55179ad046f56465f9f0ec592f283caL54-R52): Updated the `TAG` assignment logic to exclude the `merge_group` event and set the image registry to `ghcr.io`. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project.
1 parent 2e7b979 commit 1e2081a

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

.github/workflows/images.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,36 @@ jobs:
331331
run: |
332332
set -euo pipefail
333333
go test -v ./test/e2e/. -timeout 60m -tags=e2e -count=1 -args -image-tag=$(make version) -image-registry=${{ vars.ACR_NAME }} -image-namespace=${{ github.repository}}
334+
335+
perf:
336+
if: ${{ github.event_name == 'merge_group' && success('manifests')}}
337+
name: Retina Performance Test
338+
runs-on: ubuntu-latest
339+
needs: [manifests]
340+
341+
steps:
342+
- name: Checkout code
343+
uses: actions/checkout@v4
344+
345+
- name: Setup go
346+
uses: actions/setup-go@v5
347+
with:
348+
go-version-file: go.mod
349+
- run: go version
350+
351+
- name: Az CLI login
352+
uses: azure/login@v2
353+
if: ${{ github.event_name == 'merge_group' }}
354+
with:
355+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
356+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
357+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION }}
358+
359+
- name: Run E2E Tests
360+
env:
361+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION }}
362+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
363+
shell: bash
364+
run: |
365+
set -euo pipefail
366+
go test -v ./test/e2e/. -timeout 2h -tags=perf -count=1 -args -image-tag=$(make version) -image-registry=${{ vars.ACR_NAME }} -image-namespace=${{ github.repository }}

.github/workflows/perf.yaml

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Network Performance Measurement
22

33
on:
4-
workflow_run:
5-
workflows: [Build Images]
6-
types:
7-
- completed
84
schedule:
95
# It runs on 17th minute of every 12 hours
106
- cron: '17 */12 * * *'
@@ -20,7 +16,6 @@ permissions:
2016

2117
jobs:
2218
perf_test:
23-
if: ${{ github.event_name != 'workflow_run' || github.event_name == 'merge_group' }}
2419
name: Retina Performance Test
2520
runs-on: ubuntu-latest
2621

@@ -51,9 +46,7 @@ jobs:
5146
set -euo pipefail
5247
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
5348
TAG=${{ github.event.inputs.tag }}
54-
elif [ "${{ github.event_name }}" == "merge_group" ]; then
55-
TAG=$(make version)
5649
else
5750
TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
5851
fi
59-
go test -v ./test/e2e/. -timeout 2h -tags=perf -count=1 -args -image-tag=$TAG -image-registry=${{ vars.ACR_NAME }} -image-namespace=${{ github.repository }}
52+
go test -v ./test/e2e/. -timeout 2h -tags=perf -count=1 -args -image-tag=$TAG -image-registry=ghcr.io -image-namespace=${{ github.repository }}

0 commit comments

Comments
 (0)