Merge pull request #112394 from turion/dev_test_vscodium
vscode/vscodium: Add integration test
This commit is contained in:
commit
2c74118615
|
@ -413,6 +413,7 @@ in
|
||||||
vector = handleTest ./vector.nix {};
|
vector = handleTest ./vector.nix {};
|
||||||
victoriametrics = handleTest ./victoriametrics.nix {};
|
victoriametrics = handleTest ./victoriametrics.nix {};
|
||||||
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
|
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
|
||||||
|
vscodium = handleTest ./vscodium.nix {};
|
||||||
wasabibackend = handleTest ./wasabibackend.nix {};
|
wasabibackend = handleTest ./wasabibackend.nix {};
|
||||||
wireguard = handleTest ./wireguard {};
|
wireguard = handleTest ./wireguard {};
|
||||||
wordpress = handleTest ./wordpress.nix {};
|
wordpress = handleTest ./wordpress.nix {};
|
||||||
|
|
62
nixos/tests/vscodium.nix
Normal file
62
nixos/tests/vscodium.nix
Normal file
|
@ -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")
|
||||||
|
'';
|
||||||
|
})
|
|
@ -3,6 +3,9 @@
|
||||||
, gtk2, atomEnv, at-spi2-atk, autoPatchelfHook
|
, gtk2, atomEnv, at-spi2-atk, autoPatchelfHook
|
||||||
, systemd, fontconfig, libdbusmenu
|
, systemd, fontconfig, libdbusmenu
|
||||||
|
|
||||||
|
# Populate passthru.tests
|
||||||
|
, tests
|
||||||
|
|
||||||
# Attributes inherit from specific versions
|
# Attributes inherit from specific versions
|
||||||
, version, src, meta, sourceRoot
|
, version, src, meta, sourceRoot
|
||||||
, executableName, longName, shortName, pname
|
, executableName, longName, shortName, pname
|
||||||
|
@ -16,7 +19,7 @@ in
|
||||||
inherit pname version src sourceRoot;
|
inherit pname version src sourceRoot;
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit executableName;
|
inherit executableName tests;
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, stdenv, callPackage, fetchurl }:
|
{ lib, stdenv, callPackage, fetchurl, nixosTests }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (stdenv.hostPlatform) system;
|
inherit (stdenv.hostPlatform) system;
|
||||||
|
@ -45,6 +45,8 @@ in
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tests = nixosTests.vscodium;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = ''
|
description = ''
|
||||||
Open source source code editor developed by Microsoft for Windows,
|
Open source source code editor developed by Microsoft for Windows,
|
||||||
|
|
Loading…
Reference in a new issue