2023-12-29 08:15:16 +00:00
|
|
|
{ lib, config, ... }:
|
|
|
|
{
|
|
|
|
name = "fetch-git";
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
./testsupport/gitea.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
/*
|
|
|
|
Test cases
|
2024-01-11 07:41:35 +00:00
|
|
|
|
|
|
|
Test cases are automatically imported from ./test-cases/{name}
|
|
|
|
|
2023-12-29 08:15:16 +00:00
|
|
|
The following is set up automatically for each test case:
|
|
|
|
- a repo with the {name} is created on the gitea server
|
|
|
|
- a repo with the {name} is created on the client
|
|
|
|
- the client repo is configured to push to the server repo
|
2024-01-11 07:41:35 +00:00
|
|
|
|
2023-12-29 08:15:16 +00:00
|
|
|
Python variables:
|
|
|
|
- repo.path: the path to the directory of the client repo
|
|
|
|
- repo.git: the git command with the client repo as the working directory
|
|
|
|
- repo.remote: the url to the server repo
|
|
|
|
*/
|
2024-01-11 07:41:35 +00:00
|
|
|
testCases =
|
|
|
|
map
|
|
|
|
(testCaseName: {...}: {
|
2024-01-18 11:47:29 +00:00
|
|
|
imports = [ (./test-cases + "/${testCaseName}") ];
|
2024-01-11 07:41:35 +00:00
|
|
|
# ensures tests are named like their directories they are defined in
|
|
|
|
name = testCaseName;
|
|
|
|
})
|
|
|
|
(lib.attrNames (builtins.readDir ./test-cases));
|
2023-12-29 08:15:16 +00:00
|
|
|
}
|