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] 7fe4148074
    Use /dev/disk/by-id/ to get device symlink in test_BlockSpecial

Closes !4 - Add GitLab CI jobs to build and test GParted
This commit is contained in:
Mike Fleetwood 2018-06-22 15:27:29 +01:00
parent f5e161f698
commit fe2fc33e67
1 changed files with 2 additions and 9 deletions

View File

@ -23,16 +23,9 @@ build:
test:
stage: test
script:
- ls -lR /dev
- ./autogen.sh
- make
# Exclude specific unit test which fails without /dev/disk in Docker images.
- export GTEST_FILTER='-BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches'
- make check
- make distcheck
# Capture all GParted files from the Docker image for investigation.
artifacts:
when: always
name: "$CI_PROJECT_NAME-ci-job-$CI_JOB_ID-$CI_JOB_NAME"
untracked: true
paths:
- ./
expire_in: 1 week