mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
Merge branch 'wip/hadess/installed-tests' into 'master'
ci: Run installed-tests on Fedora See merge request GNOME/glib!1230
This commit is contained in:
commit
75e29305b8
@ -50,12 +50,6 @@ fedora-x86_64:
|
||||
- lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
|
||||
- .gitlab-ci/run-tests.sh
|
||||
- lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
|
||||
# FIXME: We should run all installed tests, but do only this one for now
|
||||
# because it cannot run uninstalled. Reconfigure with dtrace disabled
|
||||
# because it breaks static link.
|
||||
- meson configure -Ddtrace=false _build
|
||||
- ninja -C _build install
|
||||
- GLIB_TEST_COMPILATION=1 $HOME/glib-installed/libexec/installed-tests/glib/static-link.py $HOME/glib-installed/lib/pkgconfig
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/${CI_JOB_NAME}-report.xml"
|
||||
@ -96,6 +90,37 @@ debian-stable-x86_64:
|
||||
- "_build/meson-logs"
|
||||
- "_build/${CI_JOB_NAME}-report.xml"
|
||||
|
||||
installed-tests:
|
||||
extends: .only-default
|
||||
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
||||
stage: build
|
||||
script:
|
||||
# dtrace is disabled because it breaks the static-link.py test
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--werror
|
||||
--prefix=/usr --libdir=/usr/lib64
|
||||
-Dfam=true
|
||||
-Dinstalled_tests=true
|
||||
-Ddefault_library=both
|
||||
-Ddtrace=false
|
||||
_build
|
||||
- ninja -C _build
|
||||
- sudo ninja -C _build install
|
||||
# FIXME: Add update until stable https://bodhi.fedoraproject.org/updates/FEDORA-2019-161b129d4d
|
||||
- sudo dnf upgrade -y --enablerepo=updates-testing --advisory=FEDORA-2019-161b129d4d
|
||||
- GLIB_TEST_COMPILATION=1 gnome-desktop-testing-runner
|
||||
--report-directory=_build/installed-tests-report/failed/
|
||||
--log-directory=_build/installed-tests-report/logs/
|
||||
glib
|
||||
artifacts:
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
paths:
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
- "_build/installed-tests-report/"
|
||||
|
||||
G_DISABLE_ASSERT:
|
||||
extends: .only-default
|
||||
image: registry.gitlab.gnome.org/gnome/glib/fedora:v5
|
||||
|
@ -61,6 +61,24 @@ assert_remove (const gchar *file)
|
||||
g_error ("failed to remove %s: %s", file, g_strerror (errno));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
fuse_module_loaded (void)
|
||||
{
|
||||
char *contents = NULL;
|
||||
gboolean ret;
|
||||
|
||||
if (!g_file_get_contents ("/proc/modules", &contents, NULL, NULL) ||
|
||||
contents == NULL)
|
||||
{
|
||||
g_free (contents);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ret = (strstr (contents, "\nfuse ") != NULL);
|
||||
g_free (contents);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
test_filesystem_readonly (gconstpointer with_mount_monitor)
|
||||
{
|
||||
@ -87,6 +105,18 @@ test_filesystem_readonly (gconstpointer with_mount_monitor)
|
||||
return;
|
||||
}
|
||||
|
||||
/* If the fuse module is loaded but there's no /dev/fuse, then we're
|
||||
* we're probably in a rootless container and won't be able to
|
||||
* use bindfs to run our tests */
|
||||
if (fuse_module_loaded () &&
|
||||
!g_file_test ("/dev/fuse", G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_test_skip ("fuse support is needed to run this test (rootless container?)");
|
||||
g_free (fusermount);
|
||||
g_free (bindfs);
|
||||
return;
|
||||
}
|
||||
|
||||
curdir = g_get_current_dir ();
|
||||
dir_to_mount = g_strdup_printf ("%s/dir_bindfs_to_mount", curdir);
|
||||
file_in_mount = g_strdup_printf ("%s/example.txt", dir_to_mount);
|
||||
|
@ -28,7 +28,7 @@ if not 'GLIB_TEST_COMPILATION' in os.environ:
|
||||
If you wish to run this test, set GLIB_TEST_COMPILATION=1 in the env,
|
||||
and make sure you have glib build dependencies installed, including
|
||||
meson.''')
|
||||
sys.exit(0)
|
||||
sys.exit(77)
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print('Usage: {} <gio-2.0.pc dir>'.format(os.path.basename(sys.argv[0])))
|
||||
|
Loading…
Reference in New Issue
Block a user