Commit Graph

37 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
a8f56c5be1 ci: Use verbose output in meson by default
Now that we're using TAP parsing, this will show subtest failures in
details but without showing any logging error, that we'd still need to parse
from actual logs.
2023-01-20 15:41:17 +01:00
Philip Withnall
3fad4d45bf Revert "build: Bump Meson dependency to 0.64.0"
This reverts commit 91f14cd058.

The freedesktop SDK, which is used by gnome-build-meta, only has Meson
0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment,
GLib is not buildable in gnome-build-meta and hence can’t be tested in
nightly pipelines against other projects, etc.

That’s bad for testing GLib.

It’s arguably bad that we’re restricted to using an older version of
Meson than shipped by Debian Testing, but that’s a separate discussion
to be had.

Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥
0.64. This also means reverting the simplifications to use of
`gnome.mkenum_simple()`.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064
2022-11-24 12:10:07 +00:00
Philip Withnall
91f14cd058 build: Bump Meson dependency to 0.64.0
It will fix dependency ordering issues found in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2917#note_1559190.

As per `docs/meson-version.md`, we can depend on Meson ≤0.64.0 now as
it’s in Debian Testing.

The FreeBSD runners have to be changed to explicitly install the right
version of Meson using `pip3`, as the system-installed version is not
quite new enough. See
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1596257.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: !2917
2022-11-23 10:39:13 +00:00
Philip Withnall
cbf17c9422 Merge branch 'wip/3v1n0/support-can-fail-tests' into 'main'
meson, ci: Support tests that can fail under certain conditions

See merge request GNOME/glib!2987
2022-10-31 14:28:02 +00:00
Marco Trevisan (Treviño)
3d497b8f5b ci: Show commands run from the test scripts
It allows better debugging in case of failures.
2022-10-31 14:08:31 +01:00
Marco Trevisan (Treviño)
8d5ae3ae83 ci: Mark failing mingw tests as can-fail and do not ignore test failures 2022-10-31 14:08:31 +01:00
Marco Trevisan (Treviño)
62dca6c1cf meson, ci: Support tests that can fail under certain conditions
We have tests that are failing in some environments, but it's
difficult to handle them because:
 - for some environments we just allow all the tests to fail: DANGEROUS
 - when we don't allow failures we have flacky tests: A CI pain

So, to avoid this and ensure that:
 - New failing tests are tracked in all platforms
 - gitlab integration on tests reports is working
 - coverage is reported also for failing tests

Add support for `can_fail` keyword on tests that would mark the test as
part of the `failing` test suite.
Not adding the suite directly when defining the tests as this is
definitely simpler and allows to define conditions more clearly (see next
commits).

Now, add a default test setup that does not run the failing and flaky tests
by default (not to bother distributors with testing well-known issues) and
eventually run all the tests in CI:
 - Non-flaky tests cannot fail in all platforms
 - Failing and Flaky tests can fail

In both cases we save the test reports so that gitlab integration is
preserved.
2022-10-31 14:08:29 +01:00
Marco Trevisan (Treviño)
e320149c39 ci: Add an msys2-clang64 job to run only on schedules
It has enough particularities to require a job to monitor failures
2022-10-31 12:00:53 +01:00
Marco Trevisan (Treviño)
345fbe0666 ci/test-msys2: use $MINGW_PACKAGE_PREFIX 2022-10-31 12:00:53 +01:00
Marco Trevisan (Treviño)
fdaa8a334a ci: Set CFLAGS on msys2-mingw32 in yaml file as it happens for other jobs
Be consistent, and based on this also perform the lcov job or not
2022-10-31 12:00:53 +01:00
Aleksei Rybalkin
8d5a44dc8f replace pcre1 with pcre2 2022-07-12 11:46:34 +00:00
Philip Withnall
03ea524188 ci: Add libpcre2 dependencies and subproject
This is in preparation for porting `GRegex` to libpcre2, which is
happening in !2529. It’s a big port, though, and specially rebuilding
the CI images to add libpcre2 for it is a pain.

