mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
test: copy over most tests, add new tests for soonix
This commit is contained in:
parent
0bd75fd1bb
commit
436e2fde25
7 changed files with 439 additions and 9 deletions
77
tests/soonix_test.nix
Normal file
77
tests/soonix_test.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
lib,
|
||||
cilib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) trimWith;
|
||||
in {
|
||||
suites."Soonix" = {
|
||||
pos = __curPos;
|
||||
tests = let
|
||||
version = trimWith {
|
||||
start = true;
|
||||
end = true;
|
||||
} (builtins.readFile ../lib/VERSION);
|
||||
in [
|
||||
{
|
||||
name = "default soonix config";
|
||||
expected = {
|
||||
data.include = [
|
||||
{
|
||||
component = "gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci@${version}";
|
||||
inputs.version = version;
|
||||
}
|
||||
];
|
||||
generator = "nix";
|
||||
opts.format = "yaml";
|
||||
hook = {
|
||||
mode = "copy";
|
||||
gitignore = false;
|
||||
};
|
||||
output = ".gitlab-ci.yml";
|
||||
};
|
||||
actual =
|
||||
(cilib.mkCI {
|
||||
config.soonix = {};
|
||||
}).soonix;
|
||||
}
|
||||
{
|
||||
name = "custom soonix config";
|
||||
expected = {
|
||||
data = {
|
||||
include = [
|
||||
{
|
||||
component = "gitlab.com/example/nix-gitlab-ci/nix-gitlab-ci@abc";
|
||||
inputs = {
|
||||
version = "abc";
|
||||
hello = "world";
|
||||
};
|
||||
}
|
||||
];
|
||||
"example".script = ["hello"];
|
||||
};
|
||||
generator = "nix";
|
||||
opts.format = "yaml";
|
||||
hook = {
|
||||
mode = "copy";
|
||||
gitignore = false;
|
||||
};
|
||||
output = ".gitlab-ci.yml";
|
||||
};
|
||||
actual =
|
||||
(cilib.mkCI {
|
||||
config.soonix = {
|
||||
componentVersion = "abc";
|
||||
componentUrl = "gitlab.com/example/nix-gitlab-ci/nix-gitlab-ci";
|
||||
componentInputs = {
|
||||
hello = "world";
|
||||
};
|
||||
extraData = {
|
||||
"example".script = ["hello"];
|
||||
};
|
||||
};
|
||||
}).soonix;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue