nixos/test-driver: use pythons logging module#96254
Merged
Mic92 merged 4 commits intoNixOS:masterfrom Aug 26, 2020
Merged
Conversation
This way we not accidentally use introduce/use global variables. Also it explictly mark the code for the mypy type checker.
Member
Author
|
@GrahamcOfBorg test ferm |
tfc
reviewed
Aug 25, 2020
tfc
reviewed
Aug 25, 2020
tfc
reviewed
Aug 25, 2020
edba5a7 to
99f8942
Compare
This was referenced Aug 25, 2020
- Less code - more thread-safe according to @flokli
tfc
requested changes
Aug 25, 2020
Member
|
Haha, I just opened github to open the same PR |
Member
|
Here's mine for comparison: https://github.com/JJJollyjim/nixpkgs/tree/python-logging |
Member
Member
|
Personally, I'd like to see automatic (streaming) output to the logger from (not saying that's needed for this PR, of course) |
Appearantly this is used in tests
Member
Author
|
@GrahamcOfBorg test nsd |
Member
Author
|
I re-added the |
Member
|
lgtm :) |
Member
|
Thanks for this! :-) |
This was referenced Aug 28, 2020
andersk
reviewed
Aug 30, 2020
Comment on lines
-298
to
-301
| def nested(self, msg: str, attrs: Dict[str, str] = {}) -> _GeneratorContextManager: | ||
| my_attrs = {"machine": self.name} | ||
| my_attrs.update(attrs) | ||
| return self.logger.nested(msg, my_attrs) |
Contributor
There was a problem hiding this comment.
Removing Machine.nested has broken a number of tests that used it, including the channel-blocking chromium test:
$ git grep '\.nested' nixos/tests
nixos/tests/chromium.nix: with machine.nested("Creating a new Chromium window"):
nixos/tests/chromium.nix: with machine.nested("Waiting for new Chromium window to appear"):
nixos/tests/chromium.nix: with machine.nested(description):
nixos/tests/dhparams.nix: with machine.nested("switch to generation ${toString gen}"):
nixos/tests/dhparams.nix: with machine.nested(f"check bit size of {path}"):
nixos/tests/initrd-network-ssh/default.nix: with client.nested("waiting for SSH server to come up"):
nixos/tests/taskserver.nix: with client.nested(f"initialize client for user {user}"):
nixos/tests/taskserver.nix: with client.nested("importing taskwarrior configuration"):
nixos/tests/taskserver.nix: with server.nested("(re-)add imperative user bar"):
nixos/tests/virtualbox.nix: with machine.nested("Checking for privilege escalation"):
nixos/tests/virtualbox.nix: with machine.nested("Checking for privilege escalation"):
andersk
added a commit
to andersk/nixpkgs
that referenced
this pull request
Aug 30, 2020
…chines-staging" This reverts commit 1bff6fe, reversing changes made to 2995fa4. There’s presumably nothing wrong with this PR, except that it conflicts with reverting NixOS#96254 which broke several tests (NixOS#96699). Signed-off-by: Anders Kaseorg <andersk@mit.edu>
andersk
added a commit
to andersk/nixpkgs
that referenced
this pull request
Aug 30, 2020
This reverts commit 4fc7085, reversing changes made to 0e54f3a. Fixes NixOS#96699. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
10 tasks
worldofpeace
added a commit
that referenced
this pull request
Aug 30, 2020
Revert “nixos/test-driver: use pythons logging module” (#96254)
Contributor
JJJollyjim
added a commit
to JJJollyjim/nixpkgs
that referenced
this pull request
Sep 23, 2020
This reverts commit 59b6664.
am-on
added a commit
to marijanp/nixpkgs
that referenced
this pull request
Dec 8, 2021
Add changes from NixOS#96254 and NixOS#96152. Remove `Machine.nested` - use `with subtest("Test")` in tests that used `nested`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation for this change
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)