Commit graph

79 commits

Author SHA1 Message Date
Thomas Haller 67da2b8e42
gitlab-ci: fix test script to abort on failing first test
Fixes: 89cfd34ae0 ('gitlab-ci: extend run-test.sh script to manually select certain build steps to run')
2023-01-30 08:18:45 +01:00
Fernando Fernandez Mancera 74f66ee276
gitlab-ci: fix CentOS Linux 9 containers during ".gitlab-ci/fedora-install.sh"
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1511
2023-01-24 08:17:44 +01:00
Thomas Haller 01730f5943
gitlab-ci: set OMP_NUM_THREADS=1 to avoid libgomp crash for msgmerge
It's not clear why this happens. But since recently in our gitlab-ci,
all the Fedora machines will fail. It happens in the step

  check_run_clean 6 && test $IS_FEDORA = 1 -o $IS_CENTOS = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson

which explains why it only affects Fedora configurations.

It does not always fail, but the probability of failure is high.
The failure is:

  ...
  rm -f et.gmo && /usr/bin/msgmerge --for-msgfmt -o et.1po et.po NetworkManager.pot && /usr/bin/msgfmt -c --statistics --verbose -o et.gmo et.1po && rm -f et.1po
  libgomp: Thread creation failed: Resource temporarily unavailable
  make[3]: *** [Makefile:383: et.gmo] Error 1

Maybe some new resource restricting in gitlab. Let's add this workaround.
I don't really understand the cause, but this seems to avoid it, which is
good enough for me.
2023-01-19 19:31:28 +01:00
Thomas Haller 1e883ab6e6
gitlab-ci: avoid clean step in "run-test.sh" for manual invocation
When we run `NM_TEST_SELECT_RUN=x ./.gitlab-ci/run-test.sh` to run one
step only, we should not do the final clean, so that the build artifacts
are preserved.
2023-01-19 15:04:46 +01:00
Thomas Haller 8ece80390d
gitlab-ci: bump ci-templates tag to generate new container images 2023-01-18 19:38:49 +01:00
Thomas Haller 81c1168a2d
gitlab-ci: add comment about how to regenerate ".gitlab-ci.yml" 2022-11-29 08:31:38 +01:00
Thomas Haller 89cfd34ae0
gitlab-ci: extend run-test.sh script to manually select certain build steps to run
When the test in gitlab-ci fails, you might want to rerun the test
on your machine. You fire up podman, run "./.gitlab-ci/*-install.sh"
and "./.gitlab-ci/run-test.sh".

Make it possible to manually select parts that are tested by
"run-test.sh" by setting NM_TEST_SELECT_RUN. Otherwise, if you want to
test a particular configuration, you either have to run all earlier
steps (which takes a long time and can even be broken) or you have
to manually patch the file.

For example,

  NM_TEST_SELECT_RUN=6 ./.gitlab-ci/run-test.sh
2022-11-23 16:51:54 +01:00
Thomas Haller 941f998792
gitlab-ci: update default Fedora image for building pages and check steps
We want to follow current Fedora, so update to f37.

Also, we now use clang-format from Fedora 37 release, so the default
image in gitlab-ci must match, because that image is used for the
"check-tree" test.
2022-11-23 09:18:43 +01:00
Thomas Haller 1106146bfd
gitlab-ci: update to latest ci-templates version 2022-11-23 09:17:55 +01:00
Thomas Haller 2d0170ca7c
gitlab-ci: update ci-templates version 2022-10-11 09:47:39 +02:00
Thomas Haller dc2cbe1858
gitlab-ci: enable F38 container and regenerate containers 2022-10-11 09:47:39 +02:00
Thomas Haller 7ee0da3eaf
build: don't "update-po" during make dist
Instead, hack gettext's Makefile.

gettext has an issue with parallel make. See [1] and [2].
Reproduce with:

  git reset --hard &&
    git clean -fdx &&
    NOCONFIGURE=yes ./autogen.sh &&
    ./configure --enable-gtk-doc --enable-introspection &&
    make -j distcheck V=1

