Skip to content

Commit 2becbe3

Browse files
committed
Fix tests issues after sync with upstream
1 parent 485ee13 commit 2becbe3

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ update_fixtures:
117117
.PHONY: tools
118118
tools:
119119
@rm ./tools/tools >/dev/null 2>&1 || true
120-
@$(GO) build -o tools ./tools/...
120+
@$(GO) build -o tools/tools ./tools/...
121121

122122
.PHONY: test-e2e
123123
test-e2e: build collector/fixtures/sys/.unpacked collector/fixtures/udev/.unpacked tools

end-to-end-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -euf -o pipefail
44

55
# Allow setting GOHOSTOS for debugging purposes.
6-
GOHOSTOS=${GOHOSTOS:-$(go env GOHOSTOS)}
6+
GOHOSTOS=${GOHOSTOS:-$(go env GOHOSTOS 2>/dev/null || uname -s | tr '[:upper:]' '[:lower:]')}
77

88
# Allow setting arch for debugging purposes.
99
arch=${arch:-$(uname -m)}

node_exporter.spec

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export PATH=$PATH:%{_tmppath}/go/bin
4747
export GOROOT=%{_tmppath}/go
4848
export GOPATH=%{_tmppath}
4949
make build
50+
make tools
5051
make test
5152
# run cross-testing
5253
%ifarch x86_64 amd64 ia32e
@@ -68,6 +69,11 @@ mkdir -p $RPM_BUILD_ROOT/opt/node_exporter_tests/collector
6869
cp -r collector/fixtures $RPM_BUILD_ROOT/opt/node_exporter_tests/collector/
6970
install -D -m 755 end-to-end-test.sh $RPM_BUILD_ROOT/opt/node_exporter_tests/end-to-end-test.sh
7071
install -D -m 755 node_exporter $RPM_BUILD_ROOT/opt/node_exporter_tests/node_exporter
72+
mkdir -p $RPM_BUILD_ROOT/opt/node_exporter_tests/tools
73+
install -D -m 755 tools/tools $RPM_BUILD_ROOT/opt/node_exporter_tests/tools/tools
74+
75+
# remove broken symlinks
76+
find $RPM_BUILD_ROOT/opt/node_exporter_tests/collector/fixtures -xtype l -delete
7177

7278
# write package version to file
7379
if [[ ! -d "$RPM_BUILD_ROOT%{cl_dir}" ]]; then

0 commit comments

Comments
 (0)