Commit graph

107 commits

Author SHA1 Message Date
Thomas Haller b12281089c
gitlab-ci: fix unit tests on centos7 for python-pexpect dependency
Fixes: 9570224e86 ('tests/client: add a pexpect-based test runner')
2022-07-06 18:36:52 +02:00
Thomas Haller d8a4b3bec2
all: reformat with clang-format (clang-tools-extra-14.0.0-1.fc36) and update gitlab-ci to f36 2022-07-06 11:06:53 +02:00
Lubomir Rintel 12fe0ae312 contrib/packages: install pexpect
We'd like to use this for client unit testing.
2022-06-30 10:20:44 +02:00
Lubomir Rintel 28a53403d1 ci: trivial changes to comments
Hopefully for better not worse.
2022-06-27 13:40:09 +02:00
Lubomir Rintel 9fdb6bea44 ci: drop Ubuntu 16.04
It's sad, old and unsupported. Also its gettext is old and smells of
elderberries.
2022-06-27 13:40:09 +02:00
Lubomir Rintel 16a7c1acab gitlab-ci: regenerate images 2022-06-27 09:10:44 +02:00
Thomas Haller 9c07f29e27
gitlab-ci: add f37 and Ubuntu 22.04 containers 2022-05-30 18:01:18 +02:00
Thomas Haller bb605eabc6
gitlab-ci: use "nm-python-black-format.sh" script on "check-tree" 2022-04-01 14:02:23 +02:00
Thomas Haller 11e8b3375f
gitlab-ci: fix archiving build log
During the test, we `tee` the output to a log file in "/tmp".
We do that, because the test script cleans the working directory
several times, so the file cannot reside there.

Afterwards, we need to move the file back into the git-tree, so that
gitlab can archive it.

Previously that was done by "after_script", but the "after_script" may not
see the same "/tmp" as the test run ([1]). This needs to be done as part of the
"script" step.

[1] https://docs.gitlab.com/ee/ci/yaml/#after_script
2022-03-30 11:25:08 +02:00
Thomas Haller e721907472
gitlab-ci: rework extends: for "check-{patch,tree}" jobs
The "check-{patch,tree}" jobs use the same container as the default
test on Fedora ("pages_build", which also builds our documentation).

Previously, we thus extended "t_fedora:35". But that way we also
got things that we didn't want (.nm_artifacts and .build@template).

Solve this differently, by letting the jobs directly define what they
need. It's not much more, than extending "t_fedora:35" and workaround
to drop stuff we don't want.
2022-03-21 17:19:47 +01:00
Thomas Haller 569b9d864f
gitlab-ci: archive log of test
Our test is long and verbose. The output gets truncated after
a few megabytes, but sometimes it's interesting to see what
happens afterwards. Redirect also to a file and archive it.
2022-03-21 17:19:47 +01:00
Thomas Haller bbd053bf83
gitlab-ci: print environment variables not part of run-test.sh script
The output of our test scripts is captured by gitlab. It does however
sanitize things that look like secrets. So it was reasonably save
to call `env` from within the test script.

Next, we will redirect (`tee`) the output of the test script to a
file and archive it. When we do that, the output does not get sanitized
and can be downloaded from the artifacts page.

Stop running `env` as part of the test script. Do it instead as a
separate step. After all, it is useful to see the environment variables
of the test. But sanitized.
2022-03-21 17:19:47 +01:00
Thomas Haller d719bab9f7
gitlab-ci: rename "build.sh" script to "run-test.sh"
It's true, that our gitlab-ci test mostly consists of building NetworkManager.
Hence the name of the script was not entirely wrong. But it's not only building.

I think "run-test.sh" is a much better name. Rename.
2022-03-21 17:19:46 +01:00
Thomas Haller 4cc0f41e45
gitlab-ci: make "contrib/debian/REQUIRED_PACKAGES" verbose during container installation
To help debugging the script.
2022-03-16 21:40:54 +01:00
Thomas Haller c7052a7a7e
gitlab-ci: bump tag to regenerate containers 2022-03-16 00:58:41 +01:00
Thomas Haller c19b5d76c2
contrib: install "policykit-1" package on Debian
This is needed to get "/usr/share/gettext/its/polkit.its",
otherwise msgfmt will fail on Debian:

  /usr/bin/msgfmt: cannot locate ITS rules for data/org.freedesktop.NetworkManager.policy.in
2022-03-16 00:58:28 +01:00
Thomas Haller e4c66b5666
Revert "gitlab-ci: disable CentOS 8 Linux containers"
ci-templates now works around the earlier problem to install CentOS 8
Linux containers. Re-add the tests.

This reverts commit b2d2b8d6fa.
2022-02-21 17:03:37 +01:00
Thomas Haller e73b78637c
gitlab-ci: update ci-templates version
We need the latest fix to bootstrap CentOS 8 Linux containers.

