-
Notifications
You must be signed in to change notification settings - Fork 0
workflows: add snap_store_integration_tests to handle snap store downloads and testing #161
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
Open
Sinan-Karakaya
wants to merge
9
commits into
main
Choose a base branch
from
sinan/test-snap-from-snap-store
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7919a62
workflows: renamed legacy incident yml file extension
Sinan-Karakaya 52d735f
workflows: added snap-store integration workflow and update DUT insta…
Sinan-Karakaya b2149db
workflows: unified snap jobs and moved them to their own workflows
Sinan-Karakaya ca3044a
workflows: merged snap_test_source and snap_channel
Sinan-Karakaya e7720d5
workflows: moved ROOT_DIR to env for simpler path construction
Sinan-Karakaya 76caf16
workflows: replaced snap_channel.txt by environment variables
Sinan-Karakaya 6bb8a3e
workflows: Enable manual trigger for integration tests workflow
Sinan-Karakaya 32750a9
workflows: export snap variables and remove explicit sourcing
Sinan-Karakaya b4e6b65
workflows: merge main into sinan/test-snap-from-snap-store
Sinan-Karakaya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Set to default values. Will be set in snap_integration_tests.yml | ||
| export SNAP_TEST_SOURCE="${SNAP_TEST_SOURCE:-local}" | ||
| export SNAP_CHANNEL="${SNAP_CHANNEL:-${SNAP_TEST_SOURCE}}" |
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,80 @@ | ||
| name: Run integration tests on a DUT via testflinger | ||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| jobs: | ||
| binary-integration-tests: | ||
| name: Build and Test the Daemon Binary on DUT | ||
| runs-on: [self-hosted, self-hosted-linux-amd64-jammy-private-endpoint-medium] | ||
| # todo: enable testflinger environment | ||
| # environment: | ||
| # name: testflinger | ||
| # if: ${{ vars.TESTFLINGER_TESTS_ENABLED == '1' && ! github.event.pull_request.draft}} | ||
| if: ${{ !github.event.pull_request.draft }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| echo "::group::install dependencies" | ||
| sudo snap install yq | ||
| echo "::endgroup::" | ||
| - name: Prepare Testflinger Job | ||
| id: prepare-tf-job | ||
| shell: bash | ||
| run: | | ||
| echo "::group::creating fpgad.gz tarball" | ||
| tar -czvf ../fpgad.gz --exclude="target" --exclude=".git" -C ../ ./fpgad | ||
| mv ../fpgad.gz ./fpgad.gz | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::creating job.yaml" | ||
| yq '.test_data.attachments = [ | ||
| {"agent": "device_script.sh", "local": "'"$(pwd)"'/.github/testflinger-assets/test_binary_device_script.sh"}, | ||
| {"agent": "fpgad.gz", "local": "'"$(pwd)"'/fpgad.gz"}, | ||
| {"agent": "env_setup.sh", "local": "'"$(pwd)"'/.github/testflinger-assets/env_setup.sh"} | ||
| ]' .github/testflinger-assets/testflinger_job.yaml | tee job.yaml | ||
| echo "::endgroup::" | ||
|
|
||
| echo "test_path=job.yaml" >> $GITHUB_OUTPUT | ||
| - name: Submit TF job | ||
| id: submit | ||
| uses: canonical/testflinger/.github/actions/submit@rev263 | ||
| continue-on-error: true | ||
| with: | ||
| poll: true | ||
| job-path: ${{ steps.prepare-tf-job.outputs.test_path }} | ||
| - name: Fetch and Display Artifacts | ||
| shell: bash | ||
| run: | | ||
| echo "::group::retrieve llvm-cov artifacts" | ||
| testflinger artifacts ${{steps.submit.outputs.id }} | ||
| tar -xvzf artifacts.tgz | ||
| echo "::endgroup::" | ||
|
|
||
| for f in artifacts/* ; do | ||
| echo "::group::$f" | ||
| cat "$f" | ||
| echo "::endgroup::" | ||
| done | ||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: llvm-cov-artifacts | ||
| path: artifacts/* | ||
| - name: Report test status | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ steps.submit.outcome }}" != "success" ]; then | ||
| echo "::error::test job didn't complete successfully" | ||
| exit 1 | ||
| fi | ||
| if [[ ! -f artifacts/coverage_test.log ]]; then | ||
| echo "::error::coverage_test.log not found, did the tests fail to start?" | ||
| exit 1 | ||
| fi | ||
| if grep -q "test result: FAILED" artifacts/coverage_test.log; then | ||
| echo "::error::found failure phrase in coverage_test.log" | ||
| exit 1 | ||
| fi | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.