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 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

@ofborg ofborg bot added the 6.topic: nixos label Nov 5, 2019
@tfc tfc force-pushed the tfc:nixos-integration-test-ports branch from eae00cd to 3974329 Nov 5, 2019
@@ -642,6 +655,27 @@ def wait_for_x(self):
if status == 0:
return

def get_window_names(self):

This comment has been minimized.

Copy link
@flokli

flokli Nov 5, 2019

Contributor

This probably is internal API, so _get_window_names?

This comment has been minimized.

Copy link
@tfc

tfc Nov 5, 2019

Author Contributor

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)

This comment has been minimized.

Copy link
@flokli

flokli Nov 5, 2019

Contributor

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

This comment has been minimized.

Copy link
@tfc

tfc Nov 5, 2019

Author Contributor

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):

This comment has been minimized.

Copy link
@flokli

flokli Nov 5, 2019

Contributor

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

@tfc tfc force-pushed the tfc:nixos-integration-test-ports branch from 3974329 to d6b7a99 Nov 5, 2019
@worldofpeace

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

tfc commented Nov 6, 2019

@worldofpeace worldofpeace merged commit 3780b9e into NixOS:master Nov 7, 2019
12 checks passed
12 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@tfc tfc deleted the tfc:nixos-integration-test-ports branch Nov 7, 2019
dtzWill added 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)

This comment has been minimized.

Copy link
@worldofpeace

worldofpeace Nov 11, 2019

Member

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
4 participants
You can’t perform that action at this time.