Skip to content

nixos/test-driver: add polling_condition#146905

Merged
tfc merged 5 commits intoNixOS:masterfrom
Synthetica9:failure_mode
Jan 8, 2022
Merged

nixos/test-driver: add polling_condition#146905
tfc merged 5 commits intoNixOS:masterfrom
Synthetica9:failure_mode

Conversation

@Synthetica9
Copy link
Member

Motivation for this change

Allows tests to fail early when certain conditions are met. Example with vscodium test provided.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@Synthetica9 Synthetica9 requested a review from tfc as a code owner November 21, 2021 17:21
@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Nov 21, 2021
@Synthetica9 Synthetica9 marked this pull request as draft November 21, 2021 17:22
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 21, 2021
Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

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

This is neat, and should be promoted with some docs :)

@Synthetica9
Copy link
Member Author

Synthetica9 commented Nov 24, 2021

With this rewrite I'm a lot more confident that this is actually a good idea. What should still happen before this can be merged:

  • Documentation
  • Rewrite the context manager logic so that it can be entered multiple times as follows:
    @polling_condition
    def foo():
        ...
    
    with foo:
          ...
    
    ...
    
    with foo:
          ...
    Currently this throws a "weird" error, but it's conceptually perfectly valid. Thus, it should Just Work™️

@Synthetica9 Synthetica9 changed the title nixos/test-driver: add failure_mode nixos/test-driver: add polling_condition Nov 24, 2021
@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Nov 24, 2021
@Synthetica9 Synthetica9 force-pushed the failure_mode branch 2 times, most recently from eb4e026 to 1326428 Compare November 26, 2021 18:49
@Synthetica9 Synthetica9 marked this pull request as ready for review January 1, 2022 22:00
@Synthetica9
Copy link
Member Author

(would really like to merge this to avoid future merge conflicts)

@Synthetica9
Copy link
Member Author

@ofborg test vscodium.wayland

@Synthetica9 Synthetica9 force-pushed the failure_mode branch 2 times, most recently from 0ae4c2f to d633745 Compare January 1, 2022 22:14
@Synthetica9
Copy link
Member Author

@ofborg test vscodium.wayland

(since I force-pushed this didn't happen I think)

@Synthetica9
Copy link
Member Author

@ofborg test vscodium.wayland vscodium.xorg

@Synthetica9 Synthetica9 requested review from roberth and tfc January 3, 2022 13:57
@Synthetica9
Copy link
Member Author

Any further objections? Wanna merge this

@tfc
Copy link
Contributor

tfc commented Jan 8, 2022

thank you very much for your patience. the code looks good.

as it makes the test driver more complicated with another public interface, i would feel much better having a test that tries to test the polling condition behavior for correctness. can you write one for that, too? we can merge this pull request before and then have another pr for the test to relieve you from the burden of potential rebasing.

@Synthetica9
Copy link
Member Author

Synthetica9 commented Jan 8, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants