Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the ability to run e2e tests on different testbeds/NICs #147

Merged
merged 5 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,37 @@ name: sriov-e2e-test
run-name: sriov-e2e-test initiated by ${{ github.actor }}
on:
pull_request:
types: [labeled]
types: [ labeled ]
workflow_dispatch:
inputs:
tag:
description: 'NIC hardware'
required: true
default: '810'
type: choice
options:
- 810
- 710
jobs:
prepare-label:
runs-on: ubuntu-latest
outputs:
label: ${{ steps.step1.outputs.label }}
steps:
- name: Check label
id: step1
run: |
if [ ${{ github.event.label.name }} == 'e2e-test' ]; then
echo "label=810" >> $GITHUB_OUTPUT
elif [ ${{ github.event.label.name }} == 'e2e-test-710' ]; then
echo "label=710" >> $GITHUB_OUTPUT
elif [ -n ${{ github.event.inputs.tag }} ]; then
echo "label=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
fi
e2e-tests:
runs-on: self-hosted
if: contains(github.event.label.name, 'e2e-test')
needs: [ prepare-label ]
if: ${{ needs.prepare-label.outputs.label }}
runs-on: ${{ needs.prepare-label.outputs.label }}
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -76,3 +101,4 @@ jobs:
- name: remove label
run: |
curl --silent -X DELETE -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ github.token }}' 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/e2e-test'
curl --silent -X DELETE -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ github.token }}' 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/e2e-test-710'
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,6 @@ As this identifier is used to identify a specific, unique test definition, a cha

All SR-IOV and common tests should be validated to work and, in cases where changes affect common code, that changes do not break existing tests or common code. To this end there are GitHub Actions running to validate formatting by way of a linter, a series of mock tests checking the common code, as well as an option to run tests on a lab machine. The linter and mocks run automatically on Pull Requests.

The optional "real" testing can be run by applying the "e2e-test" label to the Pull Request. This will start an action which queues either an end-to-end test (where common code is affected) or runs the specific test modified (when no common code is affected). Because these tests take both time and resources, they should only be started after the PR is ready to merge as a final check of functionality, and this label should only be utilized by repository maintainers. After the test run, the Action will remove the "e2e-test" label.
The optional "real" testing can be run by applying the "e2e-test" label to the Pull Request. This will start an action which queues either an end-to-end test (where common code is affected) or runs the specific test modified (when no common code is affected). Because these tests take both time and resources, they should only be started after the PR is ready to merge as a final check of functionality, and this label should only be utilized by repository maintainers. After the test run, the Action will remove the "e2e-test" label.

"e2e-test" label triggers end-to-end test execution using 810-series NIC ports. Alternatively, "e2e-test-710" label can be used for end-to-end test execution on 710-series NICs.