Commit graph

121 commits

Author SHA1 Message Date
Michael Vogt
87636878da Revert "workflow: run assembler tests in parallel"
This reverts commit ea36e25b09.
2024-03-06 10:43:21 +01:00
Simon Steinbeiss
37d5a23a64 tests: Cancel in-progress tests on PR updates
Before this commit GitHub Action runs that were triggered by a PR were
not canceled when updates were made to the same PR. This lead to even
more clogging of our pipelines and not enough runners being available.

This changes the behavior in a way that whenever a PR gets updated all
still-in-progress runs get canceled and new runs get spawned.
2024-03-05 16:40:34 +01:00
Simon Steinbeiss
b8e0253493 actions: Add a PR best practices check
This pipeline tests:
1. If the PR description is not empty (blocking)
2. If the PR title follows our format (non-blocking)
   `component: This is the change (JIRA-001)`
3. If 1. and 2. are True, it adds a 'best practice' label to the PR
2024-03-05 12:01:10 +02:00
Michael Vogt
ea36e25b09 workflow: run assembler tests in parallel
The assembler tests currently run around 45min, try to run in
parallel to see how much we can win from that.
2024-03-05 07:44:26 +01:00
Michael Vogt
4d2476a26d test: use OSBUILD_TEST_STORE in test_assemblers.py too
Use the OSBUILD_TEST_STORE in the test_assemblers.py file too
and re-use already downloaded sources.
2024-03-05 07:44:26 +01:00
Simon Steinbeiss
75bb706cb0 actions/test: Only test assemblers on Python3.6
Assemblers are only part of v1 manifests, so the only Python version we
need to test is 3.6 (RHEL8).
2024-03-04 14:39:50 +01:00
Michael Vogt
ba732b8532 workflow, osbuild-mpp: run with cache and use GH cache
Share cache between runs and also put into GH cache accross runs.
2024-03-04 14:06:33 +01:00
Michael Vogt
1ea7b4943c workflow: drop python3.11 from matrix (HMS-3697)
With fedora moving to python3.12 we can stop testing on py311.

As a drive-by this commit also documents why we need to test on
py36 and py39.
2024-03-04 13:51:41 +01:00
Achilleas Koutsou
b42e1afddc github: change container storage driver inside test container
The default overlayfs doesn't work inside the container runner which
causes the test to fail with
  Invalid destination name
  containers-storage:localhost/osbuild-skopeo-test-...:
  'overlay' is not supported over overlayfs, a mount_program is
  required: backing file system is unsupported for this graph driver

Changing the driver to vfs solves the issue.
2024-02-21 17:55:37 +01:00
Michael Vogt
3ec0925bff test: drop -k from -k stages/test test matrix
With pytest 8.0.0 the `-k` option seem to have changed it's
behavior. Drop `-k` therefore.

Tests started to fail recently and it looks like this is because
pytest 8.0.0 changes the semantic of the `-k` option. We used
to pass `-k stages/test` but that seems to no longer work. So
pin pytest to the last good version until this is better
understood.
2024-01-31 09:24:59 +01:00
Achilleas Koutsou
54dfe70b41 github: run tests on push again
We've temporarily disabled the merge queue because our tests often
require retries to go all-green and this isn't possible to do on the
queue, meaning that it's close to impossible to get a PR merged.
Run tests on push so that they run in main when a PR is merged.

This reverts commit 63feab7d86.
2023-12-22 19:28:12 +01:00
Achilleas Koutsou
63feab7d86 github: run tests on merge queue
Don't run checks on push to main since the tip of the merge queue is the
same.
2023-12-21 18:47:23 +01:00
Michael Vogt
0edbe0cf96 tests: run the test_stages category in parallel
Run the `test_stages` test in parallel in the github runner. This
test currently takes about 1:30h to 2:30h and running it in parallel
will give us big wins in terms of test time. The time is observed
to go down to 0:30h to 1h.

Note that the other tests are not run in parallel. The reason is
that they fail randomly, it looks like insufficient isolation
between them. Some are easy to fix, e.g.:
721521220b
but it's probably not worth it as the other tests run a lot faster.
2023-11-08 08:10:34 +01:00
Michael Vogt
78238ba0a6 github(workflows): add stages/test to the CI run too
Include the new `stages/test` test category to the CI runs as well.

Note that because `stages/__init__.py` and `stages/test/__init__.py`
are missing it is not possible to use the existing style of just
doing `stages.test`. Adding `stages/__init__.py` feels wrong and
the desire is to have the stages tests close to the stages so this
seems the least invasive way.
2023-11-07 15:12:08 +01:00
Tomáš Hozza
4b44fedbb9 Check: lint Packit configuration as part of CI
This will ensure that our Packit config stays valid.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-31 09:21:02 +01:00
Tomáš Hozza
66b1da022a Actions: add workflow for marking and closing stale issues and PRs
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-06 17:49:43 +02:00
Ondřej Budai
546c8267d1 test/run/stage: cover the btrfs stages
A simple test to make sure that our btrfs stages work.
Updating the testing container is needed, because the old version
didn't have btrfs-progs in it.
2023-08-25 12:35:56 +02:00
Brian C. Lane
68f4c5bd5f tests: Add a check for valid snapshot urls
This pulls the list of snapshots from the rpmrepo API, greps the
codebase for all uses of rpmrepo.osbuild.org that look like a snapshot
name, and then checks to make sure they are still valid.

This is the same script as osbuild-composer, except that it also skips
checking ./test/data/stages/ which has rpm urls that look like snapshot
urls.
2023-08-16 10:40:05 +02:00
Ondřej Budai
330d9d8188 ci: simplify the Python linters
We now have a Makefile target for linting, let's use it in the CI.

Running the linters is pretty fast, so we can just do it in one container.
2023-08-15 03:11:40 +02:00
Simon de Vlieger
10e7046301 ci: drop some Python versions
This limits the list to the Python versions found in current Fedoras,
RHELs, and CentOS Streams.
2023-08-01 15:01:13 +02:00
Simon de Vlieger
d60690ce46 tox: add tox
`tox` is a standard testing tool for Python projects, this allows you to
test locally with all your installed Python version with the following
command:

`tox -m test -p all`

To run the tests in parallel for all supported Python versions.

To run linters or type analysis:

```
tox -m lint -p all
tox -m type -p all
```

This commit *also* disables the `import-error` warning from `pylint`,
not all Python versions have the system-installed Python libraries
available and they can't be fetched from PyPI.

Some linters have been added and the general order linters run in has
been changed. This allows for quicker test failure when running
`tox -m lint`. As a consequence the `test_pylint` test has been removed
as it's role can now be fulfilled by `tox`.

Other assorted linter fixes due to newer versions:
- use a str.join method (`consider-using-join`)
- fix various (newer) mypy and pylint issues
- comments starting with `#` and no space due to `autopep8`

This also changes our CI to use the new `tox` setup and on top of that
pins the versions of linters used. This might move into separate
requirements.txt files later on to allow for easier updating of those
dependencies.
2023-08-01 15:01:13 +02:00
Tomáš Hozza
7cd36f9797 CI: delete duplicate source code check from GitHub action
The test case was testing a subset of the functionality, which is
already tested by test case in `tests.yml`. Delete it, since it does not
add any value.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-04-12 11:57:18 +02:00
Tomáš Hozza
bbdb4fbc32 CI: use latest osbuild-ci container when regenerating test data
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-04-12 11:57:18 +02:00
Tomáš Hozza
c59c5c31de Test: use osbuild-ci container with dosfstools
The `test_mount` test case requires dosfstools to create a FAT
filesystem in a testing image.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-04-12 11:57:18 +02:00
Tomáš Hozza
1a2776bf1b Test: run all tests from test/run in CI
In CI, we list specific tests from `test/run` to run them in parallel.
This is different than what we do with tests in `test/mod` and
`test/src`.

It seems that as a result, we did not run tests from the following
files in CI:
 - `test_devices.py`
 - `test_mount.py`

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-04-12 11:57:18 +02:00
Simon de Vlieger
76a80bd8c5 ci: remove codecov
`codecov` often reports weird diffs and we rarely take action on a
codecov failure in CI.

This closes #1263.
2023-04-01 15:12:58 +02:00
Christian Kellner
51b973f54d ci: update to containers/privdocker@552e30c
The privdocker action got update to node 16, since node 12 is
deprecated and support for it will be remove by summer 2023[1].

[1] https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2022-11-03 12:59:52 +01:00
Christian Kellner
58bafaad98 ci: upgrade to actions/checkout@v3
This uses the new node 16 version (see [1]), which is the future proof
version, since node 12 will be deprecated by summer 2023 (see [2]).

[1] upstream commits:
8f9e05e482
a12a3943b4

[2] https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2022-11-02 00:14:57 +01:00
Jan Macku
5a904f4c39 ci(lint): add shell linter - Differential ShellCheck
It performs differential ShellCheck scans and report results directly in pull request.

documentation: https://github.com/redhat-plumbers-in-action/differential-shellcheck

Co-authored-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-10-26 16:45:09 +02:00
Thomas Lavocat
bc06a037ee manifest-db: propage the osbuild SHA on manifest-db
Add a bot to update the SHA dependency to OSBuild on manifest-db
automatically.

The OSBuild SHA will be changed only if the manifest-db SHA was updated
on the last commit landed on main. This way this ensure that CI ran
successfully for this exact version of OSBuild against manifest-db's
actual state. Therefore it is safe to assume that we can upgrade the
manifest dependency without running the whole CI again.
2022-09-23 14:18:38 +02:00
David Rheinsberg
1bdf038d36 ci: update container and actions
Update the osbuild-ci container and privdocker action to the most recent
builds.

