diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2021-02-08 18:17:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 18:17:03 +0000 |
commit | 1848e071c98814742bdea07976d511e0866e0f86 (patch) | |
tree | 53c4095a9cc1fb5f123442055aef5290e7d5ad44 /nixos/tests | |
parent | bef005163c5aa8b3cf33a9ad5746414e9e97b79b (diff) | |
parent | 3e40e83f2fd2f984b1bfa9fb19c5487b759ea48c (diff) |
Merge master into staging-next
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/vscodium.nix | 62 |
2 files changed, 63 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 175a1164b63a0..719e1e8f405a5 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -414,6 +414,7 @@ in vector = handleTest ./vector.nix {}; victoriametrics = handleTest ./victoriametrics.nix {}; virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {}; + vscodium = handleTest ./vscodium.nix {}; wasabibackend = handleTest ./wasabibackend.nix {}; wireguard = handleTest ./wireguard {}; wordpress = handleTest ./wordpress.nix {}; diff --git a/nixos/tests/vscodium.nix b/nixos/tests/vscodium.nix new file mode 100644 index 0000000000000..398896540ee80 --- /dev/null +++ b/nixos/tests/vscodium.nix @@ -0,0 +1,62 @@ +import ./make-test-python.nix ({ pkgs, ...} : + +{ + name = "vscodium"; + meta = with pkgs.lib.maintainers; { + maintainers = [ turion ]; + }; + + machine = { ... }: + + { + imports = [ + ./common/user-account.nix + ./common/x11.nix + ]; + + virtualisation.memorySize = 2047; + services.xserver.enable = true; + test-support.displayManager.auto.user = "alice"; + environment.systemPackages = with pkgs; [ + vscodium + ]; + }; + + enableOCR = true; + + testScript = { nodes, ... }: '' + # Start up X + start_all() + machine.wait_for_x() + + # Create a file that we'll open + machine.succeed("su - alice -c 'echo \" Hello World\" > foo.txt'") + + # It's one line long + assert "1 foo.txt" in machine.succeed( + "su - alice -c 'wc foo.txt -l'" + ), "File has wrong length" + + # Start VSCodium with that file + machine.succeed("su - alice -c 'codium foo.txt' &") + + # Wait for the window to appear + machine.wait_for_text("VSCodium") + + # Add a line + machine.send_key("ret") + + # Save file + machine.send_key("ctrl-s") + + # Wait until the file has been saved + machine.sleep(1) + + # Now the file is 2 lines long + assert "2 foo.txt" in machine.succeed( + "su - alice -c 'wc foo.txt -l'" + ), "File has wrong length" + + machine.screenshot("VSCodium") + ''; +}) |