We worked around this by setting "DIST_DEPENDS_ON_UPDATE_PO = yes",
however that (obviously) results in regenerating source files during
dist. "Source files" in the sense that the po files are commited to git
and get distributed in the release. Doing this is very ugly.

In particular it's ugly, because `make -C po update-po` is not reproducible
and the output depends on the current time (*had one job*).
Otherwise, we could just regenerate the files before doing a release.

This means, running "release.sh" script ends up with a dirty tree
afterwards. Also, the distributed po files are not the ones from the source
tree when we did the release. Also, since "release.sh rc1" does two distributions
(once for the rc1 and once for the next devel snapshot), the commit for the
second distribution will have a large diff for the po files.

This reverts commit 978d8eb699 ('po: make dist depend on update-po')
and hacks around the problem.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1094#note_1435313
[2] https://lists.gnu.org/archive/html/bug-gettext/2022-06/msg00022.html

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1405
2022-10-03 17:50:09 +02:00
Thomas Haller 991481a568
gitlab: fail if "run-test.sh" with dirty working tree 2022-10-03 17:50:03 +02:00
Thomas Haller 7eaec52899
gitlab-ci: fix preserving build artifacts and documentation pages
Without it, the build artifacts were deleted before getting archived.
It means, the tarball and the docs were no longer archived and no
pages on gitlab no longer updated.

Fixes: e118276296 ('gitlab-ci: run unit tests for git subtree subprojects')
(cherry picked from commit cfe44c8832)
2022-08-24 20:57:51 +02:00
Thomas Haller bde99436aa
gitlab-ci: print git-status during do_clean() in "run-test.sh"
If we have a non-clean working directory after do_clean(), that
is a bug and something we need to investigate. Print information
to make that easier to debug.
2022-07-25 10:27:40 +02:00
Thomas Haller e118276296
gitlab-ci: run unit tests for git subtree subprojects 2022-07-25 10:27:40 +02:00
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 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 978d8eb699 po: make dist depend on update-po
This works around a race condition with gettext Makefile.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1094#note_1435313
2022-06-27 13:40:09 +02:00
Lubomir Rintel 16a7c1acab gitlab-ci: regenerate images 2022-06-27 09:10:44 +02:00
Lubomir Rintel 85d09bc246 gitlab: fix Ubuntu 18.04 image creation
Or, well, work around a bug.
2022-06-27 09:09:40 +02:00
Thomas Haller 68e9f92a81
gitlab-ci: test build with python2 on Centos7
Currently, for all tests we have python3 installed. So effectively,
even on CentOS 7, we would test the build with python3 only.

The package build on CentOS7/epel7 however uses python2. This happens
for example for our copr builds.

Also test that configuration in gitlab-ci.
2022-06-02 14:35:04 +02:00
Thomas Haller 9c07f29e27
gitlab-ci: add f37 and Ubuntu 22.04 containers 2022-05-30 18:01:18 +02:00
Thomas Haller f6f961f381
gitlab-ci: avoid pager for "run-test.sh"
In particular, `dpkg -l` likes to show a pager, when you are on the
terminal. Being on the terminal happens, if you try to reproduce
a test on your own container. So let's avoid that.
2022-05-11 22:12:56 +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 12299ee91e
build: drop "check-python-black" check from autotools
Previously, autotools would detect whether we have "black"
in the path. And if so, it would check formatting during `make check`.

That's problematic. When I run `./contrib/fedora/rpm/build_clean.sh -w test`
in certain cases, it would pick up black, but then fail with

  Traceback (most recent call last):
    File "/usr/bin/black", line 5, in <module>
      from black import patched_main
    File "/usr/lib/python3.6/site-packages/black.py", line 42, in <module>
      from attr import dataclass, evolve, Factory
  ModuleNotFoundError: No module named 'attr'
  make[3]: *** [Makefile:21658: check-python-black] Error 1

That's an installation error of black, but still, during package build
there is no need to check the formatting. We could export
`NMTST_SKIP_PYTHON_BLACK=1` to prevent it, but it's still unnecessary.

We check proper formatting in gitlab-ci. That is enough, it doesn't
need to run during `make check`. In particular, because `black .`
takes 1.5 seconds on my machine.
2022-04-01 14:01:45 +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 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 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 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