See-also: https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/131
See-also: https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/132
2022-02-21 17:03:37 +01:00
Thomas Haller 613af3251b
gitlab-ci: fix CentOS Linux 8 containers during ".gitlab-ci/fedora-install.sh"
See-also: https://stackoverflow.com/questions/70926799/centos-through-vm-no-urls-in-mirrorlist
See-also: https://techglimpse.com/failed-metadata-repo-appstream-centos-8/
2022-02-21 17:03:36 +01:00
Thomas Haller b2d2b8d6fa
gitlab-ci: disable CentOS 8 Linux containers
CentOS 8 Linux is end of life. That wouldn't bother us, but when
you start such a container

  $ podman run -ti --privileged quay.io/centos/centos:8.3.2011

then `dnf upgrade` will fail, because the mirror list returns
nothing. To work around that, we need to adjust ci-templates ([1]).

The work around might be to patch /etc/yum.repos.d when creating
the container image ([2]).

For now (or maybe indefinitely) disable these build targets.

[1] https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/131
[2] https://stackoverflow.com/questions/70926799/centos-through-vm-no-urls-in-mirrorlist
2022-02-14 17:15:20 +01:00
Thomas Haller a4bc4f63db
gitlab-ci: regenerate ci-templates's containers 2022-02-14 17:02:34 +01:00
Thomas Haller 081510ed94 gitlab-ci: use Fedora 35 as default build target 2021-11-29 09:31:09 +00:00
Thomas Haller 8154285176
gitlab-ci: enable build on f35 and f36
There was a problem that the containers didn't correctly build.
That is now fixed. Reenable f35 and f36 (rawhide).
2021-09-22 10:12:24 +02:00
Thomas Haller dc8c9d4bd2
gitlab-ci: update used ci-templates version
It seems there is a problem building f35/f36 containers. Update
the ci-templates version.
2021-09-22 10:12:24 +02:00
Thomas Haller 82b72a7379
gitlab-ci: drop fedora 28/29 from gitlab-ci
These containers are ancient. Also, when we update ci-templates
they will no longer build (because then a different container hub
will be used, which doesn't contain those images). Drop them.
2021-09-22 10:12:23 +02:00
Thomas Haller 82a6f2c465
contrib: explicitly pass "-n" to "nm-code-format.sh" in gitlab-ci check-tree job
"nm-code-format.sh" is going to change the default behavior from "-n" to
"-i", that is, from check-only to reformat. Explicitly pass "-n" where
we want it.
2021-09-16 08:47:38 +02:00
Thomas Haller 5ad119391a
gitlab-ci: fix regenerating .gitlab-ci.yml
Fixes: 414d2c1d4b ('contrib,gitlab-ci: fix "contrib/fedora/REQUIRED_PACKAGES" to install "vala"')
2021-08-30 23:20:16 +02:00
Thomas Haller ccd398caf7
gitlab-ci: temporarily disable Fedora 35 and 36
It fails to install the container. Disable it, until it is more
stable.

    ...
    Install  363 Packages
    Total download size: 275 M
    Installed size: 1.1 G
    Downloading Packages:
    python3: allocatestack.c:191: advise_stack_range: Assertion `freesize < size' failed.
    ./contrib/fedora/REQUIRED_PACKAGES: line 17:   815 Aborted                 $NM_INSTALL "$@"
    subprocess exited with status 134
    subprocess exited with status 134
    exit status 134
2021-08-30 13:14:00 +02:00
Thomas Haller 203b6fb194
gitlab-ci: update which distros to build 2021-08-30 13:14:00 +02:00
Thomas Haller 53562b1915
contrib: remove "vala-tools" from "contrib/fedora/REQUIRED_PACKAGES"
Since Fedora 25, vala-tools was merged with "vala" package. And on
rawhide (f36) it's gone completely and leads to a failure of the script.

Drop it.
2021-08-30 11:39:01 +02:00
Thomas Haller cf1b726157
gitlab-ci: regenerate ci-templates's containers 2021-07-21 10:11:55 +02:00
Thomas Haller 8dddb7544f
gitlab-ci: regenerate ci-templates's containers 2021-07-12 17:38:49 +02:00
Thomas Haller aba1754a80
gitlab-ci: bump tag for cached container images
This results in a rebuild of the containers, which is a good idea as we
didn't do that for a while.
2021-06-23 21:02:49 +02:00
Thomas Haller fb64935597
gitlab-ci: fix error evaluating "distro.always" in ci.template
...
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1361, in generate
    yield self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File ".gitlab-ci/ci.template", line 178, in top-level template code
    {% if not version in distro.always and (distro.name != pages_build.name or version != pages_build.version) %}
  jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'always'
2021-05-26 22:39:33 +02:00
Thomas Haller 7e581a0303
Revert "contrib: no longer install libuuid as build dependency"
Ups, we actually still require libuuid. Actually, we only need to
to build the example script `examples/C/glib/add-connection-gdbus.c`.
The proper solution would be to make this an optional dependency.

So far this was not yet done. Also, libuuid is really an ubiquitous
dependency on Linux, so it's not really a problem to have this build
dependency, even if it's just to build the examples.

This reverts commit c0a3947ff9.
2021-05-26 22:16:35 +02:00
Thomas Haller 4e7040d46d
gitlab-ci: belatedly regenerate .gitlab-ci.yml 2021-05-26 21:45:51 +02:00
Thomas Haller 901f0bdeb3
gitlab-ci: fix running Fedora 34 test by default
- the container that is also "pages_build" should always
  run automatically. This can replace the "always" tag.

- comment out the "always: 33" part, because we no longer need
  it. It was also wrong, because by now we should run Fedora 34
  automatically.
2021-05-04 15:42:26 +02:00
Thomas Haller ebde0a3506
gitlab: update pages build to use Fedora 34 container 2021-05-04 13:56:28 +02:00
Thomas Haller b32dc4f2cf
gitlab: add Fedora 34 container for CI pipeline 2021-05-04 13:56:25 +02:00
Thomas Haller 94ba38962f
contrib: install clang-format via REQUIRED_PACKAGES
On Fedora 33, we get it automatically because "clang" package
has an indirect (weak) dependency for clang-tools-extra. On
Fedora 34, that is no loger the case.

We need to explicitly install it.
2021-05-04 13:56:19 +02:00
Thomas Haller 371b64bd70
gilab-ci: update .gitlab-ci.yml to use "main" branch name 2021-04-01 21:43:01 +02:00
Thomas Haller 7e32c3efda
gitlab-ci: generate new container images for tests
- the python-black version on Fedora 33 was updated, and this formats
  our python code differently. The black version that is used by our
  gitlab-ci is the authoritative version that should be used. Update
  it by regenerating the containers.

- especially Fedora:rawhide and Debian:sid often introduce changes that
  will cause a break of our build. Update the containers to test latest
  versions.
2021-01-28 14:50:39 +01:00
Thomas Haller 81e0837678
gitlab-ci: install missing packages on Alpine Linux
The "contrib/alpine/REQUIRED_PACKAGES" script is also
used by gitlab-ci to setup the test container. These
packages are required for unit tests.
2020-12-23 10:48:26 +01:00
Thomas Haller a1002bd93a
gitlab-ci: enable test build on alpine linux
Alpine is especially interesting because it uses musl as libc.

The build does not yet succeed. There are several issues that
need to be fixed.

However, it will be simpler to fix things, if we have tests
in place -- even if at the moment they are known to be broken.

See-also: https://git.alpinelinux.org/aports/tree/community/networkmanager?h=master
2020-12-11 18:14:10 +01:00
Thomas Haller a6e234349c
gitlab-ci: update used "ci-templates" version 2020-12-11 18:14:10 +01:00
Thomas Haller 4ce62b6df3
gitlab-ci: fix failure to enable PowerTools on CentOS8 build
Seems that the repository was renamed (or can sometimes have
a different name). Try both the "PowerTools" and "powertools" name.
2020-12-11 18:06:52 +01:00
Thomas Haller d07cd5dbf2
all: avoid GNU "which" from shell scripts
"which" is a separate package and may not be installed.
Also, shell has a built-in command for the same purpose.
Use that.
2020-12-11 16:42:23 +01:00
Thomas Haller 9960c8d727
gitlab-ci: add CentOS 7.9 and 8.2 images 2020-11-24 18:44:11 +01:00
Peter Hutterer 133de4ab59
gitlab CI: remove leftover comments referring to libinput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/684
2020-11-18 08:36:13 +01:00
Thomas Haller 0e7e88cfc7
gitlab-ci: combine ubuntu/centos install scripts with their debian/fedora counterparts
Ubuntu/Debian and CentOS/Fedora are sufficiently similar that it's
better that we have only one variant of ".gitlab-ci/*-install.sh"
and "contrib/*/REQUIRED_PACKAGES".

This was already the case, however, we used to symlink
".gitlab-ci/centos-install.sh" to "fedora-install.sh". That
worked, but it didn't scale very well. For example, if we would follow
that pattern, we would also need a symlink "contrib/centos/REQUIRED_PACKAGES"
Or should "contrib/centos" symlink to "contrib/fedora"? That seems even
more wrong.

We already had the "distro.base_type" variable for that. Make use of
that also for the install script.
2020-11-17 13:28:18 +01:00