forked from Fediversity/Fediversity
@Niols the sheer amount of hassle and noise indicates that it may be better to first split out a `flake.nix` just for the tests. And all this clutter doesn't even explain yet *why* we thought it needs to be there. closes #279. Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com> Reviewed-on: Fediversity/Fediversity#374 Reviewed-by: kiara Grouwstra <kiara@procolix.eu> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-committed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
41 lines
918 B
Nix
41 lines
918 B
Nix
{ inputs, ... }:
|
|
|
|
{
|
|
name = "deployment-basic";
|
|
|
|
nodes.deployer =
|
|
{ pkgs, ... }:
|
|
{
|
|
environment.systemPackages = [
|
|
inputs.nixops4.packages.${pkgs.system}.default
|
|
];
|
|
|
|
# FIXME: sad times
|
|
system.extraDependencies = with pkgs; [
|
|
jq
|
|
jq.inputDerivation
|
|
];
|
|
|
|
system.extraDependenciesFromModule =
|
|
{ pkgs, ... }:
|
|
{
|
|
environment.systemPackages = with pkgs; [
|
|
hello
|
|
cowsay
|
|
];
|
|
};
|
|
};
|
|
|
|
extraTestScript = ''
|
|
with subtest("Check the status before deployment"):
|
|
hello.fail("hello 1>&2")
|
|
cowsay.fail("cowsay 1>&2")
|
|
|
|
with subtest("Run the deployment"):
|
|
deployer.succeed("nixops4 apply check-deployment-basic --show-trace --no-interactive 1>&2")
|
|
|
|
with subtest("Check the deployment"):
|
|
hello.succeed("hello 1>&2")
|
|
cowsay.succeed("cowsay hi 1>&2")
|
|
'';
|
|
}
|