Add libpcre2, and then !2529 can drop the old libpcre dependencies when
the port lands.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1085
2022-06-27 15:53:55 +01:00
Marc-André Lureau
c8ce3786d7 gitlab-ci: remove meson-junit-report.py conversion
meson supports JUnit XML format since 0.55.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-05-25 14:10:35 +02:00
Philip Withnall
1bdce46399 build: Bump Meson dependency to 0.60.0
As per the new policy in `docs/meson-version.md`, we can now bump the
dependency.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-05-06 13:01:44 +01:00
Philip Withnall
8e295e23a5 build: Move lcovrc file to root so it’s picked up by Meson
Move the lcovrc file to the root of the project, so that it’s picked up
by Meson when running `ninja coverage` locally.

See https://github.com/mesonbuild/meson/issues/4628

This won’t affect the code coverage run on the CI, since that explicitly
used the lcovrc file already.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-04-28 11:57:45 +01:00
Philip Withnall
46588698e2 build: Bump Meson dependency to 0.52.0
This is what’s available in the new Debian Stable, so we can expect it
to be available pretty much everywhere.

Subsequent commits will clean up old workarounds.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-07 17:15:13 +01:00
Philip Withnall
602528d256 ci: Fix msys-mingw32 CI builds due to package rename
Fix by Christoph Reiter, see
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1879#note_1009843.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-01-19 09:00:54 +00:00
Christoph Reiter
7d1e782c65 CI: Re-enable code coverage reporting for MSYS2 builds
It was disabled in !875 because lcov didn't support the new coverage
format produced by gcc9+. The latest lcov release in MSYS2 supports
it again, so re-enable everything.

lcov now writes native Windows paths to its output so adjust the path
fixup script to handle those.
2020-10-01 14:07:14 +02:00
Christoph Reiter
534a92f35f CI: Make sure we use meson 0.49.2 in MSYS2
pip in MSYS2 seems to install scripts into $USERPROFILE instead of $HOME
which means the MSYS2 meson, which is newer, wins. Make sure $USERPROFILE
is in PATH as well.
2020-05-06 22:07:37 +02:00
Philip Withnall
23d26cfe7e ci: Fix various shellcheck warnings in the shell scripts
I haven’t tested any of them. This is entirely mechanical. I used
shellcheck 0.7.0 with default options.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-27 10:33:45 +00:00
Emmanuele Bassi
fa6f2d4516 ci: Update the MSYS2 build script 2019-07-24 13:08:06 +01:00
Christoph Reiter
ab325c24d5 CI/msys2: disable coverage reporting, lcov doesn't support gcc9 yet
https://github.com/linux-test-project/lcov/issues/58
2019-05-29 18:41:23 +02:00
Christoph Reiter
d258bb5be3 CI/msys2: update to lcov 1.14
lconv 1.13 only supports gcc <=7 and lcov 1.14 supports <=8.
msys2 was just updated to gcc9, so this wont help with coverage support, but
it's a start I guess.
2019-05-29 18:18:45 +02:00
Emmanuele Bassi
95b7a8ab10 ci: Run test coverage for MSYS2 job 2019-04-06 15:31:41 +01:00
Philip Withnall
7058efb390 ci: Don’t run tests tagged as ‘flaky’ on the CI machines
This effectively renders those tests useless (since realistically nobody
runs tests locally), but it’s better than every other CI run failing for
unrelated reasons. The idea is that the ‘flaky’ tag can be temporarily
applied to a test while a problem is being investigated or fixed, and
then removed later.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-09 10:47:24 +00:00
Christoph Reiter
bf032e3e04 ci/msys2: fix path to the lcov config file
It was using a relative path to the source directory but we run lcov
in the build directory.
2018-10-17 18:12:40 +02:00
Philip Withnall
8efe28c570 ci: Add lcov configuration to ignore g_return_*if_fail()/g_assert*()
While we can’t add markers to the macro implementations to cause lcov to
ignore them automatically, we can change our lcov configuration to
ignore all calls to them.

See https://github.com/linux-test-project/lcov/issues/44.

