lol

outline: add nixos test

+60
+1
nixos/tests/all-tests.nix
··· 555 555 openstack-image-userdata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).userdata or {}; 556 556 opentabletdriver = handleTest ./opentabletdriver.nix {}; 557 557 owncast = handleTest ./owncast.nix {}; 558 + outline = handleTest ./outline.nix {}; 558 559 image-contents = handleTest ./image-contents.nix {}; 559 560 openvscode-server = handleTest ./openvscode-server.nix {}; 560 561 orangefs = handleTest ./orangefs.nix {};
+54
nixos/tests/outline.nix
··· 1 + import ./make-test-python.nix ({ pkgs, lib, ... }: 2 + let 3 + accessKey = "BKIKJAA5BMMU2RHO6IBB"; 4 + secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12"; 5 + secretKeyFile = pkgs.writeText "outline-secret-key" '' 6 + ${secretKey} 7 + ''; 8 + rootCredentialsFile = pkgs.writeText "minio-credentials-full" '' 9 + MINIO_ROOT_USER=${accessKey} 10 + MINIO_ROOT_PASSWORD=${secretKey} 11 + ''; 12 + in 13 + { 14 + name = "outline"; 15 + 16 + meta.maintainers = with lib.maintainers; [ xanderio ]; 17 + 18 + nodes = { 19 + outline = { pkgs, config, ... }: { 20 + nixpkgs.config.allowUnfree = true; 21 + environment.systemPackages = [ pkgs.minio-client ]; 22 + services.outline = { 23 + enable = true; 24 + forceHttps = false; 25 + storage = { 26 + inherit accessKey secretKeyFile; 27 + uploadBucketUrl = "http://localhost:9000"; 28 + uploadBucketName = "outline"; 29 + region = config.services.minio.region; 30 + }; 31 + }; 32 + services.minio = { 33 + enable = true; 34 + inherit rootCredentialsFile; 35 + }; 36 + }; 37 + }; 38 + 39 + testScript = 40 + '' 41 + machine.wait_for_unit("minio.service") 42 + machine.wait_for_open_port(9000) 43 + 44 + # Create a test bucket on the server 45 + machine.succeed( 46 + "mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4" 47 + ) 48 + machine.succeed("mc mb minio/outline") 49 + 50 + outline.wait_for_unit("outline.service") 51 + outline.wait_for_open_port(3000) 52 + outline.succeed("curl --fail http://localhost:3000/") 53 + ''; 54 + })
+5
pkgs/servers/web-apps/outline/default.nix
··· 5 5 , nodejs 6 6 , yarn 7 7 , yarn2nix-moretea 8 + , nixosTests 8 9 }: 9 10 10 11 stdenv.mkDerivation rec { ··· 75 76 76 77 runHook postInstall 77 78 ''; 79 + 80 + passthru.tests = { 81 + basic-functionality = nixosTests.outline; 82 + }; 78 83 79 84 meta = with lib; { 80 85 description = "The fastest wiki and knowledge base for growing teams. Beautiful, feature rich, and markdown compatible";