tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/tests/invidious: add test for scaled invidious
Sophie Tauchert
2 years ago
65e8f8a6
45bd4b11
+22
1 changed file
expand all
collapse all
unified
split
nixos
tests
invidious.nix
+22
nixos/tests/invidious.nix
···
41
};
42
networking.hosts."127.0.0.1" = [ "invidious.example.com" ];
43
};
0
0
0
0
0
0
0
0
0
0
0
0
44
postgres-tcp.configuration = {
45
services.invidious = {
46
database = {
···
75
activate_specialisation("nginx")
76
machine.wait_for_open_port(80)
77
curl_assert_status_code("http://invidious.example.com/search", 200)
0
0
0
0
0
0
0
0
0
0
78
79
postgres_tcp.wait_for_unit("postgresql.service")
80
activate_specialisation("postgres-tcp")
···
41
};
42
networking.hosts."127.0.0.1" = [ "invidious.example.com" ];
43
};
44
+
nginx-scale.configuration = {
45
+
services.invidious = {
46
+
nginx.enable = true;
47
+
domain = "invidious.example.com";
48
+
serviceScale = 3;
49
+
};
50
+
services.nginx.virtualHosts."invidious.example.com" = {
51
+
forceSSL = false;
52
+
enableACME = false;
53
+
};
54
+
networking.hosts."127.0.0.1" = [ "invidious.example.com" ];
55
+
};
56
postgres-tcp.configuration = {
57
services.invidious = {
58
database = {
···
87
activate_specialisation("nginx")
88
machine.wait_for_open_port(80)
89
curl_assert_status_code("http://invidious.example.com/search", 200)
90
+
91
+
activate_specialisation("nginx-scale")
92
+
machine.wait_for_open_port(80)
93
+
# this depends on nginx round-robin behaviour for the upstream servers
94
+
curl_assert_status_code("http://invidious.example.com/search", 200)
95
+
curl_assert_status_code("http://invidious.example.com/search", 200)
96
+
curl_assert_status_code("http://invidious.example.com/search", 200)
97
+
machine.succeed("journalctl -eu invidious.service | grep -o '200 GET /search'")
98
+
machine.succeed("journalctl -eu invidious-1.service | grep -o '200 GET /search'")
99
+
machine.succeed("journalctl -eu invidious-2.service | grep -o '200 GET /search'")
100
101
postgres_tcp.wait_for_unit("postgresql.service")
102
activate_specialisation("postgres-tcp")