nixos/code-server: init tests

This commit is contained in:
Pol Dellaiera 2023-05-17 08:22:43 +02:00
parent 2c95ebadf3
commit 371b4c3eb7
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
3 changed files with 27 additions and 1 deletions

View File

@ -170,6 +170,7 @@ in {
cntr = handleTestOn ["aarch64-linux" "x86_64-linux"] ./cntr.nix {};
cockpit = handleTest ./cockpit.nix {};
cockroachdb = handleTestOn ["x86_64-linux"] ./cockroachdb.nix {};
code-server = handleTest ./code-server.nix {};
coder = handleTest ./coder.nix {};
collectd = handleTest ./collectd.nix {};
connman = handleTest ./connman.nix {};

View File

@ -0,0 +1,22 @@
import ./make-test-python.nix ({pkgs, lib, ...}:
{
name = "code-server";
nodes = {
machine = {pkgs, ...}: {
services.code-server = {
enable = true;
auth = "none";
};
};
};
testScript = ''
start_all()
machine.wait_for_unit("code-server.service")
machine.wait_for_open_port(4444)
machine.succeed("curl -k --fail http://localhost:4444", timeout=10)
'';
meta.maintainers = [ lib.maintainers.drupol ];
})

View File

@ -1,7 +1,7 @@
{ lib, stdenv, fetchFromGitHub, buildGoModule, makeWrapper
, cacert, moreutils, jq, git, rsync, pkg-config, yarn, python3
, esbuild, nodejs_16, node-gyp, libsecret, xorg, ripgrep
, AppKit, Cocoa, CoreServices, Security, cctools, xcbuild, quilt }:
, AppKit, Cocoa, CoreServices, Security, cctools, xcbuild, quilt, nixosTests }:
let
system = stdenv.hostPlatform.system;
@ -243,6 +243,9 @@ in stdenv.mkDerivation rec {
prefetchYarnCache = lib.overrideDerivation yarnCache (d: {
outputHash = lib.fakeSha256;
});
tests = {
inherit (nixosTests) code-server;
};
};
meta = with lib; {