From c1a7bbc38f62033eeb51a644e300969bf4efd3cf Mon Sep 17 00:00:00 2001 From: Benjamin Asbach Date: Fri, 6 Aug 2021 23:02:28 -0600 Subject: [PATCH] isso: added a test to verify that the server is able to start and a generated javascript file is available --- nixos/tests/isso.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 nixos/tests/isso.nix diff --git a/nixos/tests/isso.nix b/nixos/tests/isso.nix new file mode 100644 index 00000000000..e9a68dca371 --- /dev/null +++ b/nixos/tests/isso.nix @@ -0,0 +1,28 @@ +import ./make-test-python.nix ({ pkgs, ... }: { + name = "isso"; + meta = with pkgs.lib.maintainers; { + maintainers = [ asbachb ]; + }; + + machine = { config, pkgs, ... }: { + environment.systemPackages = [ pkgs.isso ]; + }; + + testScript = let + issoConfig = pkgs.writeText "minimal-isso.conf" '' + [general] + dbpath = /tmp/isso-comments.db + host = http://localhost + ''; + + port = 8080; + in + '' + machine.succeed("isso -c ${issoConfig} &") + + machine.wait_for_open_port("${toString port}") + + machine.succeed("curl --fail http://localhost:${toString port}/?uri") + machine.succeed("curl --fail http://localhost:${toString port}/js/embed.min.js") + ''; +})