296 Commits

Author SHA1 Message Date
Sergio Cazzolato
c2956eabe5 tests: improve nightly github workflow (#13825)
The main fix in this change is the cobertura file path is updated
Also several shellcheck improvements are included
2024-04-12 12:26:08 -03:00
Sergio Cazzolato
9f068d55bc tests: run tiobe tics tool in a nightly workflow (#13814)
* integrate the tics tool in a nightly job

This change introduces a new github actions workflow to run the analisys
tool to the Tiobe tics server

* simplify workflow

* allow manually run the workflow

Also several fixes are included after testing this in my master branch

* Update comments
2024-04-12 09:14:50 -03:00
Maciej Borzecki
0dd7e2f4e2 .github/workflows, advisor, packaging: switch to go.etcd.io/bbolt (#13804)
* go: add go.etcd.io/bbolt@1.3.9

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

* advisor: switch to go.etcd.io/bbolt, since github.com/boltdb/bolt is no longer maintained

The upstream boltdb repository at https://github.com/boltdb/bolt is no longer
maintained and has been archived. The community has moved to forks, where
https://github.com/etcd-io/bbolt seems to be the one with most use.

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

* packaging/fedora: switch to go.etcd.io/bbolt

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

* packaging/debian-sid: require bbolt

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

* advisor: drop nobolt variant

Since we've switched to a different upstream, nobolt variant is no longer
needed.

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

* packaging/debian-sid: drop nobolt hacks

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

* github: drop nobolt unit test variant

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

* github: add missing newline

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

---------

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-04-11 16:33:37 +02:00
Sergio Cazzolato
239f6b19ef tests: add static checks for snapd branches (#13784)
* Check done in branches which are not executed on master

The idea is to have in this new job the checks needed to validate
specific aspects when the branch is not master (just for release/**).

* fix workflow

* add checkout step

* test the check works forcing error

* run this check just when github.ref and correct the check

This is the final version
2024-04-09 08:48:57 -03:00
Sergio Cazzolato
2b482743b6 tests: initial changes to run core suite in uc24 (#13712)
* tests: initial changes to run core suite in uc24

Changes needed to run core test suite in uc24

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1c8efb77e1..1db5214d5f

1db5214d5f Improve the remote docs (#36)
2e4a3153a2 1 more comment
3a0fc57e1e add explanation about why we check for ( Do | Doing )
4cf8e635bf fix os.query test after merge
b89b4f8647 fix artifacts name
d30cee6da0 Merge remote-tracking branch 'upstream/main'
5ef5dcbe8f Tests use artifacts in spread tests (#51)
555c43d2ab Support auto-refresh with Do instead of Doing
96c2b0c19c remove tests support for ubuntu 23.04 (EoL)
74082c0c34 Tests improve remote wait (#49)
5121bfb659 remove support for opensuse leap 15.4 (#48)
30df700d08 Add new systems support (#47)
1f08938925 Support check amazon linux version (#46)
43533bdd97 Change the exit value checking for test formats (#45)
3c88244c04 Update check-test-format to support a dir and a list of files (#44)
510d95f429 add extra check for error in auto-refresh detection function
3289d4031b Try open the log with latin-1 encoding when utf-8 is not working
9db785499f improved how the tools are waiting for system reboot
2a5c4414a3 fix shellcheck errors
5e7b63883d Fixes for osquery and tests pkgs (#43)
4c9145e2ac support reboot waiting for auto-refresh
45768f5188 show changes in unknown status after refresh
8013c30c2a Remove support for ubuntu 22.10
b32b80bf54 Fix remote.rait-for test in bionic
5675c625e9 Enable fedora 38
55f4471957 Support for new oss
f2e88b357c New tool used to query spread json reports
cacd35ede0 utils/spread-shellcheck: explain disabled warnings (#42)
c82afb2dee Support --no-install-recommends parameter when installing dependencies with tests.pkgs
b84eea92e2 spread-shellcheck: fix quotes in environment variables (#41)
ab1e51c29f New comparison in os-query for core systems (#40)
e5ae22a5d4 systemd units can be overwritten
63540b845a Fix error messages in remote pull and push
75e8a426a5 make sure the unit is removed in tests.systemd test
9089ff5c02 Update tests to use the new tests.systemd stop-unit
44ecd5e56a Move tests.systemd stop-units to stop-unit
01a2a83b4b Update tests.systemd to have stop units as systemd.sh
162e93bd35 update tests.systemd CLI options to be the same than retry command
14aa43a405 new feature to re-run failed spread tests (#39)
604cb782db Fix shellcheck in systemd tool
bfc71082c8 Update the tests.systemd to allow parameters waiting for service status
8a2d0a99df Adding quiet tool and removing set +-x from tests.pkgs
d90935d2a4 A comment explaining about the default values for wait-for
3232c5dba7 Add support for ubuntu 23.04
a7164fba07 remove fedora 35 support, add fedora 37 support
89b9eb5301 Update systems supported
92bb6a0664 Include snap-sufix in the snaps.name tool

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

* fix core version under test

* adding missing model

* add missing function in nested.sh

* fix keys used for uc24

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1db5214d5f..dacfd81de9

dacfd81de9 fix is_core functions

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

* use pc-kernel from beta channel

* removing file created for workflow tests

* remove more dirs created during automatic merge

* restore perimssions for files in test snap-repair

* restore tools permissions merged incorrectly

* fix wording in test

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from dacfd81de9..b89ec98b23

b89ec98b23 use local variables in os.query tool

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

* fix remove test details
2024-03-18 16:00:53 -03:00
Sergio Cazzolato
f29db25170 tests: remove static code analysis tool action (#13710)
This is because the action is not supported on forked projects and it is
failing currently on every new pr.
2024-03-14 10:58:18 -03:00
Sergio Cazzolato
d1d3999c78 tests: update the configuration used to display the static analysis info (#13691)
TWe are switching to the default configuration for the snapd project.

This is to avoid exception raised in prs.
2024-03-12 14:52:56 +02:00
Sergio Cazzolato
54678062b3 tests: add github workflow to run tiobeweb tool (#13687)
The idea of this change is to run static analysis tool for the snapd
code.

The analysis will be displayed once this change is merged to master.
2024-03-12 14:20:36 +02:00
Maciej Borzecki
2fd765ab52 github: mention C source code formatting tools we expect
Mention clang-format and indent 2.2.13+ in the error message.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-29 10:39:26 +01:00
Maciej Borzecki
35007470f2 github: build indent
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-27 14:38:36 +01:00
Maciej Borzecki
8048a4cabc github: verify C source code formatting
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-27 14:38:36 +01:00
dependabot[bot]
d935048f4e build(deps): bump tj-actions/changed-files in /.github/workflows
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 34.5.1 to 41.0.0.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v34.5.1...v41.0.0)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-21 13:00:19 +01:00
Sergio Cazzolato
ab5b801395 tests: remove ubuntu lunar support (#13593)
* tests: Remove tests support for ubuntu 23.04 (EoL)

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1c8efb77e1..5121bfb659

5121bfb659 remove support for opensuse leap 15.4 (#48)
30df700d08 Add new systems support (#47)
1f08938925 Support check amazon linux version (#46)
43533bdd97 Change the exit value checking for test formats (#45)
3c88244c04 Update check-test-format to support a dir and a list of files (#44)
510d95f429 add extra check for error in auto-refresh detection function
3289d4031b Try open the log with latin-1 encoding when utf-8 is not working
9db785499f improved how the tools are waiting for system reboot
2a5c4414a3 fix shellcheck errors
5e7b63883d Fixes for osquery and tests pkgs (#43)
4c9145e2ac support reboot waiting for auto-refresh
45768f5188 show changes in unknown status after refresh
8013c30c2a Remove support for ubuntu 22.10
b32b80bf54 Fix remote.rait-for test in bionic
5675c625e9 Enable fedora 38
55f4471957 Support for new oss
f2e88b357c New tool used to query spread json reports
cacd35ede0 utils/spread-shellcheck: explain disabled warnings (#42)
c82afb2dee Support --no-install-recommends parameter when installing dependencies with tests.pkgs
b84eea92e2 spread-shellcheck: fix quotes in environment variables (#41)
ab1e51c29f New comparison in os-query for core systems (#40)
e5ae22a5d4 systemd units can be overwritten
63540b845a Fix error messages in remote pull and push
75e8a426a5 make sure the unit is removed in tests.systemd test
9089ff5c02 Update tests to use the new tests.systemd stop-unit
44ecd5e56a Move tests.systemd stop-units to stop-unit
01a2a83b4b Update tests.systemd to have stop units as systemd.sh
162e93bd35 update tests.systemd CLI options to be the same than retry command
14aa43a405 new feature to re-run failed spread tests (#39)
604cb782db Fix shellcheck in systemd tool
bfc71082c8 Update the tests.systemd to allow parameters waiting for service status
8a2d0a99df Adding quiet tool and removing set +-x from tests.pkgs
d90935d2a4 A comment explaining about the default values for wait-for
3232c5dba7 Add support for ubuntu 23.04
a7164fba07 remove fedora 35 support, add fedora 37 support
89b9eb5301 Update systems supported
92bb6a0664 Include snap-sufix in the snaps.name tool

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

* update message in desktop-portal-screenshot test

* add details to updated tests
2024-02-19 08:52:43 +01:00
Maciej Borzecki
f4de13e619 github: temporarily disable pull request labeler (#13595)
We suspect that the current definition of workflow triggers, will trigger a a
full tests workflow on master whenever 'Pull Request Labeler' completes
successfully. The labeler workflow remains in place and will still run on each
PR.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-15 18:26:51 +02:00
Maciej Borzecki
1df36a8d33 github: increase verbosity
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-14 14:18:00 +01:00
Maciej Borzecki
1f0f69c19b github: disable deltas for Amazon Linux 2023 target
Disable deltas when running spread tests on Amazon Linux 2023.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-14 14:18:00 +01:00
Sergio Cazzolato
0a7a20db83 update how results are saved 2024-02-13 08:22:31 +00:00
Sergio Cazzolato
bc449a51d8 Update backend name
It is needed at least 1 backend called google
2024-02-13 08:22:31 +00:00
Sergio Cazzolato
72881d4bcc tests: split google backend in 2 zones
This is needed to avoid quota issues

Until google define if we can move our compute quota to 1000, this is a
workaround to avoid quota issues.
2024-02-13 08:22:31 +00:00
Maciej Borzecki
5a5bbdb9dc github/workflows/cla-check: enable comments by running in the context of the base repository
Enable running the action in the context of the base repository, see:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
so that write permissions are set and comments can be posted to the PR.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-12 12:48:33 +01:00
Zygmunt Bazyli Krynicki
b8e9bed636 many: allow building without bolt using nobolt tag (#13534)
* many: allow building without bolt using nobolt tag

Bolt is an abandoned project. Upstream is not accepting any patches.
Debian has three versions of bolt, none of which build on riscv64 due to
the lack of appropriate architecture tags.

In Debian, bolt is not built from the vendored package but instead from
the distribution package, one of three in the archive, each capturing a
different, outdated and differently patched fork.

Fortunately, bolt is not really heavily used in snapd. While we try to
address the issue regarding bolt and riscv64, we can continue to build
snapd on riscv64 without the ability to store information only used by
command-not-found helpers.

Allow advisor to fail with advisor.ErrNotSupported when snapd is built without
bolt support. Tests for the store, overlord package and the "snap advise"
command are adjusted to skip certain tests when that error is returned.

Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010686

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* advisor: adjust error message

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* tests: run unit tests for nobolt build tag

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* packaging: drop bolt from debian dependencies

With the ability to build snapd without bolt support, we can drop the patch
responsible for using non-forked bolt.  Bolt is really only needed by the
advisor package, which is used and consumed as a command-not-found data set.
None of that is effective on Debian, making maintenance easier.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* packaging: do not use bolt on Debian

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

---------

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2024-02-07 13:48:42 +01:00
Sergio Cazzolato
f2817ad998 tests: group the systems used in the github workflow (#13392)
* Group the systems used in the github workflow

The idea of this change is to reduce the number of github runners.

The systems in 1 group will be executed together in the same spread run,
so in this case the number of runners needed to executed the whole
change is reduced from 29 to 21

This approach could be also used to group in a different way the
systems.

* change the group names

the idea is to try to add group names that no change over time

* update with ubuntu-24.04

* fix auto-merge error

* update matrix.systems

* fix system

* removing os leap 15.4
2024-01-09 04:31:44 +02:00
Sergio Cazzolato
7a52689b5d tests: remove opensuse 15 4 (#13444)
* tests: remove support for opensuse 15.4

Opensuse leap 15.4 is EoL since december 2023

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1c8efb77e1..5121bfb659

5121bfb659 remove support for opensuse leap 15.4 (#48)
30df700d08 Add new systems support (#47)
1f08938925 Support check amazon linux version (#46)
43533bdd97 Change the exit value checking for test formats (#45)
3c88244c04 Update check-test-format to support a dir and a list of files (#44)
510d95f429 add extra check for error in auto-refresh detection function
3289d4031b Try open the log with latin-1 encoding when utf-8 is not working
9db785499f improved how the tools are waiting for system reboot
2a5c4414a3 fix shellcheck errors
5e7b63883d Fixes for osquery and tests pkgs (#43)
4c9145e2ac support reboot waiting for auto-refresh
45768f5188 show changes in unknown status after refresh
8013c30c2a Remove support for ubuntu 22.10
b32b80bf54 Fix remote.rait-for test in bionic
5675c625e9 Enable fedora 38
55f4471957 Support for new oss
f2e88b357c New tool used to query spread json reports
cacd35ede0 utils/spread-shellcheck: explain disabled warnings (#42)
c82afb2dee Support --no-install-recommends parameter when installing dependencies with tests.pkgs
b84eea92e2 spread-shellcheck: fix quotes in environment variables (#41)
ab1e51c29f New comparison in os-query for core systems (#40)
e5ae22a5d4 systemd units can be overwritten
63540b845a Fix error messages in remote pull and push
75e8a426a5 make sure the unit is removed in tests.systemd test
9089ff5c02 Update tests to use the new tests.systemd stop-unit
44ecd5e56a Move tests.systemd stop-units to stop-unit
01a2a83b4b Update tests.systemd to have stop units as systemd.sh
162e93bd35 update tests.systemd CLI options to be the same than retry command
14aa43a405 new feature to re-run failed spread tests (#39)
604cb782db Fix shellcheck in systemd tool
bfc71082c8 Update the tests.systemd to allow parameters waiting for service status
8a2d0a99df Adding quiet tool and removing set +-x from tests.pkgs
d90935d2a4 A comment explaining about the default values for wait-for
3232c5dba7 Add support for ubuntu 23.04
a7164fba07 remove fedora 35 support, add fedora 37 support
89b9eb5301 Update systems supported
92bb6a0664 Include snap-sufix in the snaps.name tool

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

* fix opensuse duplication
2024-01-04 17:04:36 +02:00
Sergio Cazzolato
45e03610c9 tests: add spread tests support for ubuntu-24.04 (#13426)
* tests: add spread tests support for ubuntu-24.04

* add test fixes

* fix preseed tests and cgroup-tracking-failure

* Fix failing tests

* fix more lxd tests

* skip snapd-homedirs-vendored in ubuntu 24.04

* use ubuntu-daily images for lxd when system is ubuntu-24.04

* fix upgrade-from-release test

* add missing details to tests

* fix system name

* update scroup-tracking-failure test
2023-12-15 20:07:34 +02:00
Sergio Cazzolato
12221c76eb tests: add support for fedora 39 and remove support for fedora 37 (#13427)
* tests: add support for fedora 39 and remove support for fedora 37

Fedora 37 eol: November 14th, 2023

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1c8efb77e1..30df700d08

30df700d08 Add new systems support (#47)
1f08938925 Support check amazon linux version (#46)
43533bdd97 Change the exit value checking for test formats (#45)
3c88244c04 Update check-test-format to support a dir and a list of files (#44)
510d95f429 add extra check for error in auto-refresh detection function
3289d4031b Try open the log with latin-1 encoding when utf-8 is not working
9db785499f improved how the tools are waiting for system reboot
2a5c4414a3 fix shellcheck errors
5e7b63883d Fixes for osquery and tests pkgs (#43)
4c9145e2ac support reboot waiting for auto-refresh
45768f5188 show changes in unknown status after refresh
8013c30c2a Remove support for ubuntu 22.10
b32b80bf54 Fix remote.rait-for test in bionic
5675c625e9 Enable fedora 38
55f4471957 Support for new oss
f2e88b357c New tool used to query spread json reports
cacd35ede0 utils/spread-shellcheck: explain disabled warnings (#42)
c82afb2dee Support --no-install-recommends parameter when installing dependencies with tests.pkgs
b84eea92e2 spread-shellcheck: fix quotes in environment variables (#41)
ab1e51c29f New comparison in os-query for core systems (#40)
e5ae22a5d4 systemd units can be overwritten
63540b845a Fix error messages in remote pull and push
75e8a426a5 make sure the unit is removed in tests.systemd test
9089ff5c02 Update tests to use the new tests.systemd stop-unit
44ecd5e56a Move tests.systemd stop-units to stop-unit
01a2a83b4b Update tests.systemd to have stop units as systemd.sh
162e93bd35 update tests.systemd CLI options to be the same than retry command
14aa43a405 new feature to re-run failed spread tests (#39)
604cb782db Fix shellcheck in systemd tool
bfc71082c8 Update the tests.systemd to allow parameters waiting for service status
8a2d0a99df Adding quiet tool and removing set +-x from tests.pkgs
d90935d2a4 A comment explaining about the default values for wait-for
3232c5dba7 Add support for ubuntu 23.04
a7164fba07 remove fedora 35 support, add fedora 37 support
89b9eb5301 Update systems supported
92bb6a0664 Include snap-sufix in the snaps.name tool

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

* add details on tests

* revert fedora snapd.spec deletion

* skip interfaces-{calendar,contacts}-service tests
2023-12-15 12:34:29 +02:00