mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
36 lines
828 B
Nix
36 lines
828 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
cilib = import ./../lib {inherit lib pkgs;};
|
|
in {
|
|
nixtest.suites."Utils" = {
|
|
pos = __curPos;
|
|
tests = [
|
|
{
|
|
name = "commitAndPushFiles";
|
|
type = "script";
|
|
script = let
|
|
inherit (cilib) utils;
|
|
job = builtins.toFile "test" (
|
|
builtins.unsafeDiscardStringContext (
|
|
builtins.toJSON (
|
|
utils.commitAndPushFiles {
|
|
message = "hello world";
|
|
files = ["a.md" "b.txt"];
|
|
} {}
|
|
)
|
|
)
|
|
);
|
|
in
|
|
# sh
|
|
''
|
|
export PATH=${lib.makeBinPath [pkgs.gnugrep]}
|
|
grep -q 'git commit -m \\"hello world\\"' ${job}
|
|
grep -q 'git add a.md b.txt' ${job}
|
|
'';
|
|
}
|
|
];
|
|
};
|
|
}
|