-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests): add network perf tests for Retina (#772)
# Description This pull request introduces several significant changes to enhance performance testing, update dependencies, and improve workflows. The most important changes include adding a new network performance measurement workflow, updating Go module dependencies, and modifying existing workflows and tests to integrate the new performance testing capabilities. ### Performance Testing Enhancements: * Added a new GitHub Actions workflow for network performance measurement, triggered by the completion of the "Build Images" workflow or scheduled every 12 hours. This workflow includes steps for setting up the environment, logging into Azure, and running performance tests. * Introduced a new performance test in `test/e2e/retina_perf_test.go` that creates a Kubernetes cluster, runs network performance tests, installs Retina, and compares the results. * Added a new `RunPerfTest` function in `test/e2e/jobs/jobs.go` to handle the execution of performance tests and the publication of results. * Created a new `GetNetworkPerformanceMeasures` type in `test/e2e/scenarios/perf/get-network-performance-measures.go` to perform network performance tests and handle JSON output. ### Dependency Updates: * Updated various dependencies in the `go.mod` file, including `github.com/emicklei/go-restful/v3`, `github.com/envoyproxy/protoc-gen-validate`, and `k8s.io/klog/v2`, among others. [[1]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L95-R96) [[2]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L172-R172) [[3]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L188-L193) [[4]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L270-R271) [[5]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R333-R341) ### Workflow and Configuration Modifications: * Modified the `.devcontainer/devcontainer.json` file to include the `azure-cli` feature. * Updated the `e2e.yaml` GitHub Actions workflow to run end-to-end tests on specific files matching the pattern `*e2e*.go`. ### Documentation and Miscellaneous: * Added a section in `test/e2e/README.md` detailing how to read Retina performance test results and the types of metrics published to Azure App Insights. * Added a new variable `AzureLocations` in `test/e2e/common/common.go` to list supported Azure regions for performance tests. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## 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. --------- Signed-off-by: Ritwik Ranjan <[email protected]> Signed-off-by: Ritwik Ranjan <[email protected]>
- Loading branch information
1 parent
09951b7
commit b53a09a
Showing
15 changed files
with
632 additions
and
55 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Network Performance Measurement | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Build Images] | ||
types: | ||
- completed | ||
schedule: | ||
# It runs on 17th minute of every 12 hours | ||
- cron: '17 */12 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Image Tag to use for the performance test' | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
perf_test: | ||
if: ${{ github.event_name == 'merge_group' }} | ||
name: Retina Performance Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
- run: go version | ||
|
||
- name: Az CLI login | ||
uses: azure/login@v2 | ||
with: | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION }} | ||
|
||
- name: Run performance measurement for Retina | ||
env: | ||
AZURE_APP_INSIGHTS_KEY: ${{ secrets.AZURE_APP_INSIGHTS_KEY }} | ||
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION }} | ||
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} | ||
shell: bash | ||
run: | | ||
set -euo pipefail | ||
if [ -n "${{ github.event.inputs.tag }}" ]; then | ||
TAG=${{ github.event.inputs.tag }} | ||
elif [ "${{ github.event_name }}" == "merge_group" ]; then | ||
TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
else | ||
TAG="default-version" | ||
fi | ||
go test -v ./test/e2e/. -timeout 2h -tags=perf -count=1 -args -image-tag=$TAG -image-registry=${{ vars.ACR_NAME }} -image-namespace=${{ github.repository }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,7 @@ bin/ | |
|
||
image-metadata-*.json | ||
*packetmonitorsupport*/ | ||
*.pem | ||
*results*.json | ||
netperf-*.json | ||
netperf-*.csv |
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
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
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
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
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
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
Oops, something went wrong.