327 Commits

Author SHA1 Message Date
Sergio Cazzolato
f40b9595a1 tests: remove centos 7 support (#14147)
* tets: remove support for centos-7

Centos-7 is EOL since June-30

Signed-off-by: Sergio Cazzolato <sergio.cazzolato@canonical.com>

* update the release_tst.go with the real centos 9 info

---------

Signed-off-by: Sergio Cazzolato <sergio.cazzolato@canonical.com>
2024-07-04 11:28:21 -03:00
Valentin David
b1dc3c675d tests: properly build snapd snap (#14141)
* tests: properly build snapd snap

Now we build also the test version of snapd snap in `snap-builds`
workflow job. We copy this into the spread tests. And we use that
snap, which we only instrument instead of copying the snapd deb build.

If the snap is not available, then we build it in spread. On CI, this
happens on arm since the workflow does not build it. It will also
happen when triggering test manually.

* tests: couple of small improvements to test syntax, move WORK_DIR into script scope, use PWD instead of dot notation

---------

Co-authored-by: Philip Meulengracht <the_meulengracht@hotmail.com>
2024-07-03 13:36:31 +02:00
Sergio Cazzolato
a58ebef253 tests: fix change_id used for grafana (#14148)
Currently all the changes sent to grafana are sent as main because the
check in the testing workflow is done incorrectly
2024-07-02 09:01:44 -03:00
Sergio Cazzolato
ea13a33521 tests: filter spread logs to be sent to grafana (#14127)
* tets: filter spread logs to be sent to grafana

Use log-filter tool to generate a .filtered.log file which is sent to
grafana.

Those filtered logs dont include the error and debug output, just the
executed tests and the results.

* Create a new step in the workflow to setup grafana parameters and tests to run

* Update .github/workflows/test.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* this is not needed to have the log filter in the testing tools

---------

Co-authored-by: Oliver Calder <oliver@calder.dev>
2024-06-27 20:39:06 -03:00
Maciej Borzecki
ac9dfd166d github: create group and home for test-user
The cloud images of opensuse have changed a little and now the neither the group
nor home is created by default when using useradd.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-06-24 14:59:35 +02:00
Sergio Cazzolato
7f9afe80e4 tests: run spread tests in fedora-40 (#14099)
* Adding new backends

As we cannot update the spread.yaml with the new backends, because
spread from master does not supported them. I added the new file with
the definitions which can be merged when it needs to be used.
A merging tool is comming next

* Add env details to openstack spread.yaml

* update disk for openstack

* update testflinger yaml config files

* openstack systems updated

* new script to add backend to spread.yaml

* add backend also to get failed tests

* add more workers to run fedora-40 tests
2024-06-20 09:20:20 -03:00
Sergio Cazzolato
f41c361055 tests: install pylint in nightly tiobe tics run
pylint is missing from the environment. TiCS uses pylint for CS of
python.
2024-06-18 12:46:17 +02:00
Maciej Borzecki
230a885854 github: enable FIPS build
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-06-18 10:11:23 +02:00
Maciej Borzecki
6df7ad04a4 github: optionally use Go FIPS toolchain during the build
Enable building on the snapd snap using the Go FIPS toolchain.

Related: SNAPDENG-17924

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-06-18 10:11:23 +02:00
Sergio Cazzolato
3f5225c2aa tests: new spread log utils (#14062)
* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1c8efb77e1..496cb7b5b3

496cb7b5b3 removing support for centos-8
f2eef30db4 Updated the log helper and log parser
5a375ebf73 Formatting for python utils
d3eed3faa5 fix codespell in CODE_OF_CONDUCT.md
18bcca6b14 new log helper
d60381fcd9 add run number to filtered filename
5dde2d67b8 consider the tests execution in main
6b9a3aabcc change filtered log name
b2756aa579 default file is .filtered.log
500b9dace4 Fix tests workflow
45db26a3d2 fix shellcheck error in log-filter
fe45c27b7d create a var to store filter params
5a9b66d7dc filter spread results
51f9b055af New tool used to filter the spread.log output
b8d20c1d5b fix snaps.name test with correct siffix spelling
f640ac72e3 Add missing test details
f0754df304 Filter the error y debug output in log-parser
fc10196efd Add suggestions to details
94ac5ffe58 Add details on tests
501578c719 add more checks in os.query to check is-core_xx
e8929207ff fix os-query for ubuntu comparing with core
226114641f os.query won't check SPREAD_SYSTEM anymore to compare core systems
b89ec98b23 use local variables in os.query tool
dacfd81de9 fix is_core functions
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: 496cb7b5b3c160dc86e84fb7adca3bd5c862e88e

* log-parser does not support anymore --print-detail

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 496cb7b5b3..cc68c9868b

cc68c9868b Added type annotations for log-filter
66f90d10cd Adding -O to scp command to make it compatible in uc24 tests

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

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from cc68c9868b..18615b1667

18615b1667 just usc scp -O when ssh version is -ge 9

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

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 18615b1667..1ff651e680

1ff651e680 update wording of remote.pull

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

* Update tests/lib/external/snapd-testing-tools/tests/remote.retry/task.yaml

Co-authored-by: Zygmunt Bazyli Krynicki <me@zygoon.pl>

* fix merge issue

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 1ff651e680..58da1e36c3

58da1e36c3 mypy cleaned

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

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from 58da1e36c3..b4a5439c9b

b4a5439c9b added more type annotatios to log_helper

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

* Squashed 'tests/lib/external/snapd-testing-tools/' changes from b4a5439c9b..6f6187416d

6f6187416d fix list implementation

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

---------

Co-authored-by: Zygmunt Bazyli Krynicki <me@zygoon.pl>
2024-06-14 08:55:22 -03:00
Sergio Cazzolato
fcc88ee1fd tests: remove tiobe tics checks for prs (#14081)
This is required because tics tools requires 10GB of disk space in the
runners to run. Tics creates a cache with tools used for processing the
changes that can go up to 10GB, and that makes our self-hosted runners
to go out of space.

In the future, when we create new runners, I'll condifer that disk space
constrain
2024-06-13 15:03:58 -03:00
Sergio Cazzolato
23f572ba10 tests: remove centos-8 support (#14056)
Centos-8 support is removed as it is EOL
2024-06-10 14:17:26 -03:00
Maciej Borzecki
4dd3f905bc spread, github: add Ubuntu 24.10 (#14012)
* spread: add Ubuntu 24.10

Add Ubuntu 24.10 Oracular Oriole

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

* github: move 24.04 to separate group, point daily at 24.10

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

* add missing tests in spread job

---------

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Co-authored-by: Sergio Cazzolato <sergio.cazzolato@canonical.com>
2024-06-07 18:07:09 -03:00
Sergio Cazzolato
3dad6eb5ea tests: reduce tests for trusty (#14045)
* tests: reduce tests for trusty

The idea of this change in to run on ubuntu trusty just the following
tests:
 . tests/smoke/
 . tests/main/canonical-livepatch
 . tests/main/canonical-livepatch-14.04

* removing use of spread-arm

Now spread is able to create arm instances in google backend

* fix error from merge
2024-06-07 18:04:33 -03:00
Sergio Cazzolato
43d756ca4a tests: unification between spread and spread-nested in workflow/test.yaml (#14032)
* Unification between spread and spread-nested in workflow/test.yaml

The idea is to put togeter all the spread tests and use the groups to
differentiate the nested and non nested tests.

With this change, we can reduce the complexity of this file by removing
duplicated parts.

* fix condition for nested tests

* Chage the condition to run spread tests

* change comparison for matrix.nested value

* fix check for run nested

* update how is compared the boolean in if condition

* use matrix-nested as string

* remove matrix.nested

* fix if condition

* Fix export for nested

* fix re-execution scenario
2024-06-07 16:38:35 -03:00
Sergio Cazzolato
449fbd72df tests: use no-debug-output for spread (#14054)
* tests: use no-debug-output for spread

-no-debug-output makes spread skip the debug output
-logs is used to store the logs generated (similar as artifacts is used)

* remove spread-arm

* fix workflow error
2024-06-06 15:19:30 -03:00
Ernest Lotter
ee7387f4d4 .github/workflows: enable test workflow to retrieve pr labels for any repo (#14048) 2024-06-05 10:04:51 +02:00
Sergio Cazzolato
f6bfb549d2 tests: simplify the pr-title check
The check-pr-title.py was created when we used travis (a long time ago).

Now, in github actions we can access to the pr title from ${{
github.event.pull_request.title }}

The idea of this change is to avoid checking in the github api and
simplify the check-pr-title.py tool.

This also is required to be able to use this check in private projects
where a unauthenticated api call is not allowed.

Also it is removed from the actions workflow the pr number variables
which are not used.
2024-05-30 10:55:09 +02:00
Sergio Cazzolato
be201c4997 tests: update check-pr-title script to use it in forked projects (#14020)
This is needed to be able to check pr titles in forked projects.
2024-05-29 21:20:44 +02:00
Valentin David
7846d6ab02 snapcraft.yaml: build on 22.04
In order to build from 22.04, we provide all runtime libraries in the
resulting snap. The glibc dynamic linker (ld.so) is rebuilt to only
load libraries from the snap at /snap/snapd/current, and not from the
host system. All ELF binaries have their interpreter path patched to
use that dynamic linker.

This stops using the build from dpkg. Binaries that are not used from
the snapd snap have also been removed.

Snapcraft 8.x is expected now to build the snap.
2024-05-29 14:13:55 +02:00
Ernest Lotter
16917f4bd7 tests: run test workflow on security release PRs (#14011) 2024-05-29 10:43:35 +02:00
Sergio Cazzolato
84106089df tests: skip tics tool installation in self-hosted runners (#13993)
This step is not required because the tool was already installed in the
self-hosted runners. This is needed to avoid requesting the secret with
the tics token.
2024-05-23 23:19:15 +02:00
Sergio Cazzolato
79f717ba8c tests: moving out google machines from us-east1-b (#13992)
* tests: moving out google machines from us-east1-b

The region us-east1 is shared among project. In order to avoid reaching
the instances quota we are moving out to europe regions.
The idea of moving to europe is because the CI is in the UK.

From now, we will have 5 regions for snapd (4 in europe and 1 in the USA
for sru and nested)

* update checks in tests

check the name google is in SPREAD_BACKEND
2024-05-22 23:07:57 +02:00
Sergio Cazzolato
ef18e9a154 tests: run static analysis for prs in self-hosted runners (#13855)
* tests: run static analysis for prs in self-hosted runners

With this change the prs will run static analysis

* update the static analysis workflow

* change job name to tiobe-static-analysis
2024-05-17 14:24:27 +02:00
Maciej Borzecki
9b4dad3027 github: leave TODO about running unit tests of C code on Ubuntu
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-04-29 14:42:52 +02:00