@cryptotaxi247 / netdata-1 / commits / 08666d902

netdata/packaging: Add more distribution validations (#6235)

* netdata/packaging: Add more distribution validations As an attempt to increase our coverage in testing and to guarantee cross-distribution stability, we choose to extend our baseline tests across all currently supported distributions. We run the stable to current transition test, to maximize scenarios coverage. The missing distributions from the bare OS runs, are covered on the Artifacts validations stage * netdata/packaging: adjust update lifecycle test to be more agile 1) use required packages during setup, to guarantee all stuff there cross-distro 2) add opensuse on entry point script 3) Only bats and curl will be installed prior to the tests. The rest are from the deps script * netdata/packaging: Use the right id for version checking, its opensuse-leap not opensuse * netdata/packaging: small adjustments 1) move deps script outside the bats process 2) don't install curl, we expect it to be there 3) fix tumbleweed tag, it was wrong (duh) * netdata/packaging: wrong place, trigger depedency after curl and bats install. Also, blind install for weird archlinux case missing grep * netdata/packaging: missed one more OS identifier * netdata/packaging: Handle alpine case * netdata/packaging: unattended execution flags * netdata/packaging: its a never ending story.. early install of bash for alpine, to get our job done then * netdata/packaging: fix docker runs - multiple commands should be within the container, just using && doesn't send them to the container, second command rather runs on the host * netdata/packaging: Run sh for the main test script, then trigger bash install within for alpine so that the rest of the process runs smoothly

