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 integration test ports #72835

Merged
merged 4 commits into from Nov 7, 2019

Conversation

tfc
Copy link
Contributor

@tfc tfc commented Nov 5, 2019

Motivation for this change

Processing the task list in issue #72828.

Things done
  • implemented require_active_unit, get_window_names, and wait_for_window.

  • ported the tests matrix-synapse.nix and firefox.nix

  • 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 @flokli @marijanp

@@ -642,6 +655,27 @@ def wait_for_x(self):
if status == 0:
return

def get_window_names(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably is internal API, so _get_window_names?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm... this thinking is very policy-like. Why suggest the user that this is only for internal use, if it is perfectly safe to call from test scripts?

return any(pattern.search(name) for name in names)

with self.nested("Waiting for a window to appear"):
retry(window_is_visible)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we inline the window_is_visible function in a lambda here maybe?
Is that log line present in the perl code too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i had the impression that multi-line-lambdas are considered bad style in python. the log line is present in the perl code, yes.

@@ -344,6 +345,18 @@ def systemctl(self, q, user=None):
)
return self.execute("systemctl {}".format(q))

def require_active_unit(self, unit):
Copy link
Contributor

Choose a reason for hiding this comment

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

We could probably rename this to require_unit_state, with an optional parameter defaulting to active.

@worldofpeace
Copy link
Contributor

worldofpeace commented Nov 5, 2019

With 45b339b I can port all the DE tests and installed tests for gnome to the python driver.
(unless you've done this locally already 😄 )

@tfc
Copy link
Contributor Author

tfc commented Nov 5, 2019

With 45b339b I can port all the DE tests and installed tests for gnome to the python driver.
(unless you've done this locally already 😄 )

Not yet, but it would make sense to ask in #nixos-python-test-driver on freenode if someone is on test X already... had some clashes in the past days. :-D

@tfc
Copy link
Contributor Author

tfc commented Nov 6, 2019

@domenkozar

@worldofpeace worldofpeace merged commit 3780b9e into NixOS:master Nov 7, 2019
@tfc tfc deleted the nixos-integration-test-ports branch November 7, 2019 06:42
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Nov 7, 2019
Nixos integration test ports

(cherry picked from commit 3780b9e)
with self.nested(
"checking if unit ‘{}’ has reached state '{}'".format(unit, require_state)
):
info = self.get_unit_info(unit)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be allowed to accept user also? (like wait_for_unit)

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