tests/codex: consolidate tests

Reduce test case setup to cover same logic branches.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2026-02-28 10:31:22 -06:00
parent e0bcb05ce9
commit 6f2cb27ea6
7 changed files with 15 additions and 43 deletions

View file

@ -1,17 +0,0 @@
{
home.preferXdgDirectories = true;
programs.codex = {
enable = true;
custom-instructions = ''
- Always respond with emojis
- Only use git commands when explicitly requested
'';
};
nmt.script = ''
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
'export CODEX_HOME="/home/hm-user/.config/codex"'
assertFileExists home-files/.config/codex/AGENTS.md
assertFileContent home-files/.config/codex/AGENTS.md \
${./AGENTS.md}
'';
}

View file

@ -1,14 +0,0 @@
{
programs.codex = {
enable = true;
custom-instructions = ''
- Always respond with emojis
- Only use git commands when explicitly requested
'';
};
nmt.script = ''
assertFileExists home-files/.codex/AGENTS.md
assertFileContent home-files/.codex/AGENTS.md \
${./AGENTS.md}
'';
}

View file

@ -3,9 +3,6 @@
codex-settings-toml-prefer-xdg-directories = ./settings-toml-prefer-xdg-directories.nix;
codex-settings-yaml = ./settings-yaml.nix;
codex-empty-settings = ./empty-settings.nix;
codex-custom-instructions = ./custom-instructions.nix;
codex-custom-instructions-prefer-xdg-directories = ./custom-instructions-prefer-xdg-directories.nix;
codex-empty-custom-instructions = ./empty-custom-instructions.nix;
codex-mcp-integration = ./mcp-integration.nix;
codex-mcp-integration-with-override = ./mcp-integration-with-override.nix;
codex-skills-inline = ./skills-inline.nix;

View file

@ -1,9 +0,0 @@
{
programs.codex = {
enable = true;
custom-instructions = "";
};
nmt.script = ''
assertPathNotExists home-files/.codex/AGENTS.md
'';
}

View file

@ -6,6 +6,7 @@
nmt.script = ''
assertPathNotExists home-files/.codex/config.toml
assertPathNotExists home-files/.codex/config.yaml
assertPathNotExists home-files/.codex/AGENTS.md
assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh 'CODEX_HOME'
'';
}

View file

@ -22,6 +22,10 @@ in
};
};
};
custom-instructions = ''
- Always respond with emojis
- Only use git commands when explicitly requested
'';
};
nmt.script = ''
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
@ -29,5 +33,8 @@ in
assertFileExists home-files/.config/codex/config.toml
assertFileContent home-files/.config/codex/config.toml \
${./config.toml}
assertFileExists home-files/.config/codex/AGENTS.md
assertFileContent home-files/.config/codex/AGENTS.md \
${./AGENTS.md}
'';
}

View file

@ -21,11 +21,18 @@ in
};
};
};
custom-instructions = ''
- Always respond with emojis
- Only use git commands when explicitly requested
'';
};
nmt.script = ''
assertFileExists home-files/.codex/config.toml
assertFileContent home-files/.codex/config.toml \
${./config.toml}
assertFileExists home-files/.codex/AGENTS.md
assertFileContent home-files/.codex/AGENTS.md \
${./AGENTS.md}
assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh 'CODEX_HOME'
'';
}