forked from potsda.mn/mobilizon
add nixos test for better testing, fix runtime issue
This commit is contained in:
parent
1ab82cdfb8
commit
115a094b88
|
@ -399,7 +399,7 @@ config :sentry,
|
||||||
dsn: "",
|
dsn: "",
|
||||||
environment_name: Mix.env(),
|
environment_name: Mix.env(),
|
||||||
enable_source_code_context: true,
|
enable_source_code_context: true,
|
||||||
root_source_code_paths: [File.cwd!()]
|
root_source_code_paths: ["/build/source"]
|
||||||
|
|
||||||
# Import environment specific config. This must remain at the bottom
|
# Import environment specific config. This must remain at the bottom
|
||||||
# of this file so it overrides the configuration defined above.
|
# of this file so it overrides the configuration defined above.
|
||||||
|
|
14
flake.nix
14
flake.nix
|
@ -90,8 +90,22 @@
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
overlays.default = final: prev: {
|
||||||
|
inherit (self.packages."${prev.system}") mobilizon;
|
||||||
|
};
|
||||||
|
|
||||||
checks = forAllSystems (system: {
|
checks = forAllSystems (system: {
|
||||||
inherit (self.packages.${system}) mobilizon update;
|
inherit (self.packages.${system}) mobilizon update;
|
||||||
|
nixosTest =
|
||||||
|
let
|
||||||
|
pkgsMobilizon = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ self.overlays.default ];
|
||||||
|
};
|
||||||
|
certs = import "${nixpkgs}/nixos/tests/common/acme/server/snakeoil-certs.nix";
|
||||||
|
test = import ./nixos-test.nix { inherit certs; };
|
||||||
|
in
|
||||||
|
pkgsMobilizon.nixosTest test;
|
||||||
});
|
});
|
||||||
|
|
||||||
lib = {
|
lib = {
|
||||||
|
|
46
nixos-test.nix
Normal file
46
nixos-test.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{ certs }:
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
mobilizonDomain = certs.domain;
|
||||||
|
port = 41395;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "mobilizon";
|
||||||
|
meta.maintainers = with lib.maintainers; [ minijackson erictapen ];
|
||||||
|
|
||||||
|
nodes.server =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.mobilizon = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
":mobilizon" = {
|
||||||
|
":instance" = {
|
||||||
|
name = "Test Mobilizon";
|
||||||
|
hostname = mobilizonDomain;
|
||||||
|
};
|
||||||
|
"Mobilizon.Web.Endpoint".http.port = port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.postgresql.package = pkgs.postgresql_14;
|
||||||
|
|
||||||
|
security.pki.certificateFiles = [ certs.ca.cert ];
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."${mobilizonDomain}" = {
|
||||||
|
enableACME = lib.mkForce false;
|
||||||
|
sslCertificate = certs.${mobilizonDomain}.cert;
|
||||||
|
sslCertificateKey = certs.${mobilizonDomain}.key;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.hosts."::1" = [ mobilizonDomain ];
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
server.wait_for_unit("mobilizon.service")
|
||||||
|
server.wait_for_open_port(${toString port})
|
||||||
|
server.succeed("curl --fail https://${mobilizonDomain}/")
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue