Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/tests: add test for prometheus exporters #48055

Merged
merged 3 commits into from Oct 11, 2018

Conversation

WilliButz
Copy link
Member

Things done
  • set the default value of RestartSec for the varnish exporter service to avoid unrecoverable crashes (during a restart of varnish for example)
  • fixed the default service settings (Restart, PrivateTmp and WorkingDirectory) which where falsely ignored before for all prometheus exporters
  • added a test for all available exporters (excluding minio and unifi) with instructions on how to add more tests
  • added myself as maintainer for the prometheus exporters module

The exporter tests are executed one after another as subtests to go easy on the memory.
The unifi and minio tests were intentionally excluded because recently minio itself started to expose prometheus metrics. The unifi controller is unfree software and also needs to be configured in the webinterface (as far as I know).

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Once this is approved, I'll open another PR to backport 9ed397d1c69b9158a20b234df5c3ac082ea9308d and dd0bdbe to 18.09.

@WilliButz
Copy link
Member Author

@GrahamcOfBorg test prometheus-exporters

Prior to this commit, the default values for `Restart`, `PrivateTmp` and
`WorkingDirectory` were falsely ignored.

I also added myself as maintainer.
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.prometheus-exporters

Partial log (click to expand)

varnish# [   25.537684] ACPI: Preparing to enter system sleep state S5
varnish# [   25.540337] reboot: Power down
vde_switch: EOF data port: Interrupted system call
collecting coverage data
syncing
12 out of 12 tests succeeded
test script finished in 282.25s
vde_switch: EOF on stdin, cleaning up and exiting
cleaning up
/nix/store/zn4f0qr9d96rzjm2sy3rjq1x410pnvks-vm-test-run-prometheus-exporters

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.prometheus-exporters

Partial log (click to expand)

varnish# [   32.487875] systemd-shutdown[1]: Detaching DM devices.
varnish# [   32.499303] reboot: Power down
vde_switch: EOF data port: Interrupted system call
collecting coverage data
syncing
12 out of 12 tests succeeded
test script finished in 352.56s
vde_switch: EOF on stdin, cleaning up and exiting
cleaning up
/nix/store/wc1qzkjfnqya31597kxyyp5k8jwp2vy3-vm-test-run-prometheus-exporters

@fpletz
Copy link
Member

fpletz commented Oct 11, 2018

Backported to 18.09: a8ad1fb...2cae2b9

@WilliButz WilliButz deleted the add-exporter-tests branch October 12, 2018 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants