Skip to content

Commit 2370564

Browse files
authored
Fix Darwin/MacOS end-to-end test (#3475)
Pass a filtered list of disks to test in the MacOS/Darwin end-to-end test to avoid CI runner changes from disturbing the output. Signed-off-by: Ben Kochie <[email protected]>
1 parent 52f18bc commit 2370564

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/bsd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ jobs:
271271
echo "::endgroup::"
272272
273273
test_macos:
274-
name: Run end-to-end tests on macOS
274+
name: Run end-to-end tests on Darwin/MacOS
275275
runs-on: macos-latest
276276
steps:
277277
- name: Checkout the repository
@@ -308,5 +308,5 @@ jobs:
308308
309309
echo "::group::Run End-to-End Tests"
310310
git config --global --add safe.directory $(pwd)
311-
make test-e2e
311+
make test-e2e E2E_EXTRA_FLAGS='--collector.diskstats.device-include=disk[04]'
312312
echo "::endgroup::"

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ include Makefile.common
2222
PROMTOOL_VERSION ?= 2.30.0
2323
PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz
2424
PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool
25+
E2E_EXTRA_FLAGS ?=
2526

2627
DOCKER_IMAGE_NAME ?= node-exporter
2728
MACH ?= $(shell uname -m)
@@ -121,7 +122,7 @@ tools:
121122
.PHONY: test-e2e
122123
test-e2e: build collector/fixtures/sys/.unpacked collector/fixtures/udev/.unpacked tools
123124
@echo ">> running end-to-end tests"
124-
./end-to-end-test.sh
125+
./end-to-end-test.sh -e "$(E2E_EXTRA_FLAGS)"
125126

126127
.PHONY: skip-test-e2e
127128
skip-test-e2e:

end-to-end-test.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,13 @@ case "${arch}" in
127127
;;
128128
esac
129129

130-
keep=0; update=0; verbose=0
131-
while getopts 'hkuv' opt
130+
extra_flags=""; keep=0; update=0; verbose=0
131+
while getopts 'e:hkuv' opt
132132
do
133133
case "$opt" in
134+
e)
135+
extra_flags="${OPTARG}"
136+
;;
134137
k)
135138
keep=1
136139
;;
@@ -158,6 +161,7 @@ then
158161
fi
159162

160163
collector_flags=$(cat << FLAGS
164+
${extra_flags}
161165
${cpu_info_collector}
162166
--collector.arp.device-exclude=nope
163167
--collector.bcache.priorityStats

0 commit comments

Comments
 (0)