This changes the ostree-image-tests since the Fedora update pulled in
util-linux/fdisk changes that align partition sizes. Hence, the ostree
tests need to be changed to have aligned partition sizes as well. For
more information, see:

    commit 921c7da55ec78350e4067b3fd6b7de6f299106ee
    Author: Karel Zak <kzak@redhat.com>
    Date:   Thu Jan 27 10:50:45 2022 +0100

        libfdisk: (gpt) align size of partition by default

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-23 12:08:10 +02:00
Simon de Vlieger
5cb2da55f1 test: run mypy in test-src not in GH actions 2022-09-09 18:51:57 +02:00
Christian Kellner
561122dd30 ci: add autopep8 check to checks.yml
Add to new autopep8 check to the checks suit. Ideally we would
move the `test.src` test over from tests.yml, but running that
in an updated container leads to a whole lot of new warnings,
most of them related to "unspecified encoding" in `open` calls.
2022-08-05 09:41:05 +02:00
Simon de Vlieger
3fd864e5a9 osbuild: fix optional-types
Optional types were provided in places but were not always correct. Add
mypy checking and fix those that fail(ed).
2022-07-13 17:31:37 +02:00
Simon de Vlieger
ace6c3524b ci: push tags to gitlab
Tags are missing from GitLab (I pushed them once manually) while they
should really be there to be a full mirror.
2022-06-30 10:50:10 +02:00
Simon Steinbeiss
3ffba19205 ci: Adjust release schedule timer
Adjust the timer for our automated releases to trigger the workflow at
8 UTC. This corresponds to 10am in most of our team's timezone and to
the reminder event in our team calendar.
2022-06-15 11:47:41 +02:00
Jakub Rusz
b7a9e9c5a3 workflows/trigger-gitlab: run Gitlab CI in new image-builder project
We have a new project in Gitlab
https://gitlab.com/redhat/services/products/image-builder/ci/osbuild
and we want to run the CI there instead.
2022-04-14 14:42:50 +02:00
Simon Steinbeiss
b1d703a260 Enable scheduled upstream releases
Instead of a human pushing a tag with the release notes let a bot do the
work.
The bot is part of our composite action in osbuild/release-action on the
create-tag branch. It calculates the next subsequent release version and
creates a tag based on pull request titles associated with the changes
since the last release.
Finally the tag is pushed to the repository.

Unfortunately GH Actions don't allow for reliably fortnightly schedules,
so we do an additional check that determines if this is an even or an
odd week. This will help with correctly scheduling alternating osbuild
and osbuild-composer releases.

For reference, we do exactly the same for osbuild-composer already:
https://github.com/osbuild/osbuild-composer/blob/main/.github/workflows/create-tag.yml
2022-03-24 00:04:49 +01:00
Christian Kellner
62dab7be3d ci: add test_executable to test matrix
I don't see a reason as not run the test. Do so.
2022-02-15 13:25:23 +00:00
Alexander Larsson
0c4b83e6e9 Update to the latest osbuild-ci container (with skopeo) 2022-02-10 14:43:17 +01:00
Jakub Rusz
8bc4bff80c tests/ci: add sonarqube scan
Adding sonarqube scan to the pipeline.
2022-01-25 13:23:36 +02:00
Jelle van der Waa
a60af1e205 ci: update osbuild-ci containers image with pacman 2021-12-15 23:22:15 +01:00
Simon Steinbeiss
37c57bf5c9 release-action: Send notification to our Slack channel
Passing the webhook URL is necessary because GH composite actions don't
support handling secrets.
See also osbuild/release-action#3

[skip ci]
2021-12-11 14:06:13 +01:00
Christian Kellner
0aea72e44e ci: run ostree image tests via Schutbot
OSTree tests, especially the fedora-ostree-image one, will soon
need the tight integration with the host for LVM2/LUKS support.
This we cannot run them in github action containers. Move them
to Schutzbot.
Explicitly install the new sub-package until composer gains the
needed requirement.
2021-12-09 00:44:21 +00:00
Christian Kellner
4d9a0b3e9f [skip ci] ci: remove automerge again
Didn't work as expected. :(
2021-12-08 23:02:27 +01:00
Christian Kellner
f26ee9b7dd [skip ci] ci: do not require label for rebase
Allow automerge to update the PR without any labels present.
2021-12-08 16:56:20 +01:00
Christian Kellner
6066407a89 [skip ci] ci: switch to using automerge
Instead of using merify which seems to not do what we want, use
a combination of mergify and automerge. We let mergify review
dependabot PRs. We let mergify dismiss reviews on updates but
exclude those from Schutzbot. We then let Schutzbot update and
merge the PRs via automerge if the `ci:automerge` label is set.
2021-12-08 14:13:43 +01:00
Christian Kellner
055b0203a0 [skip ci] ci: preserve reviews across rebase
Re-review the PR after rebasing it. Leave a message to make it
clear that it was not the impersonated person but mergify that
did it.
Ideally, if we had premium, we would impersonate Schutzbot so
it is clear who did it and then use mergify to dismiss reviews
on changes but not for Schutzbot.
2021-12-08 12:38:28 +01:00
Christian Kellner
eaa00884be [skip ci] ci: review PRs for dependabot
Instead of directly queuing it, just add an auto-review for
dependabot and then let the normal PR condition do its job.
2021-12-08 12:38:28 +01:00
Christian Kellner
daf578b2f1 [skip ci] ci: reviews only for queuing
Require reviews to get into the queue, not out of it.
2021-12-06 23:29:47 +01:00