aboutsummaryrefslogtreecommitdiffstats
path: root/tests/by-name/ta/taskchampion-sync/test.nix
diff options
context:
space:
mode:
authorSoispha Peetz <soispha@b-peetz.de>2026-10-29 23:32:22 +0100
committerSoispha Peetz <soispha@b-peetz.de>2026-11-27 00:27:17 +0100
commit021564ffd40d54a59dd461b7d0d5e00a3c86ed0e (patch)
tree86e5d3612603fdf50b84c4c3fb62b0537da28249 /tests/by-name/ta/taskchampion-sync/test.nix
parenttests/stalwart-*: Hard disable them (diff)
downloadnixos-server-021564ffd40d54a59dd461b7d0d5e00a3c86ed0e.zip
treewide: Rework entry points and attribute names
That just makes a lot of stuff easier and more streamlined. Also, all choices between stable or unstable nixpkgs should now be explicit.
Diffstat (limited to '')
-rw-r--r--tests/by-name/ta/taskchampion-sync/test.nix146
1 files changed, 74 insertions, 72 deletions
diff --git a/tests/by-name/ta/taskchampion-sync/test.nix b/tests/by-name/ta/taskchampion-sync/test.nix
index 54eef45..a8b42ee 100644
--- a/tests/by-name/ta/taskchampion-sync/test.nix
+++ b/tests/by-name/ta/taskchampion-sync/test.nix
@@ -1,92 +1,94 @@
{
- pkgs,
+ packageSets,
vhack,
...
-}:
-vhack.runTest {
- name = "taskchampion-sync";
+}: let
+ pkgs = packageSets.stable;
+in
+ vhack.runTest {
+ name = "taskchampion-sync";
- serverDomains = [
- {server = "taskchampion.server";}
- ];
+ serverDomains = [
+ {server = "taskchampion.server";}
+ ];
- nodes = let
- taskwarriorPackage = pkgs.taskwarrior3.overrideAttrs (final: prev: {
- cmakeFlags = (prev.cmakeFlags or []) ++ ["-DENABLE_TLS_NATIVE_ROOTS=true"];
- });
- in {
- server = {config, ...}: {
- vhack = {
- persist.enable = true;
- nginx.enable = true;
- taskchampion-sync = {
- enable = true;
- fqdn = "taskchampion.server";
+ nodes = let
+ taskwarriorPackage = pkgs.taskwarrior3.overrideAttrs (final: prev: {
+ cmakeFlags = (prev.cmakeFlags or []) ++ ["-DENABLE_TLS_NATIVE_ROOTS=true"];
+ });
+ in {
+ server = {config, ...}: {
+ vhack = {
+ persist.enable = true;
+ nginx.enable = true;
+ taskchampion-sync = {
+ enable = true;
+ fqdn = "taskchampion.server";
+ };
};
};
- };
- task_client1 = {config, ...}: {
- environment.systemPackages = [
- taskwarriorPackage
- ];
- };
- task_client2 = {config, ...}: {
- environment.systemPackages = [
- taskwarriorPackage
- ];
+ task_client1 = {config, ...}: {
+ environment.systemPackages = [
+ taskwarriorPackage
+ ];
+ };
+ task_client2 = {config, ...}: {
+ environment.systemPackages = [
+ taskwarriorPackage
+ ];
+ };
};
- };
- services = [
- {server = "taskchampion-sync-server.service";}
- ];
+ services = [
+ {server = "taskchampion-sync-server.service";}
+ ];
- ports = [
- {server = 443;}
- ];
+ ports = [
+ {server = 443;}
+ ];
- testScript = {nodes, ...}: let
- # Generated with uuidgen
- uuid = "bf01376e-04a4-435a-9263-608567531af3";
- password = "nixos-test";
+ testScript = {nodes, ...}: let
+ # Generated with uuidgen
+ uuid = "bf01376e-04a4-435a-9263-608567531af3";
+ password = "nixos-test";
- mkSyncConfig = path:
- pkgs.writeShellScript "setup-config-file" ''
- set -xe
+ mkSyncConfig = path:
+ pkgs.writeShellScript "setup-config-file" ''
+ set -xe
- mkdir --parents "$(dirname "${path}")"
- echo 'sync.server.url=https://taskchampion.server' >> "${path}"
- echo 'sync.server.client_id=${uuid}' >> "${path}"
- echo 'sync.encryption_secret=${password}' >> "${path}"
- '';
- in
- # Python
- ''
- with subtest("Setup task syncing"):
- for task in [task_client1, task_client2]:
- # See man task-sync(5)
- task.succeed("mkdir ~/.task")
- task.succeed("${mkSyncConfig "$HOME/.taskrc"}")
+ mkdir --parents "$(dirname "${path}")"
+ echo 'sync.server.url=https://taskchampion.server' >> "${path}"
+ echo 'sync.server.client_id=${uuid}' >> "${path}"
+ echo 'sync.encryption_secret=${password}' >> "${path}"
+ '';
+ in
+ # Python
+ ''
+ with subtest("Setup task syncing"):
+ for task in [task_client1, task_client2]:
+ # See man task-sync(5)
+ task.succeed("mkdir ~/.task")
+ task.succeed("${mkSyncConfig "$HOME/.taskrc"}")
- with subtest("Can create tasks"):
- task_client1.succeed("task add 'First task -- task_client1'")
- task_client2.succeed("task add 'First task -- task_client2'")
+ with subtest("Can create tasks"):
+ task_client1.succeed("task add 'First task -- task_client1'")
+ task_client2.succeed("task add 'First task -- task_client2'")
- # Wait for the server to acquire the acme certificate
- task_client1.wait_until_succeeds("curl https://taskchampion.server")
+ # Wait for the server to acquire the acme certificate
+ task_client1.wait_until_succeeds("curl https://taskchampion.server")
- with subtest("Can sync tasks"):
- for task in [task_client1, task_client2]:
- task.succeed("task sync")
- task_client1.succeed("task sync")
+ with subtest("Can sync tasks"):
+ for task in [task_client1, task_client2]:
+ task.succeed("task sync")
+ task_client1.succeed("task sync")
- with subtest("Have correct tasks"):
- count1 = task_client1.succeed("task count")
- count2 = task_client2.succeed("task count")
+ with subtest("Have correct tasks"):
+ count1 = task_client1.succeed("task count")
+ count2 = task_client2.succeed("task count")
- assert int(count1) == 2, f"We don't have exactly 2 tasks, but {count1}"
- assert count1 == count2, f"The clients don't have the same amount of tasks, client1: {count1}, client2: {count2}"
- '';
-}
+ assert int(count1) == 2, f"We don't have exactly 2 tasks, but {count1}"
+ assert count1 == count2, f"The clients don't have the same amount of tasks, client1: {count1}, client2: {count2}"
+ '';
+ }