-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
Nixos integration test ports #72835
Conversation
eae00cd
to
3974329
Compare
@@ -642,6 +655,27 @@ def wait_for_x(self): | |||
if status == 0: | |||
return | |||
|
|||
def get_window_names(self): |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
nixos/lib/test-driver/test-driver.py
Outdated
@@ -344,6 +345,18 @@ def systemctl(self, q, user=None): | |||
) | |||
return self.execute("systemctl {}".format(q)) | |||
|
|||
def require_active_unit(self, unit): |
There was a problem hiding this comment.
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
.
3974329
to
d6b7a99
Compare
With 45b339b I can port all the DE tests and installed tests for gnome to the python driver. |
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 |
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) |
There was a problem hiding this comment.
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)
Motivation for this change
Processing the task list in issue #72828.
Things done
implemented
require_active_unit
,get_window_names
, andwait_for_window
.ported the tests
matrix-synapse.nix
andfirefox.nix
Tested using sandboxing (nix.useSandbox on NixOS, or option
sandbox
innix.conf
on non-NixOS linux)Built on platform(s)
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