summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.github/workflows/unit_tests.sh20
-rw-r--r--.github/workflows/unit_tests.yml8
-rw-r--r--README.md1
-rw-r--r--src/test/meson.build2
4 files changed, 26 insertions, 5 deletions
diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh
index e85c321001..4188047cf0 100755
--- a/.github/workflows/unit_tests.sh
+++ b/.github/workflows/unit_tests.sh
@@ -6,7 +6,9 @@ ADDITIONAL_DEPS=(
clang
expect
fdisk
+ iproute2
jekyll
+ lcov
libfdisk-dev
libfido2-dev
libp11-kit-dev
@@ -18,6 +20,7 @@ ADDITIONAL_DEPS=(
perl
python3-libevdev
python3-pyparsing
+ util-linux
zstd
)
@@ -42,10 +45,21 @@ for phase in "${PHASES[@]}"; do
if [[ "$phase" = "RUN_CLANG" ]]; then
export CC=clang
export CXX=clang++
+ # The docs build is slow and is not affected by compiler/flags, so do it just once
+ MESON_ARGS+=(-Dman=true)
fi
- meson --werror -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true -Dman=true build
+ if [[ "$phase" = "RUN_GCC" ]]; then
+ MESON_ARGS+=(-Db_coverage=true)
+ # See FIXME below
+ (set +x; while :; do echo -ne "\n[WATCHDOG] $(date)\n"; sleep 30; done) &
+ fi
+ meson --werror -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true "${MESON_ARGS[@]}" build
ninja -C build -v
- meson test -C build --print-errorlogs
+ # Some of the unsafe tests irreparably break the host's network connectivity, so run them in a namespace
+ unshare -n bash -c 'ip link set dev lo up; meson test -C build --print-errorlogs'
+ if [[ "$phase" = "RUN_GCC" ]]; then
+ ninja -C build coverage
+ fi
;;
RUN_ASAN_UBSAN|RUN_GCC_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN)
MESON_ARGS=(--optimization=1)
@@ -74,7 +88,7 @@ for phase in "${PHASES[@]}"; do
# during debugging, wonderful), so let's at least keep a workaround
# here to make the builds stable for the time being.
(set +x; while :; do echo -ne "\n[WATCHDOG] $(date)\n"; sleep 30; done) &
- meson test --timeout-multiplier=3 -C build --print-errorlogs
+ unshare -n bash -c 'ip link set dev lo up; meson test --timeout-multiplier=3 -C build --print-errorlogs'
;;
CLEANUP)
info "Cleanup phase"
diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml
index ca1e6e0c30..ade9323cbb 100644
--- a/.github/workflows/unit_tests.yml
+++ b/.github/workflows/unit_tests.yml
@@ -16,8 +16,14 @@ jobs:
run_phase: [GCC, GCC_ASAN_UBSAN, CLANG, CLANG_ASAN_UBSAN]
steps:
- name: Repository checkout
- uses: actions/checkout@v1
+ uses: actions/checkout@v2
- name: Install build dependencies
run: sudo -E .github/workflows/unit_tests.sh SETUP
- name: Build & test (${{ matrix.run_phase }})
run: sudo -E .github/workflows/unit_tests.sh RUN_${{ matrix.run_phase }}
+ - name: Coveralls
+ if: matrix.run_phase == 'GCC' && github.repository == 'systemd/systemd'
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ path-to-lcov: ./build/meson-logs/coverage.info
diff --git a/README.md b/README.md
index 6734e92a24..180b34de22 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@ System and Service Manager
[![CentOS CI - Arch](https://jenkins-systemd.apps.ocp.ci.centos.org/buildStatus/icon?subject=CentOS%20CI%20-%20Arch&job=upstream-vagrant-archlinux)](https://jenkins-systemd.apps.ocp.ci.centos.org/job/upstream-vagrant-archlinux/)<br/>
[![CentOS CI - Arch (sanitizers)](https://jenkins-systemd.apps.ocp.ci.centos.org/buildStatus/icon?subject=CentOS%20CI%20-%20Arch%20(sanitizers)&job=upstream-vagrant-archlinux-sanitizers)](https://jenkins-systemd.apps.ocp.ci.centos.org/job/upstream-vagrant-archlinux-sanitizers/)<br/>
[![Fossies codespell report](https://fossies.org/linux/test/systemd-main.tar.gz/codespell.svg)](https://fossies.org/linux/test/systemd-main.tar.gz/codespell.html)</br>
+[![Coverage Status](https://coveralls.io/repos/github/systemd/systemd/badge.svg?branch=main)](https://coveralls.io/github/systemd/systemd?branch=main)</br>
[![Packaging status](https://repology.org/badge/tiny-repos/systemd.svg)](https://repology.org/project/systemd/versions)
## Details
diff --git a/src/test/meson.build b/src/test/meson.build
index f58cf2d843..04c5b6ba42 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -371,7 +371,7 @@ tests += [
[['src/test/test-hashmap.c',
'src/test/test-hashmap-plain.c',
test_hashmap_ordered_c],
- [], [], [], '', 'timeout=90'],
+ [], [], [], '', 'timeout=180'],
[['src/test/test-set.c'],
[libbasic]],