tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
outline: add nixos test
Alexander Sieg
2 years ago
5ade0816
74bc4261
+60
3 changed files
expand all
collapse all
unified
split
nixos
tests
all-tests.nix
outline.nix
pkgs
servers
web-apps
outline
default.nix
+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
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
1
+
import ./make-test-python.nix ({ pkgs, lib, ... }:
2
2
+
let
3
3
+
accessKey = "BKIKJAA5BMMU2RHO6IBB";
4
4
+
secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
5
5
+
secretKeyFile = pkgs.writeText "outline-secret-key" ''
6
6
+
${secretKey}
7
7
+
'';
8
8
+
rootCredentialsFile = pkgs.writeText "minio-credentials-full" ''
9
9
+
MINIO_ROOT_USER=${accessKey}
10
10
+
MINIO_ROOT_PASSWORD=${secretKey}
11
11
+
'';
12
12
+
in
13
13
+
{
14
14
+
name = "outline";
15
15
+
16
16
+
meta.maintainers = with lib.maintainers; [ xanderio ];
17
17
+
18
18
+
nodes = {
19
19
+
outline = { pkgs, config, ... }: {
20
20
+
nixpkgs.config.allowUnfree = true;
21
21
+
environment.systemPackages = [ pkgs.minio-client ];
22
22
+
services.outline = {
23
23
+
enable = true;
24
24
+
forceHttps = false;
25
25
+
storage = {
26
26
+
inherit accessKey secretKeyFile;
27
27
+
uploadBucketUrl = "http://localhost:9000";
28
28
+
uploadBucketName = "outline";
29
29
+
region = config.services.minio.region;
30
30
+
};
31
31
+
};
32
32
+
services.minio = {
33
33
+
enable = true;
34
34
+
inherit rootCredentialsFile;
35
35
+
};
36
36
+
};
37
37
+
};
38
38
+
39
39
+
testScript =
40
40
+
''
41
41
+
machine.wait_for_unit("minio.service")
42
42
+
machine.wait_for_open_port(9000)
43
43
+
44
44
+
# Create a test bucket on the server
45
45
+
machine.succeed(
46
46
+
"mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4"
47
47
+
)
48
48
+
machine.succeed("mc mb minio/outline")
49
49
+
50
50
+
outline.wait_for_unit("outline.service")
51
51
+
outline.wait_for_open_port(3000)
52
52
+
outline.succeed("curl --fail http://localhost:3000/")
53
53
+
'';
54
54
+
})
+5
pkgs/servers/web-apps/outline/default.nix
···
5
5
, nodejs
6
6
, yarn
7
7
, yarn2nix-moretea
8
8
+
, nixosTests
8
9
}:
9
10
10
11
stdenv.mkDerivation rec {
···
75
76
76
77
runHook postInstall
77
78
'';
79
79
+
80
80
+
passthru.tests = {
81
81
+
basic-functionality = nixosTests.outline;
82
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";