Johannes Kirschbauer
e37f16f47a
treewide(clanLib): rename all occurences of {clan-core,self}.lib to 'clanLib'
2025-04-09 11:32:46 +02:00
DavHau
ba1ad5bd43
sops: prioritize SOPS_AGE_KEY_FILE over local key
...
... instead of loading both keys and raise an error
This is important for testing when one wants to override SOPS_AGE_KEY_FILE
New prio: `SOPS_AGE_KEY` > `SOPS_AGE_KEY_FILE` > `~/.config/sops/age/keys.txt`
2025-04-09 08:45:34 +00:00
DavHau
82b6a52c7c
vars: add feature --no-sandbox
...
Raise warning if sandbox cannot be used -> request user to run with --no-sandbox
2025-04-09 15:02:20 +07:00
hsjobeki
1eb5423b6b
Merge pull request 'pkgs/cli: Move the test folder inside the python module' ( #2973 ) from kenji/clan-core:split-testing-up into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/2973
2025-04-08 20:06:59 +00:00
Johannes Kirschbauer
0ced167912
fix(clan_app/test): fixup after rebase
2025-04-08 21:38:55 +02:00
Sam Lehman
4fe822b340
devshells: name shells for clarity
2025-04-08 19:31:30 +00:00
Johannes Kirschbauer
e9ce7376f2
fix(clan_cli/tests): fix some imports after rebase
2025-04-08 20:26:38 +02:00
Johannes Kirschbauer
69c717ae1f
Tests: reconfigure pytest test folder after moving it into clan_cli
2025-04-08 20:13:13 +02:00
Johannes Kirschbauer
4da6cf594d
Tests: exclude test folder itself from autmatic dataclass checks
2025-04-08 20:12:03 +02:00
a-kenji
fae630842d
pkgs/cli: Move the test folder inside the python module
...
Move the `tests` folder to `clan_cli/tests`.
As we now want part of our tests to live next to the functions that are
tested - tests that are not in the `/tests` module also need access to
the configured test fixtures that are exposed by the `pytest_plugins`
declaration.
The following folder structure doesn't support this model:
```
├── clan_cli
│ ├── api
│ │ └── api_init_test.py
├── tests/
│ ├── conftest.py
│ └── ...
```
Here `api_init_test.py` even when importing the test functions will not
have the fixtures configured.
There is a way to configure python to import the fixtures from another
[`project/module`](https://docs.pytest.org/en/stable/how-to/fixtures.html#using-fixtures-from-other-projects ), but this seems to *generally* be discouraged.
So moving the `conftest.py` to the toplevel and the `/tests` folder into
the toplevel seems to be a sensible choice choice.
2025-04-08 20:12:01 +02:00
Jörg Thalheim
be37194b9a
sops: fix compatibility with new format
...
The new format can have null values now.
2025-04-08 17:44:23 +02:00
Jörg Thalheim
f24df0e33b
user-password: migrate to vars
2025-04-08 10:16:59 +02:00
Michael Hoang
83a2de0f47
cli: don't update macOS machines
2025-04-08 08:53:29 +02:00
Michael Hoang
b5a57a72a0
build-clan: support constructing darwinConfigurations
2025-04-08 08:53:29 +02:00
DavHau
d7c3039666
add CLAN_NO_COMMIT env var to disable committing
...
This is required when calling vars generators for generating vars for
tests
2025-04-07 18:59:19 +07:00
Jörg Thalheim
721f61eaed
only compute final_script and validation hashes once
2025-04-04 18:31:12 +02:00
Jörg Thalheim
340bf4752f
ssh/upload: fix shell quoting
2025-04-04 15:10:09 +00:00
Michael Hoang
7b456be472
cli: managed by clan -> managed by Clan
2025-04-03 00:25:51 +09:00
Michael Hoang
c7ba642a38
cli: machines update [MACHINE] -> machines update [MACHINES]
2025-04-03 00:25:51 +09:00
Qubasa
fb1cea261e
clan-cli: Fix deployment as non root edgecase
2025-03-31 20:25:05 +02:00
Johannes Kirschbauer
ae8e7edac0
feat(clanLib): expose clanInternals.clanLib
...
This is usefully for:
- As api via python
- for testing clanLib downstream
2025-03-30 17:07:11 +02:00
Jonathan Thiessen
89379f103a
Make Generator's validation dynamic
...
* Switch `Generator`'s `validation` from a regular property to
an `@property` annotated method backed by `Machine`'s `eval_nix()`.
* Ensure that `Machine`'s flake cache is flushed after each
effectful generator execution (rather than only after all
generators have been executed).
2025-03-30 04:33:30 +00:00
Jonathan Thiessen
ea7cfc350a
Add dependent vars generator dynamic validation test
2025-03-30 04:33:30 +00:00
Jonathan Thiessen
3c0c2ce9d6
Fix cached None support in FlakeCacheEntry
...
Previously, you could cache None values; however,
insertion wasn't idempotent/identical reinsertion
would lead to errors due to missing None checks.
2025-03-30 04:33:30 +00:00
Jonathan Thiessen
d4fa480262
Add overlapping (consistent) flake cache insert test
...
* Additionally, update `insert`'s input type hint to support None values
(as they are already selectable and (one shot) insertable).
This is necessary to appease the linter wrt the added test.
2025-03-30 04:33:30 +00:00
Luis Hebendanz
3b2ed4e6ab
Merge pull request 'clan-cli: Fix deployment as non root with a buildHost set' ( #3132 ) from Qubasa/clan-core:fix_target_host_as_non_root into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3132
2025-03-29 16:56:49 +00:00
Johannes Kirschbauer
12b88cd19b
feat(classgen): convert only certain attributes
2025-03-29 14:22:34 +01:00
Johannes Kirschbauer
16644309b4
fix(cli/inventory): update classes
2025-03-29 13:25:19 +01:00
Qubasa
a992484fb9
clan-cli: Fix deployment as non root with a buildHost set
2025-03-28 18:47:36 +01:00
Jörg Thalheim
eaf20ae09a
tests: add fake_sudo to sshd fixture
...
This allows to use the same code for both testing and real-world.
2025-03-28 17:14:22 +00:00
Qubasa
2406a62ce0
test_secrets_upload: Don't prepend sudo inside test; Improve secret upload test
2025-03-28 17:14:22 +00:00
Qubasa
0afbf9dd45
checks/installation-without-system: modify to install through normal user instead of root
2025-03-26 18:37:31 +01:00
RTUnreal
0ea9b45838
clan_cli: fix support for non-root deployment user
2025-03-26 18:37:31 +01:00
DavHau
48fa29afad
vars/prompts: print var name even if custom description is set
2025-03-26 10:48:05 +00:00
Jörg Thalheim
9fcf3edab3
add missing lock around "flake" "lock"
2025-03-25 18:30:18 +01:00
Jörg Thalheim
d3a1b29c6b
make gnupg a dependency of sops
...
if anything uses a gnupg key, we need the gnupg binary.
Sucks a bit, but at least it makes it work everywhere.
2025-03-25 18:30:18 +01:00
Jörg Thalheim
3a78dd6ded
fix gpg key fixture on macOS
...
macOS has length limitations for unix sockets, which are violated by the
default length of temporary directories.
2025-03-25 18:30:18 +01:00
Jörg Thalheim
3c7991137a
move git_repo fixture to its own file for consistency
2025-03-25 18:30:11 +01:00
Jörg Thalheim
fb70e715cf
use pre-generate gpg key for tests
...
this is a bit faster.
2025-03-25 18:30:11 +01:00
Jörg Thalheim
c20c0d4ea8
enable python tests without core on macOS
2025-03-25 18:29:49 +01:00
Jörg Thalheim
7a46c8b8de
skip sshd-based tests on macOS for now
2025-03-25 18:29:49 +01:00
Mic92
af15a0eb97
Merge pull request 'don't add nixpkgs to nix registry to not conflict with nixpkgs' ( #3096 ) from nixpkgs-conflict into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3096
2025-03-22 16:16:27 +00:00
lassulus
b925d1c608
Merge pull request 'clan-cli: cleanup broken deployment cache' ( #3066 ) from fix_caching into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3066
2025-03-21 15:49:22 +00:00
Jörg Thalheim
60302dd1d2
tests/sshd: add a 5 second timeout for sshd to start
2025-03-21 12:41:36 +01:00
Qubasa
dfd550f9be
clan-cli: cleanup broken deployment cache
2025-03-20 00:17:36 -07:00
Michael Hoang
62d9a325a2
checks: use pkgs.nixVersions.latest until pkgs.nix is 2.26+
2025-03-20 15:52:13 +09:00
Jörg Thalheim
c5e30a40b4
pytests: use /tmp on macos to avoid unix socket issues
2025-03-19 18:35:38 +01:00
Jörg Thalheim
ddb5bba48a
disabe pytests on macOS for now
2025-03-19 17:33:27 +01:00
Jörg Thalheim
9a00459861
tests/fixtures_flakes: remove unused remote flag
2025-03-19 16:55:30 +01:00
Jörg Thalheim
43035b85a5
always resolve symlinks for TemporaryDirectory
...
On macOS mktemp returns a temporary directory in a symlink.
Nix has a bug where it won't accept path:// located in a symlink.
This avoid this issue by always resolving symlinks as returned by
TemporaryDirectory.
2025-03-19 16:47:18 +01:00