gparted/.gitlab-ci.yml

61 lines
1.7 KiB
YAML
Raw Normal View History

stages:
- build
- test
.centos_image_template: &centos_image_definition
# Use official CentOS image https://hub.docker.com/_/centos/.
image: centos:latest
before_script:
- yum update -y
- yum install -y which gnome-common yelp-tools glib2-devel intltool
gcc-c++ libuuid-devel parted-devel gtkmm30-devel make
polkit file
.ubuntu_image_template: &ubuntu_image_definition
# Use official Ubuntu image https://hub.docker.com/_/ubuntu/.
image: ubuntu:latest
before_script:
- apt-get update
- apt-get install -y gnome-common yelp-tools libglib2.0-dev-bin
uuid-dev libparted-dev libgtkmm-3.0-dev make
policykit-1
.build_stage_template: &build_stage_definition
stage: build
script:
- ./autogen.sh
- nproc=`grep -c '^processor' /proc/cpuinfo` || nproc=1
- echo nproc=$nproc
- make -j $nproc
- make install
.test_stage_template: &test_stage_definition
stage: test
script:
- ./autogen.sh
- nproc=`grep -c '^processor' /proc/cpuinfo` || nproc=1
- echo nproc=$nproc
- make -j $nproc
Exclude unit test which fails in Docker CI image (!4) Fragment of the tests/test-suite.log from the Docker CI image showing details of the unit test failure: Running main() from gtest_main.cc [==========] Running 26 tests from 1 test case. [----------] Global test environment set-up. [----------] 26 tests from BlockSpecialTest ... [ RUN ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches test_BlockSpecial.cc:137: Failure Failed get_link_name(): Failed to open directory '/dev/disk/by-id' test_BlockSpecial.cc:168: Failure Failed follow_link_name(): Failed to resolve symbolic link '' test_BlockSpecial.cc:255: Failure Expected: (lnk.m_name.c_str()) != (bs.m_name.c_str()), actual: "" vs "" [ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches (0 ms) ... [==========] 26 tests from 1 test case ran. (1 ms total) [ PASSED ] 25 tests. [ FAILED ] 1 test, listed below: [ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches 1 FAILED TEST So the code is trying to find a symbolic link to a block device to use in the test. It is trying to read the directory /dev/disk/by-id to find a symbolic link, but the directory doesn't exist in the Docker CI image. The used directory was recently changed [1] to use one which existed on all distributions. Docker images don't even have the /dev/disk directory. Exclude just this specific test. [1] 7fe41480749c795dfb79daeba7b058cece2dfdd2 Use /dev/disk/by-id/ to get device symlink in test_BlockSpecial Closes !4 - Add GitLab CI jobs to build and test GParted
2018-06-22 08:27:29 -06:00
# Exclude specific unit test which fails without /dev/disk in Docker images.
- export GTEST_FILTER='-BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches'
- make check
- make distcheck
# Check GParted can be built and installed on CentOS and Ubuntu.
centos_build:
<<: *centos_image_definition
<<: *build_stage_definition
ubuntu_build:
<<: *ubuntu_image_definition
<<: *build_stage_definition
# Check GParted unit tests and distcheck pass on CentOS and Ubuntu.
centos_test:
<<: *centos_image_definition
<<: *test_stage_definition
ubuntu_test:
<<: *ubuntu_image_definition
<<: *test_stage_definition