Paul Emm. Katsoulakis committed Jun 9, 2019 at 20:28 UTC 08666d90237d2e29cb2dcb19f25137f174ed8533
3 files changed +85 -8
.travis.yml
+39 -4
@@ -242,7 +242,7 @@ jobs:
242 - echo "packaging/version:" && cat packaging/version
243 - docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make clean || echo "Nothing to clean"
244 - docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make distclean || echo "Nothing to distclean"
245 - - docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" autoreconf -ivf && ./configure --prefix=/netdata_install/usr --sysconfdir=/netdata_install/etc --localstatedir=/netdata_install/var --with-zlib --with-math --with-user=netdata CFLAGS=-O2
245 + - docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" /bin/bash -c "autoreconf -ivf && ./configure --prefix=/netdata_install/usr --sysconfdir=/netdata_install/etc --localstatedir=/netdata_install/var --with-zlib --with-math --with-user=netdata CFLAGS=-O2"
246 - docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" make dist
247 - docker run -it -v "${PWD}:/netdata:rw" -v "/tmp/netdata-makedist-test:/netdata_install:rw" -w /netdata "netdata/os-test:ubuntu1804" ls -ltr ./netdata-$(git describe).tar.gz || ls -ltr ./netdata-$(cat packaging/version | tr -d '\n').tar.gz
248 - .travis/run_install_with_dist_file.sh
@@ -291,21 +291,56 @@ jobs:
291
292 - stage: "Artifacts validation on bare OS, stable to current lifecycle checks"
293
294 + # Ubuntu runs
295 name: Run netdata lifecycle on Ubuntu 16.04 (xenial)
296 script: sudo -E tests/updater_checks.sh
297 after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 16.04"
298
299 + - name: Run netdata lifecycle, on Ubuntu 19.04 (Containerized)
300 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "ubuntu:19.04" tests/updater_checks.sh
301 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 19.04"
302 +
303 + # Centos runs
304 - name: Run netdata lifecycle on CentOS 7 (Containerized)
305 script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "centos:7" tests/updater_checks.sh
306 after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare CentOS 7"
307
308 + # Debian runs
309 - name: Run netdata lifecycle, on Debian 9 (Containerized)
310 script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "debian:stretch" tests/updater_checks.sh
311 after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Debian 9 (stretch)"
312
306 - - name: Run netdata lifecycle, on Ubuntu 19.04 (Containerized)
307 - script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "ubuntu:19.04" tests/updater_checks.sh
308 - after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Ubuntu 19.04"
313 + # openSuSE runs
314 + - name: Run netdata lifecycle, on openSuSE 15.0
315 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/leap:15.0" tests/updater_checks.sh
316 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/leap:15.0"
317 +
318 + - name: Run netdata lifecycle, on openSuSE 15.1
319 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/leap:15.1" tests/updater_checks.sh
320 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/leap:15.1"
321 +
322 + - name: Run netdata lifecycle, on openSuSE Tumbleweed
323 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "opensuse/tumbleweed:latest" tests/updater_checks.sh
324 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare opensuse/tumbleweed:latest"
325 +
326 + # Alpine runs
327 + - name: Run netdata lifecycle, on Alpine linux
328 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "alpine" tests/updater_checks.sh
329 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Alpine"
330 +
331 + # Arch linux runs
332 + - name: Run netdata lifecycle, on ArchLinux
333 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "archlinux/base:latest" tests/updater_checks.sh
334 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare archlinux/base:latest"
335 +
336 + # Fedora runs
337 + - name: Run netdata lifecycle, on Fedora 28
338 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:28" tests/updater_checks.sh
339 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 28"
340 +
341 + - name: Run netdata lifecycle, on Fedora 29
342 + script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:29" tests/updater_checks.sh
343 + after_failure: post_message "TRAVIS_MESSAGE" "Netdata updater process failed on bare Fedora 29"
344
345 - name: Run netdata lifecycle, on Fedora 30 (Containerized)
346 script: docker run -it -v "${PWD}:/netdata:rw" -w /netdata "fedora:30" tests/updater_checks.sh
tests/updater_checks.bats
-1
@@ -25,7 +25,6 @@ DIRS="usr/sbin/netdata
25 var/log/netdata"
26
27 setup() {
28 -
28 # If we are not in netdata git repo, at the top level directory, fail
29 TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel)")
30 CWD=$(git rev-parse --show-cdup || echo "")
tests/updater_checks.sh
+46 -3
@@ -1,4 +1,4 @@
1 -#!/usr/bin/env bash
1 +#!/usr/bin/env sh
2 #
3 # Wrapper script that installs the required dependencies
4 # for the BATS script to run successfully
@@ -9,6 +9,22 @@
9 #
10
11 echo "Syncing/updating repository.."
12 +
13 +blind_arch_grep_install() {
14 + # There is a peculiar docker case with arch, where grep is not available
15 + # This method will have to be triggered blindly, to inject grep so that we can process
16 + # It starts to become a chicken-egg situation with all the distros..
17 + echo "* * Workaround hack * *"
18 + echo "Attempting blind install for archlinux case"
19 +
20 + if command -v pacman > /dev/null 2>&1; then
21 + echo "Executing grep installation"
22 + pacman -Sy
23 + pacman --noconfirm --needed -S grep
24 + fi
25 +}
26 +blind_arch_grep_install || echo "Workaround failed, proceed as usual"
27 +
28 running_os="$(cat /etc/os-release |grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')"
29
30 case "${running_os}" in
@@ -19,17 +35,44 @@ case "${running_os}" in
35
36 echo "Installing extra dependencies.."
37 yum install -y epel-release
22 - yum install -y git bats curl
38 + yum install -y bats curl
39 ;;
40 "debian"|"ubuntu")
41 echo "Running ${running_os}, updating APT repository"
42 apt-get update -y
27 - apt-get install -y git bats curl
43 + apt-get install -y bats curl
44 + ;;
45 +"opensuse-leap"|"opensuse-tumbleweed")
46 + zypper update -y
47 + zypper install -y bats curl
48 + ;;
49 +"arch")
50 + pacman -Sy
51 + pacman --noconfirm --needed -S bash-bats curl
52 + ;;
53 +"alpine")
54 + apk update
55 + apk add bash curl bats
56 ;;
57 *)
58 echo "Running on ${running_os}, no repository preparation done"
59 ;;
60 esac
61
62 +# Download and run depednency scriptlet, before anything else
63 +#
64 +deps_tool="/tmp/deps_tool.$$.sh"
65 +curl -Ss -o ${deps_tool} https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh
66 +if [ -f "${deps_tool}" ]; then
67 + echo "Running dependency handling script.."
68 + chmod +x "${deps_tool}"
69 + ${deps_tool} --non-interactive netdata
70 + rm -f "${deps_tool}"
71 + echo "Done!"
72 +else
73 + echo "Failed to fetch dependency script, aborting the test"
74 + exit 1
75 +fi
76 +
77 echo "Running BATS file.."
78 bats --tap tests/updater_checks.bats