rollback(cilib_test) Synchronized the test file of the Ci library

Updated the continuous integration test file to be compatible with the newer main branch.
This commit is contained in:
Skryta Istota 2025-12-03 18:35:36 +01:00
parent c8f51c73ed
commit 65b90ecd65
No known key found for this signature in database

View file

@ -56,28 +56,26 @@
}
{
name = "jobPatched nix disabled";
expected = {};
actual = mkJobPatched {
key = "test";
pipelineName = "test";
job = {};
nixConfig.enable = false;
};
}
{
name = "jobPatched nix disabled with variables and cache";
expected = {
cache = {
name = "some";
paths = ["this"];
};
variables = {
BASH = toString pkgs.bash;
TEST = "work";
};
variables."HELLO" = "world";
cache = [{key = "example";}];
};
actual = mkJobPatched {
key = "test";
pipelineName = "test";
job = {
cache = {
name = "some";
paths = ["this"];
};
variables = {
BASH = toString pkgs.bash;
TEST = "work";
};
variables."HELLO" = "world";
cache = [{key = "example";}];
};
nixConfig.enable = false;
};
@ -87,30 +85,11 @@
expected = {
after_script = ["finalize_nix_ci"];
before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\""];
variables = {
#BASH = toString pkgs.bash;
TEST = "work";
};
cache = [
{
name = "some";
paths = ["this"];
}
];
};
actual = mkJobPatched {
key = "test";
pipelineName = "test";
job = {
cache = {
name = "some";
paths = ["this"];
};
variables = {
BASH = toString pkgs.bash;
TEST = "work";
};
};
job = {};
nixConfig = {
enable = true;
enableRunnerCache = false;
@ -123,34 +102,17 @@
after_script = ["finalize_nix_ci"];
before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\""];
cache = [
{
name = "some";
paths = ["this"];
}
{
key = "test";
paths = [".nix-cache/"];
}
];
variables = {
NIX_CI_CACHE_STRATEGY = "runner";
#BASH = toString pkgs.bash;
TEST = "work";
};
variables."NIX_CI_CACHE_STRATEGY" = "runner";
};
actual = mkJobPatched {
key = "test";
pipelineName = "test";
job = {
cache = {
name = "some";
paths = ["this"];
};
variables = {
BASH = toString pkgs.bash;
TEST = "work";
};
};
job = {};
nixConfig = {
enable = true;
enableRunnerCache = true;
@ -199,26 +161,12 @@
'';
}
{
name = "handle store paths in variables without nix config";
name = "ignore store paths in variables with nix disabled";
expected = {
stages = ["test"];
variables = {
EXAMPLE = "empty";
CURL = toString pkgs.curl;
};
test = {
stage = "test";
before_script = ["./init"];
script = ["echo Hello World!"];
after_script = ["./clean"];
cache = {
key = "simple";
paths = ["~/random/"];
};
variables = {
SAMPLE = "working";
HELLO = toString pkgs.hello;
};
variables."TEST" = "${pkgs.hello}";
};
};
actual =
@ -227,85 +175,32 @@
nixConfig.enable = false;
pipeline = {
stages = ["test"];
variables = {
EXAMPLE = "empty";
CURL = toString pkgs.curl;
};
jobs.test = {
stage = "test";
before_script = ["./init"];
script = ["echo Hello World!"];
after_script = ["./clean"];
cache = {
key = "simple";
paths = ["~/random/"];
};
variables = {
SAMPLE = "working";
HELLO = toString pkgs.hello;
};
variables."TEST" = "${pkgs.hello}";
};
};
}).finalConfig;
}
{
name = "handle store paths in variables with nix config";
# it doesn't make much sense to have any nix store path in variables, but we ignore it for global variables
name = "ignore store paths in global variables";
expected = {
stages = ["test"];
variables = {
EXAMPLE = "empty";
HELLO = "world";
CURL = toString pkgs.curl;
};
test = {
stage = "test";
before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\"" "./init"];
script = ["echo Hello World!"];
after_script = ["./clean" "finalize_nix_ci"];
cache = [
{
key = "simple";
paths = ["~/random/"];
}
{
key = "random";
paths = [".nix-cache/"];
}
];
variables = {
SAMPLE = "working";
#HELLO = toString pkgs.hello;
NIX_CI_CACHE_STRATEGY = "runner";
};
};
};
actual =
(mkPipeline {
name = "test";
nixConfig = {
enable = true;
enableRunnerCache = true;
runnerCacheKey = "random";
};
nixConfig.enable = true;
pipeline = {
stages = ["test"];
variables = {
EXAMPLE = "empty";
HELLO = "world";
CURL = toString pkgs.curl;
};
jobs.test = {
stage = "test";
before_script = ["./init"];
script = ["echo Hello World!"];
after_script = ["./clean"];
cache = {
key = "simple";
paths = ["~/random/"];
};
variables = {
SAMPLE = "working";
HELLO = toString pkgs.hello;
};
};
jobs = {};
};
}).finalConfig;
}