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

Port tests to Python #72935

Merged
merged 11 commits into from Nov 8, 2019
Merged

Port tests to Python #72935

merged 11 commits into from Nov 8, 2019

Conversation

marijanp
Copy link
Contributor

@marijanp marijanp commented Nov 6, 2019

Motivation for this change

Processing the task list in issue #72828.

Now that PR #71684 (nixos: add python testing support) by @tfc got merged, I would like to port some of the tests to Python.

Things done

Ported several tests to Python, which also conform the Black code style.
Tests have been run and all of them succeed.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @tfc @flokli @worldofpeace

@worldofpeace
Copy link
Contributor

worldofpeace commented Nov 7, 2019

@marijanp I forgot this installed test a4cac83 in #72860.
Feel free to drop the commit as I'll push the port manually for that new code.

Edit: pushed that in 85251b3

@marijanp
Copy link
Contributor Author

marijanp commented Nov 7, 2019

@marijanp I forgot this installed test a4cac83 in #72860.
Feel free to drop the commit as I'll push the port manually for that new code.

Edit: pushed that in 85251b3

@worldofpeace I've dropped the commit

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cadvisor failed for me:

builder for '/nix/store/v36812mciwfpddsbkkk49ysv2g1x9kfm-vm-test-run-cadvisor.drv' failed with exit code 1; last 10 log lines:
  machine # [  646.651689] systemd[1]: cadvisor.service: Failed with result 'timeout'.
  machine # [  646.677454] systemd[1]: Failed to start cadvisor.service.
  machine # [  646.696165] systemd[1]: cadvisor.service: Consumed 1min 6.085s CPU time, received 3.0K IP traffic, sent 4.5K IP traffic.
  machine # [  646.734438] systemd[1]: Reached target Multi-User System.
  machine # [  646.778982] systemd[1]: Startup finished in 1min 22.803s (kernel) + 9min 23.250s (userspace) = 10min 46.053s.
  error: unit "cadvisor.service" reached state "failed"
  cleaning up
  killing influxdb (pid 9)
  killing machine (pid 20)
  (0.10 seconds)
[247 built (1 failed), 45 copied (635.3 MiB), 133.4 MiB DL]
error: build of '/nix/store/v36812mciwfpddsbkkk49ysv2g1x9kfm-vm-test-run-cadvisor.drv' failed

@marijanp
Copy link
Contributor Author

marijanp commented Nov 8, 2019

@jonringer I just started the build again after a fresh rebase and I couldn't reproduce the fail. It works for me:

machine # [  226.745136] systemd[1]: Started cadvisor.service.
machine # [  226.909883] systemd[1]: Reached target Multi-User System.
machine # [  226.927071] systemd[1]: Startup finished in 33.340s (kernel) + 3min 13.301s (userspace) = 3min 46.641s.
machine: must succeed: curl http://localhost:8080/containers/
(0.38 seconds)
influxdb: waiting for the VM to finish booting
influxdb: connected to guest root shell
influxdb: (connecting took 0.00 seconds)
(0.00 seconds)
influxdb: must succeed: curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root"
influxdb # [  229.255593] influxd[659]: ts=2019-11-08T08:32:45.647545Z lvl=info msg="Executing query" log_id=0IzY5sfW000 service=query query="CREATE DATABASE root"
influxdb # [  229.345082] influxd[659]: [httpd] ::1 - - [08/Nov/2019:08:32:45 +0000] "POST /query HTTP/1.1" 200 33 "-" "curl/7.66.0" 56b5d1ab-0202-11ea-8002-525400123456 150944
(0.61 seconds)
influxdb: must succeed: curl http://localhost:8080/containers/
(0.50 seconds)
(232.83 seconds)
test script finished in 233.11s
cleaning up
killing influxdb (pid 6)
killing machine (pid 18)
(0.00 seconds)
/nix/store/g0kvxg9sj61ccyvdmq3lyincncy33jis-vm-test-run-cadvisor

@jonringer
Copy link
Contributor

I was also running a lot of other reviews at the time, could have been cpu starved and then timedout

@jonringer
Copy link
Contributor

@GrahamcOfBorg test cadvisor

@flokli
Copy link
Contributor

flokli commented Nov 8, 2019

Ran all the updated tests manually, and they did succeed. Thanks :-)

@flokli flokli merged commit dd439bc into NixOS:master Nov 8, 2019
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

4 participants