-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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/tests/microsoft-edge: Reuse chromium tests to add tests for microsoft-edge #257165
base: master
Are you sure you want to change the base?
Conversation
b19a478
to
5fea340
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/2829 |
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.
Commented with a few minor nitpicks.
I'd probably move the Edge and Chrome/Chromium tests into a dedicated directory and parametrise on something like a common.nix
. That way it's less likely that changes to the Chromium test will accidentally break the test for Edge as well.
Ultimately this is for the current Chromium maintainers to decide since I no longer maintain Chromium.
nixos/tests/chromium.nix
Outdated
@@ -119,7 +119,7 @@ mapAttrs (channel: chromiumPkg: makeTest { | |||
machine.wait_until_succeeds( | |||
ru( | |||
"${xdo "create_new_win-wait_for_window" '' | |||
search --onlyvisible --name "New Tab" | |||
search --onlyvisible --name "New (t|T)ab" |
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.
search --onlyvisible --name "New (t|T)ab" | |
search --onlyvisible --name "New [tT]ab" |
nixos/tests/chromium.nix
Outdated
@@ -132,7 +132,7 @@ mapAttrs (channel: chromiumPkg: makeTest { | |||
machine.wait_until_succeeds( | |||
ru( | |||
"${xdo "close_new_tab_win-select_main_window" '' | |||
search --onlyvisible --name "New Tab" | |||
search --onlyvisible --name "New (t|T)ab" |
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.
search --onlyvisible --name "New (t|T)ab" | |
search --onlyvisible --name "New [tT]ab" |
nixos/tests/chromium.nix
Outdated
@@ -143,7 +143,7 @@ mapAttrs (channel: chromiumPkg: makeTest { | |||
machine.wait_until_fails( | |||
ru( | |||
"${xdo "close_new_tab_win-wait_for_close" '' | |||
search --onlyvisible --name "New Tab" | |||
search --onlyvisible --name "New (t|T)ab" |
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.
search --onlyvisible --name "New (t|T)ab" | |
search --onlyvisible --name "New [tT]ab" |
nixos/tests/chromium.nix
Outdated
@@ -152,7 +152,7 @@ mapAttrs (channel: chromiumPkg: makeTest { | |||
@contextmanager | |||
def test_new_win(description, url, window_name): | |||
create_new_win() | |||
machine.wait_for_window("New Tab") | |||
machine.wait_for_window("New (:?t|T)ab") |
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.
machine.wait_for_window("New (:?t|T)ab") | |
machine.wait_for_window("New [tT]ab") |
nixos/tests/chromium.nix
Outdated
@@ -254,9 +256,9 @@ mapAttrs (channel: chromiumPkg: makeTest { | |||
# TODO: Fix copying all of the text to the clipboard | |||
|
|||
|
|||
with test_new_win("version_info", "chrome://version", "About Version") as clipboard: | |||
with test_new_win("version_info", "chrome://version", "About (:?v|V)ersion") as clipboard: |
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.
with test_new_win("version_info", "chrome://version", "About (:?v|V)ersion") as clipboard: | |
with test_new_win("version_info", "chrome://version", "About [vV]ersion") as clipboard: |
nixos/tests/chromium.nix
Outdated
filters = [ | ||
r"${chromiumPkg.version} \(Official Build", | ||
r"${chromiumPkg.version} \(Official (:?b|B)uild", |
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.
r"${chromiumPkg.version} \(Official (:?b|B)uild", | |
r"${chromiumPkg.version} \(Official [bB]uild", |
nixos/tests/microsoft-edge.nix
Outdated
maintainers = with maintainers; [ rhysmdnz ]; | ||
}; | ||
|
||
nodes.machine = { ... }: { |
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.
nodes.machine = { ... }: { | |
nodes.machine = { |
nixos/tests/microsoft-edge.nix
Outdated
|
||
|
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.
nixos/tests/microsoft-edge.nix
Outdated
with import ../lib/testing-python.nix { inherit system pkgs; }; | ||
with pkgs.lib; |
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'd try to avoid to bring too many attributes into the full scope (see https://nix.dev/recipes/best-practices#with-scopes) and instead either use full references or explicitly inherit the ones you need into the scope.
Description of changes
Adds nixos tests for Microsoft edge
@aszlig @primeos this steps on your chromium tests a bunch with minor capitalisation changes, and reusing the test script. Would appreciate feedback on better ways to do this / make sure I'm not causing you to much future trouble.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)