-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sriov_test1
- Loading branch information
Showing
52 changed files
with
2,219 additions
and
456 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Submit a Checkbox Test plan (or subset of it) to the lab | ||
inputs: | ||
data_source: | ||
description: "Target image and provisioning data (ex. `url:` or `distro:`)" | ||
required: false | ||
default: null | ||
queue: | ||
description: "Queue that will run the testing (ex. 202012-28526)" | ||
required: true | ||
test_plan: | ||
description: "Test plan to run (ex. com.canonical.certification::sru)" | ||
required: true | ||
match: | ||
description: "Subset of jobs to run (ex. .*wireless.*)" | ||
required: false | ||
default: ".*" | ||
launcher_override: | ||
description: "Launcher with additional values that will take priority over the defaults" | ||
default: "" | ||
required: false | ||
checkbox_revision: | ||
description: "Revision of checkbox that has to be provisioned (ex. commit_hash, branch name, can be `beta`)" | ||
required: true | ||
zapper_channel: | ||
description: "Zapper channel to be used, will be ignored if no Zapper (ex. edge, beta, stable)" | ||
required: false | ||
default: "beta" | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
sudo apt install -y -qq gettext | ||
- name: Build test resource | ||
shell: bash | ||
env: | ||
INPUT_DATA_SOURCE: ${{ inputs.data_source }} | ||
INPUT_QUEUE: ${{ inputs.queue }} | ||
INPUT_MATCH: ${{ inputs.match || '.*' }} | ||
INPUT_TEST_PLAN: ${{ inputs.test_plan }} | ||
INPUT_LAUNCHER_OVERRIDE: ${{ inputs.launcher_override }} | ||
INPUT_CHECKBOX_REVISION: ${{ inputs.checkbox_revision }} | ||
INPUT_ZAPPER_CHANNEL: ${{ inputs.zapper_channel || 'beta' }} | ||
working-directory: ${{ github.action_path }}/../../../tools/lab_dispatch | ||
run: | | ||
echo "::group::Building the testflinger job" | ||
if [ -n "$INPUT_DATA_SOURCE" ]; then | ||
INPUT_DATA_SOURCE="provision_data: $INPUT_DATA_SOURCE" | ||
fi | ||
envsubst '$INPUT_CHECKBOX_REVISION $INPUT_DATA_SOURCE $INPUT_QUEUE $INPUT_ZAPPER_CHANNEL' < generic_source.yaml | tee job.yaml | ||
echo "::endgroup::" | ||
echo "::group::Building the Checkbox launcher" | ||
# this goes from .template. (missing secret, testplan, match etc. to .partial.) | ||
# this is partial as some values are filled in on the agent (like wireless access points names) | ||
envsubst '$INPUT_TEST_PLAN $INPUT_MATCH' < resources/checkbox.no-manifest.template.conf | tee resources/checkbox.no-manifest.partial.conf | ||
echo "::endgroup::" | ||
echo "::group::Dumping launcher overrides" | ||
echo "$INPUT_LAUNCHER_OVERRIDE" | tee launcher_override.conf | ||
echo "::endgroup::" | ||
- name: Workaroud cwd | ||
shell: bash | ||
run: | | ||
# this allows us to dispatch the action and the attachments with relative | ||
# paths even when called form outside the Checkbox repo | ||
action_path=$(realpath ${{ github.action_path }}/../../../tools/) | ||
workdir_path=$(realpath tools/) | ||
if [ ! -e "$workdir_path" ]; then | ||
cp -rT "$action_path" "$workdir_path" | ||
fi | ||
if [ "$action_path" = "$workdir_path" ]; then | ||
echo "Skipping copy as the action is already running in workdir" | ||
else | ||
cp -rT "$action_path" "$workdir_path" | ||
fi | ||
- name: Submit and monitor job | ||
uses: canonical/testflinger/.github/actions/submit@main | ||
with: | ||
poll: true | ||
job-path: tools/lab_dispatch/job.yaml |
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 |
---|---|---|
@@ -1,14 +1,58 @@ | ||
name: Run Workflow on PR Comment | ||
name: Dispatch Checkbox jobs in the lab | ||
on: | ||
issue_comment: | ||
types: [created] | ||
workflow_dispatch: | ||
inputs: | ||
# matrix to create is an array where each item is a job configuration | ||
# to be dispatched in the lab. | ||
# A job configuration is a dict with | ||
# - data_source: distribution to provision (ex. distro: desktop-22-04-2-uefi) | ||
# - queue: machine that will run the job (ex. 202012-28526) | ||
# - test_plan: Checkbox test plan to run (ex. com.canonical.certification::sru) | ||
# - match: subset of jobs to run (ex. .*wireless.*) | ||
# - zapper_channel: refreshes the zapper snap to the channel if provided, default is beta (ex. "beta") | ||
# | ||
# One possible matrix_to_create would therefore look like this: | ||
# matrix_to_create=[{ data_source: "distro: desktop-22-04-2-uefi", queue: "202012-28526", match: ".*wireless.*", test_plan: "com.canonical.certification::sru" }]' | ||
# | ||
# To run this workflow manually you can use the `gh` cli utility as follows: | ||
# gh workflow run dispatch_lab_job.yaml -f 'matrix_to_create=[...]' | ||
matrix_to_create: | ||
description: 'Json formatted description of the jobs to dispatch' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
trigger: | ||
runs-on: ubuntu-latest | ||
run-matrix: | ||
runs-on: [self-hosted, testflinger] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
spec: ${{ fromJson(inputs.matrix_to_create) }} | ||
defaults: | ||
run: | ||
working-directory: tools/lab_dispatch | ||
steps: | ||
- name: Dispatch test in the lab and monitor it | ||
if: ${{ contains(github.event.comment.body, '/lab') && github.event.issue.pull_request && github.event.issue.author_association == "MEMBER" }} | ||
run: | ||
COMMENT_BODY="${{ github.event.comment.body }}" | ||
echo $COMMENT_BODY | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get current commit SHA | ||
id: get_sha | ||
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
|
||
- name: Run the spec | ||
uses: canonical/checkbox/.github/actions/checkbox_source_deb@main | ||
with: | ||
data_source: ${{ matrix.spec.data_source }} | ||
queue: ${{ matrix.spec.queue }} | ||
test_plan: ${{ matrix.spec.test_plan }} | ||
match: ${{ matrix.spec.match }} | ||
zapper_channel: ${{ matrix.spec.zapper_channel }} | ||
launcher_override: | | ||
[environment] | ||
WPA_BG_PSK = ${{ secrets.INPUT_PASSWORD_SECRET }} | ||
WPA_N_PSK = ${{ secrets.INPUT_PASSWORD_SECRET }} | ||
WPA_AC_PSK = ${{ secrets.INPUT_PASSWORD_SECRET }} | ||
WPA_AX_PSK = ${{ secrets.INPUT_PASSWORD_SECRET }} | ||
WPA3_AX_PSK = ${{ secrets.INPUT_PASSWORD_SECRET }} | ||
checkbox_revision: ${{ steps.get_sha.outputs.sha }} |
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.