This causes all the un-takeable branches and un-reachable assertions to
be ignored by our code coverage, which bumps our statistics:
 • Lines: 74.9% → 74.8%
 • Functions: 82.3% → 82.3%
 • Branches: 53.3% → 64.2%

The rationale is that nobody should be testing programmer error
handling, as g_return_*if_fail() are used to guard against — so it’s not
reasonable to count missed branches like that in code coverage
statistics.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-10-06 00:19:20 +01:00
Xavier Claessens
4b983e5122 ci: Upgrade meson to 0.48.0 and use --fatal-meson-warnings 2018-09-27 16:00:53 -04:00
Christoph Reiter
70ad484508 gresource-tool: fix build in case libelf is available on Windows. Fixes #1466
The gresource code uses libelf if available but that also depends on mmap but isn't
guarded with HAVE_MMAP. This can make the build fail under MSYS2 where a mingw version
of libelf exists but there is no mmap.

Instead of guarting the libelf code with HAVE_LIBELF add a new macro named USE_LIBELF
which is only defined if libelf and mmap support are available.

Also install the mingw libelf version for CI so we catch similar errors in the future.
2018-08-01 19:08:39 +02:00
Philip Withnall
7c8aaa7e0d Merge branch 'ci-coverage-include-baseline' into 'master'
CI: Include coverage data of code which isn't executed by the test suite.

See merge request GNOME/glib!152
2018-07-06 12:28:52 +00:00
Christoph Reiter
69ae2f4242 CI: Include coverage data of code which isn't executed by the test suite.
See comment in !151. Using the "--initial" option of lcov we collect
the coverage of all compiled files and merge them later into the final
report. This way we can see which files are built but never executed
by the test suite.

Because the --initial switch also collects files in the ccache directory
we have to point it to the build directory instead, which in turn breaks
--no-external. Instead of using --no-external in the collection step,
filter out any files not in the source tree in the final coverage job
through a path filter.
2018-07-06 09:36:01 +02:00
Xavier Claessens
ed8c74461f ci: Install meson 0.47.0 on Windows envs 2018-07-03 16:01:55 -04:00
Christoph Reiter
5dfdcb372f ci: unify the test timeout multiplier across jobs
Introduce a MESON_TEST_TIMEOUT_MULTIPLIER env var and use it in all test scripts.
2018-05-26 20:19:53 +02:00
Christoph Reiter
961be2b0bf ci: collect test coverage and deploy a html report through gitlab pages
Use lcov for both Fedora and MSYS2 to create coverage reports and add a second
ci stage which merges the coverage and creates a html report using genhtml.

In the final stage, which is only run on master, the result is published on
gitlab pages.

https://bugzilla.gnome.org/show_bug.cgi?id=795636
2018-05-02 11:14:45 +01:00
Christoph Reiter
e8798a4c22 ci: update meson
Rebuild the fedora docker image to get the newest meson release and
use pip to install the newest version for MSYS2.

https://bugzilla.gnome.org/show_bug.cgi?id=795711
2018-05-02 11:09:25 +01:00
Christoph Reiter
97c28f7fe1 ci: fix warnings and enable --werror for the mingw build
Fix various warnings regarding unused variables, duplicated
branches etc by adjusting the ifdeffery and some missing casts.

gnulib triggers -Wduplicated-branches in one of the copied files,
disable as that just makes updating the code harder.

The warning indicating missing features are made none fatal through
pragmas. They still show but don't abort the build.

https://bugzilla.gnome.org/show_bug.cgi?id=793729
2018-04-25 17:23:50 +02:00
Christoph Reiter
995f75cdd7 gitlab-ci: Add 32bit MinGW jobs using MSYS2
This builds glib using meson/ninja/ccache with mingw-w64 on a Windows
machine.

The CI scripts expect a gitlab runner to exist with the "win32" tag
which uses the default "cmd" shell by default.

Before running the tests pacman is invoked to update the system
(potentially including bash etc, thus the extra step)
Then a login shell is started with CHERE_INVOKING to not change the
cwd and finally the test script is executed.

https://bugzilla.gnome.org/show_bug.cgi?id=793729
2018-04-25 17:23:49 +02:00