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
32
tests/utils_test.nix
Normal file
32
tests/utils_test.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
pkgs,
|
||||
ntlib,
|
||||
cilib,
|
||||
...
|
||||
}: {
|
||||
suites."Utils" = {
|
||||
pos = __curPos;
|
||||
tests = [
|
||||
{
|
||||
name = "commitAndPushFiles";
|
||||
type = "script";
|
||||
script = let
|
||||
inherit (cilib) utils;
|
||||
job = ntlib.helpers.toJsonFile (
|
||||
utils.commitAndPushFiles {
|
||||
message = "hello world";
|
||||
files = ["a.md" "b.txt"];
|
||||
} {}
|
||||
);
|
||||
in
|
||||
# sh
|
||||
''
|
||||
${ntlib.helpers.path [pkgs.gnugrep]}
|
||||
${ntlib.helpers.scriptHelpers}
|
||||
assert_file_contains ${job} 'git commit -m \\"hello world\\"'
|
||||
assert_file_contains ${job} 'git add a.md b.txt'
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue