mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
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:
parent
c8f51c73ed
commit
65b90ecd65
1 changed files with 26 additions and 131 deletions
|
|
@ -56,28 +56,26 @@
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "jobPatched nix disabled";
|
name = "jobPatched nix disabled";
|
||||||
|
expected = {};
|
||||||
|
actual = mkJobPatched {
|
||||||
|
key = "test";
|
||||||
|
pipelineName = "test";
|
||||||
|
job = {};
|
||||||
|
nixConfig.enable = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "jobPatched nix disabled with variables and cache";
|
||||||
expected = {
|
expected = {
|
||||||
cache = {
|
variables."HELLO" = "world";
|
||||||
name = "some";
|
cache = [{key = "example";}];
|
||||||
paths = ["this"];
|
|
||||||
};
|
|
||||||
variables = {
|
|
||||||
BASH = toString pkgs.bash;
|
|
||||||
TEST = "work";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
actual = mkJobPatched {
|
actual = mkJobPatched {
|
||||||
key = "test";
|
key = "test";
|
||||||
pipelineName = "test";
|
pipelineName = "test";
|
||||||
job = {
|
job = {
|
||||||
cache = {
|
variables."HELLO" = "world";
|
||||||
name = "some";
|
cache = [{key = "example";}];
|
||||||
paths = ["this"];
|
|
||||||
};
|
|
||||||
variables = {
|
|
||||||
BASH = toString pkgs.bash;
|
|
||||||
TEST = "work";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
nixConfig.enable = false;
|
nixConfig.enable = false;
|
||||||
};
|
};
|
||||||
|
|
@ -87,30 +85,11 @@
|
||||||
expected = {
|
expected = {
|
||||||
after_script = ["finalize_nix_ci"];
|
after_script = ["finalize_nix_ci"];
|
||||||
before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\""];
|
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 {
|
actual = mkJobPatched {
|
||||||
key = "test";
|
key = "test";
|
||||||
pipelineName = "test";
|
pipelineName = "test";
|
||||||
job = {
|
job = {};
|
||||||
cache = {
|
|
||||||
name = "some";
|
|
||||||
paths = ["this"];
|
|
||||||
};
|
|
||||||
variables = {
|
|
||||||
BASH = toString pkgs.bash;
|
|
||||||
TEST = "work";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableRunnerCache = false;
|
enableRunnerCache = false;
|
||||||
|
|
@ -123,34 +102,17 @@
|
||||||
after_script = ["finalize_nix_ci"];
|
after_script = ["finalize_nix_ci"];
|
||||||
before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\""];
|
before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\""];
|
||||||
cache = [
|
cache = [
|
||||||
{
|
|
||||||
name = "some";
|
|
||||||
paths = ["this"];
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
key = "test";
|
key = "test";
|
||||||
paths = [".nix-cache/"];
|
paths = [".nix-cache/"];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
variables = {
|
variables."NIX_CI_CACHE_STRATEGY" = "runner";
|
||||||
NIX_CI_CACHE_STRATEGY = "runner";
|
|
||||||
#BASH = toString pkgs.bash;
|
|
||||||
TEST = "work";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
actual = mkJobPatched {
|
actual = mkJobPatched {
|
||||||
key = "test";
|
key = "test";
|
||||||
pipelineName = "test";
|
pipelineName = "test";
|
||||||
job = {
|
job = {};
|
||||||
cache = {
|
|
||||||
name = "some";
|
|
||||||
paths = ["this"];
|
|
||||||
};
|
|
||||||
variables = {
|
|
||||||
BASH = toString pkgs.bash;
|
|
||||||
TEST = "work";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableRunnerCache = 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 = {
|
expected = {
|
||||||
stages = ["test"];
|
stages = ["test"];
|
||||||
variables = {
|
|
||||||
EXAMPLE = "empty";
|
|
||||||
CURL = toString pkgs.curl;
|
|
||||||
};
|
|
||||||
test = {
|
test = {
|
||||||
stage = "test";
|
stage = "test";
|
||||||
before_script = ["./init"];
|
variables."TEST" = "${pkgs.hello}";
|
||||||
script = ["echo Hello World!"];
|
|
||||||
after_script = ["./clean"];
|
|
||||||
cache = {
|
|
||||||
key = "simple";
|
|
||||||
paths = ["~/random/"];
|
|
||||||
};
|
|
||||||
variables = {
|
|
||||||
SAMPLE = "working";
|
|
||||||
HELLO = toString pkgs.hello;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
actual =
|
actual =
|
||||||
|
|
@ -227,85 +175,32 @@
|
||||||
nixConfig.enable = false;
|
nixConfig.enable = false;
|
||||||
pipeline = {
|
pipeline = {
|
||||||
stages = ["test"];
|
stages = ["test"];
|
||||||
variables = {
|
|
||||||
EXAMPLE = "empty";
|
|
||||||
CURL = toString pkgs.curl;
|
|
||||||
};
|
|
||||||
jobs.test = {
|
jobs.test = {
|
||||||
stage = "test";
|
stage = "test";
|
||||||
before_script = ["./init"];
|
variables."TEST" = "${pkgs.hello}";
|
||||||
script = ["echo Hello World!"];
|
|
||||||
after_script = ["./clean"];
|
|
||||||
cache = {
|
|
||||||
key = "simple";
|
|
||||||
paths = ["~/random/"];
|
|
||||||
};
|
|
||||||
variables = {
|
|
||||||
SAMPLE = "working";
|
|
||||||
HELLO = toString pkgs.hello;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}).finalConfig;
|
}).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 = {
|
expected = {
|
||||||
stages = ["test"];
|
|
||||||
variables = {
|
variables = {
|
||||||
EXAMPLE = "empty";
|
HELLO = "world";
|
||||||
CURL = toString pkgs.curl;
|
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 =
|
actual =
|
||||||
(mkPipeline {
|
(mkPipeline {
|
||||||
name = "test";
|
name = "test";
|
||||||
nixConfig = {
|
nixConfig.enable = true;
|
||||||
enable = true;
|
|
||||||
enableRunnerCache = true;
|
|
||||||
runnerCacheKey = "random";
|
|
||||||
};
|
|
||||||
pipeline = {
|
pipeline = {
|
||||||
stages = ["test"];
|
|
||||||
variables = {
|
variables = {
|
||||||
EXAMPLE = "empty";
|
HELLO = "world";
|
||||||
CURL = toString pkgs.curl;
|
CURL = toString pkgs.curl;
|
||||||
};
|
};
|
||||||
jobs.test = {
|
jobs = {};
|
||||||
stage = "test";
|
|
||||||
before_script = ["./init"];
|
|
||||||
script = ["echo Hello World!"];
|
|
||||||
after_script = ["./clean"];
|
|
||||||
cache = {
|
|
||||||
key = "simple";
|
|
||||||
paths = ["~/random/"];
|
|
||||||
};
|
|
||||||
variables = {
|
|
||||||
SAMPLE = "working";
|
|
||||||
HELLO = toString pkgs.hello;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}).finalConfig;
|
}).finalConfig;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue