2023-12-29 10:15:16 +02:00
|
|
|
{ lib, config, ... }:
|
|
|
|
{
|
|
|
|
name = "fetch-git";
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
./testsupport/gitea.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
/*
|
|
|
|
Test cases
|
2024-01-11 09:41:35 +02:00
|
|
|
|
|
|
|
Test cases are automatically imported from ./test-cases/{name}
|
|
|
|
|
2023-12-29 10:15:16 +02: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 09:41:35 +02:00
|
|
|
|
2023-12-29 10:15:16 +02: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 09:41:35 +02:00
|
|
|
testCases =
|
|
|
|
map
|
|
|
|
(testCaseName: {...}: {
|
2024-01-18 13:47:29 +02:00
|
|
|
imports = [ (./test-cases + "/${testCaseName}") ];
|
2024-01-11 09:41:35 +02:00
|
|
|
# ensures tests are named like their directories they are defined in
|
|
|
|
name = testCaseName;
|
|
|
|
})
|
|
|
|
(lib.attrNames (builtins.readDir ./test-cases));
|
2023-12-29 10:15:16 +02:00
|
|
|
}
|