235 Commits

Author SHA1 Message Date
Sergio Cazzolato
3b711ef737 tests: remove ubuntu 21.10 from spread tests due to end of life
* Remove ubuntu 21.10 from spread tests due to end of life

07-14 is end of life so we remove the test support in spread.

* spread.yaml: (re)add ubuntu-20.04-32 to qemu

Co-authored-by: Michael Vogt <mvo@ubuntu.com>
2022-07-15 10:14:45 +02:00
Sergio Cazzolato
d9dd2e2ffa tests: enable centos-9 (#11849)
* Initial changes to support centos-9

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 3b56339b88..9b7b4e9bf1

9b7b4e9bf1 Merge pull request #28 from snapcore/add-centos-9-support
7fe2087423 Add support for centos-9
64a830b933 Merge pull request #27 from snapcore/improve-log-analyzer
7fe27d4aea Improve log analyzer utility
207536268e Merge pull request #19 from snapcore/new-spread-manager
2f2ff2e282 Update spread manager to support csv
33a44ca3be Merge branch 'main' into new-spread-manager
b4654950d4 Merge pull request #26 from snapcore/support-csv-for-expressions
3250bbd885 Support expressions with comma separation
2540135b90 Merge pull request #25 from snapcore/add-indent-to-log-parser
2536b0f070 Minor improvements in log-parser and log-analyzer based con review comments
84dc8092b1 Merge pull request #24 from snapcore/improve-log-parser
515770b3bf Add support for fedora-35
875c29b5ce Updated results with latest log-parser changes
d27f2bcdb7 Fix log-parser
b2cce1fcce fix wording
14d15e4fe4 Fixes for log-parser and changes for log analyzer
438d92d241 Log analyzer updated to support reexecute in all the scenarios
1c9dff58ff Merge pull request #23 from snapcore/improve-log-parser
cc7ee488d1 Fix shellcheck
324b99e719 revert change in log-analyzer test
f746f40ebe Fix shellcheck
2d7dbbe1bd Fix spelling
728dd64c2c Last set of changes for log analizer tools
bf389dcd01 New fixes for log parses
6b2b56afc3 Fix another shellcheck
56163e170b Fix shellcheck
d96ab8094f Merge branch 'main' into new-spread-manager
60fb99f02f new dir task5
259a7e188c Fix spread test
e674234454 New spread-manager tool

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 9b7b4e9bf102d9520be02959b184ee09d4021ec7

* Adding centos-9 to workflow

* Skip centos-9 on some tests

* data/selinux: update the policy to allow snap to access openssl certificates

As observed in the spread tests:

type=AVC msg=audit(06/07/22 14:39:47.321:1164) : avc:  denied  { open } for
pid=47406 comm=snap path=/etc/pki/tls/openssl.cnf dev="sda2" ino=16781422
scontext=system_u:system_r:snappy_cli_t:s0 tcontext=system_u:object_r:cert_t:s0
tclass=file permissive=1

type=AVC msg=audit(06/07/22 14:39:47.321:1164) : avc:  denied  { read } for
pid=47406 comm=snap name=openssl.cnf dev="sda2" ino=16781422
scontext=system_u:system_r:snappy_cli_t:s0 tcontext=system_u:object_r:cert_t:s0
tclass=file permissive=1

type=AVC msg=audit(06/07/22 14:39:47.321:1164) : avc: denied { search } for
pid=47406 comm=snap name=pki dev="sda2" ino=50341780
scontext=system_u:system_r:snappy_cli_t:s0 tcontext=system_u:object_r:cert_t:s0
tclass=dir permissive=1

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

* Work around the snap version unknown issue

* Revert chnage to  force mkversion for centos-9

* Change spec used to build centos

In centos 9 if we use the spec "$packaging_path/snapd.spec" them
rpmbuild takes the packages from $packaging_path

* sources are also built from rpm_dir

* Updaing spec to support rhel 9

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 9b7b4e9bf1..54909c304d

54909c304d Merge pull request #29 from snapcore/udpate-os-query-new-systems
cc1729c2f4 preserve size for amazon-linux
bb3d8db60e preserve size for centos
d1089d5ce3 Fixing the tests
47793a6465 Fix auto-merge problem
f50be4ac5e Merge branch 'main' into udpate-os-query-new-systems
1a40a224c9 os.query tool cli simplified

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 54909c304ddbe284ee49142d3247aeb7876d1feb

* Update os.query uses following changes in the cli

* Skip test on centos-9

* fix os.query usage

* Skip rhbz-1708991 on centos-9

* Fix os.query error in tests

Co-authored-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-07-14 00:22:15 -03:00
Sergio Cazzolato
ced0597b35 Merge branch 'master' into bboozzoo/maybe-leap-15.4 2022-06-24 12:05:11 -03:00
Sergio Cazzolato
9c8d7055ee Add spread execution for fedora 36
This change also removes executions from fedora-34 and some references
to fedora-33
2022-06-09 11:45:59 -03:00
Maciej Borzecki
0dea01b1ac github: run spread workflow on opensuse 15.4
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-06-09 10:41:24 +02:00
Sergio Cazzolato
fb2d143976 tests: allow to re-execute aborted tests (#11811)
* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 53ca1b3b70..1c9dff58ff

1c9dff58ff Merge pull request #23 from snapcore/improve-log-parser
cc7ee488d1 Fix shellcheck
324b99e719 revert change in log-analyzer test
f746f40ebe Fix shellcheck
2d7dbbe1bd Fix spelling
728dd64c2c Last set of changes for log analizer tools
bf389dcd01 New fixes for log parses
3b56339b88 Merge pull request #22 from snapcore/tests-fix-spread-shellcheck
488408d792 fix shellcheck test
b9340d265c Fix spread-shellcheck and update the test with new scenario

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 1c9dff58ff43d120d8ca5cc19b305a5c99ea2698

* Get the list of tasks to re-execute from the log-analyzer tool

* Simplify the logic to re-execute tasks

* printing the changed file to run shellcheck

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1c9dff58ff..84dc8092b1

84dc8092b1 Merge pull request #24 from snapcore/improve-log-parser
515770b3bf Add support for fedora-35
875c29b5ce Updated results with latest log-parser changes
d27f2bcdb7 Fix log-parser
b2cce1fcce fix wording
14d15e4fe4 Fixes for log-parser and changes for log analyzer
438d92d241 Log analyzer updated to support reexecute in all the scenarios

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 84dc8092b13c63c02ade50198bfddf6f520e8ab4

* filter the tests for list-reexecute-tasks

* fix reexecution expression for nested

* Fix workflow for nested tests

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 84dc8092b1..2540135b90

2540135b90 Merge pull request #25 from snapcore/add-indent-to-log-parser
2536b0f070 Minor improvements in log-parser and log-analyzer based con review comments

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 2540135b9022dc2782f44827a091818f271f4a91

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 2540135b90..b4654950d4

b4654950d4 Merge pull request #26 from snapcore/support-csv-for-expressions
3250bbd885 Support expressions with comma separation

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: b4654950d49e465d4c978e6ce1cd9eac898e063a

* Fix the scenario of re-re-execute

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from b4654950d4..7fe27d4aea

7fe27d4aea Improve log analyzer utility
207536268e Merge pull request #19 from snapcore/new-spread-manager
2f2ff2e282 Update spread manager to support csv
33a44ca3be Merge branch 'main' into new-spread-manager
6b2b56afc3 Fix another shellcheck
56163e170b Fix shellcheck
d96ab8094f Merge branch 'main' into new-spread-manager
60fb99f02f new dir task5
259a7e188c Fix spread test
e674234454 New spread-manager tool

git-subtree-dir: tests/lib/external/snapd-testing-tools
git-subtree-split: 7fe27d4aea8302aeb29f44517808f690633eb547

* Fix manual nested tests for ubuntu xenial
2022-06-02 22:39:06 -03:00
Michael Vogt
473ec55d98 Merge pull request #11802 from xnox/riscv64-builds
.github: Trigger daily riscv64 snapd edge builds
2022-05-20 16:18:57 +02:00
Dimitri John Ledkov
9930341e5d .github: Trigger daily riscv64 snapd edge builds
Use github actions workflow to trigger daily riscv64 snapd edge
builds.
2022-05-18 15:40:41 +01:00
Sergio Cazzolato
9b95f4a23f tests: improve the unit testing workflow to run in parallel (#11782)
* Improve the unit testing workflow to run in parallel

This change includes:
 . Run first a workflow to make the static checks
 . Run in parallel all the unit tests
 . Run at the end the code coverage

* some fixes on checks

* Fix when coverage is uploaded

* static checks for changed files

* Update the modified files

* Fix how changed files are retrieved

* Using a different action to retrieve changed files

* moving the new step

* Use correct path to retrieve files

* Skipping shellcheck when it is not needed

* fix error setting filtered files

* fix format for file list

* Fixing how shell files are filtered

* Fix on ()

* Fix shellchecks

* filter files previous to spread-shellcheck

* Moving run-checks to bash

* Get dependencies

* new step to get deps

* Check coverage files

* update path for coverage files

* Fix how coverage tool is installed

* Try removing Install Debian dependencies

* restoring the deb deps

* Remove more steps on static checks

* Reduce the number of tasks executed when the job already passed

* Remove cache used to save already-ran

* Cache debian dependencies

* Add dependency missing between jobs

* new step to copy dependencies

This is to avoid access error

* tar the debian dependencies

* Install latest covertool

* remove more steps

* adding path to bin in workspace

* Restore the spread tests but without already-ran

* fix tabs

* Create CHANGED_FILES var with default

* Updated the initial files for shellcheck and list the files used by covertool

* Fix how initial files are calculated
2022-05-18 11:14:28 -03:00
Sergio Cazzolato
30dee96c7c Run failed tests by default
It the pr has a label called "Run all", then all the tests are going to
be executed in case the job failed previously.
2022-05-09 22:12:36 -03:00
Sergio Cazzolato
70fb9127db tests: run failed tests on nested suite (#11737)
* Allow run failed tests on google-nested backend

This change is to allow running just the failed tests for google-nested
backend when the "Run failed" tag is set

* Make sure no new lines in results

* fix core22-basic to deal with recovery-keys change

* filter by backend to make sure external subtests are not included

* Fix core22-basic disabling recovery keys checks

* Fix recovery keys for core20-basic test now

* Update the key for nested cache
2022-05-06 14:53:11 -03:00
Valentin David
11a4cae5a2 .github: Skip misspell and ineffassign on go 1.13
A change in golang.org/x/sys broke build of misspell and ineffassign
on go 1.13.
2022-05-03 14:29:56 +02:00
Sergio Cazzolato
748cf9eb0e tests: re-execute the failed tests when "Run failed" label is set in the PR (#11627)
* Update the workflow to save failed tests

* Re run failed tests

This change is done to save the failed tests for a run and execute those
tests when the labed "Run failed" is set in the PR.

The idea of this is to speed up the re-executions

* Update tests dir and indentation

* Improvement in the actions workflow

* Add missing dir

* Fix TEST_RESULTS_DIR creation

* Simplify the actions workflow to run just once the spread tests

* Create the TEST_RESULTS_DIR

* Adding extra info to failed tests check

* Fix to support complex results like the following

2022-04-06 10:35:36 Failed tasks: 3
    - google:arch-linux-64:tests/main/snap-quota
    - google:ubuntu-14.04-64:tests/main/interfaces-many-snap-provided
    - google:ubuntu-21.10-64:tests/unit/go
2022-04-06 10:35:36 Failed task prepare: 1
    - google:ubuntu-14.04-64:tests/main/interfaces-many-core-provided
2022-04-06 10:35:36 Failed task restore: 1
    - google:arch-linux-64:tests/main/snap-quota
error: unsuccessful run

* Minor improvementes based on review comments

* Fix FAILED_TESTS_FILE var name

* Remove " from spread execution line
2022-04-27 22:12:07 -03:00
Sergio Cazzolato
f6f7badcde tests: Initial changes to run nested tests on uc22
* Initial changes to run nested tests on uc22

New nested tests configuration for uc22 and libraries updated.
New basic nested test for uc22 on

* Updated the build_initramfs_kernel_snap

also other minor changes included

* Minor fixes for build_initramfs_kernel_snap

* Using OVMF_CODE and OVMF_VARS from focal ovmf package

As in Jammy there is just the _4M got the snakeoil vars, the idea is to
reuse the once available in focal.

* Adding uc22 to nested tests execution

* Fix preseed nested test to make it work for jammy

* Update how kernel is re-packed

* Fix the prepare.sh script

* send the parameters to the new modify-the-tool function

* Fix how modify_the_tool is called

* Use uc20_build_initramfs_kernel_snap from master
2022-04-21 14:35:16 +02:00
Maciej Borzecki
5187a1f920 github: cancel workflows when pushing to pull request branches
See
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
for details.

> If you build the group name with a property that is only defined for specific
> events, you can use a fallback value. For example, github.head_ref is only
> defined on pull_request events. If your workflow responds to other events in
> addition to pull_request events, you will need to provide a fallback to avoid
> a syntax error. The following concurrency group cancels in-progress jobs or
> runs on pull_request events only; if github.head_ref is undefined, the
> concurrency group will fallback to the run ID, which is guaranteed to be both
> unique and defined for the run.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-04-15 10:00:05 +02:00
Alberto Mardegan
f8ba7895a6 .github: use another action to retrieve the list of changes
Use the most popular action (249 stars at the moment) to retrieve the
list of changed files, because the action we used before only works fine
for branches forked off the tip of the master branch (fast-forward):

https://github.com/jitterbit/get-changed-files/issues/42
2022-04-14 13:23:40 +03:00
Alberto Mardegan
14123c6d8c .github: use reviewdog action from woke tool
The `woke-action` does not have the `reporter` option and running it
generates a warning:

    Unexpected input(s) 'reporter', valid inputs are ['github-token', 'woke-args', 'fail-on-error', 'workdir', 'woke-version']
2022-04-14 13:23:40 +03:00
Maciej Borzecki
d15c0e37f1 github/woke: only run on changed files
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-04-14 09:32:19 +02:00
Maciej Borzecki
dd38a0d872 Merge remote-tracking branch 'upstream/master' into feature/run-woke-github-actions 2022-04-14 09:18:34 +02:00
Valentin David
7b5d001b10 tests: Enable more tests for UC22 2022-04-06 15:10:05 +02:00
Maciej Borzecki
fc2e94193b github/workflows: update golangci-lint version
1.40 seems to be complaining about weird things in latest stable Go job. Let's
see if this one is better.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-03-31 12:53:12 +02:00
Ian Johnson
b934badead .github: run woke tool on PR's
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2022-03-16 11:21:32 -05:00
Michael Vogt
d88a00e9a0 github: replace "sanity check" with "quick check" in workflow
In order to move to a more inclusive naming we need to replace
the word "sanity" with something more inclusive like "quick".

This commit does that for the (user visible) workflow output.
2022-03-14 16:55:50 +01:00
Sergio Cazzolato
fbec1ec262 Fix the quoting for the metadate json value 2022-03-10 12:20:19 -03:00
Sergio Cazzolato
bf6229901e Include the source github url as part of the mongo db issues
The idea is to have a tracking to the original error log in the mondo db
issues.
2022-03-08 16:46:14 -03:00