Commit Graph

63 Commits

Author SHA1 Message Date
Jörg Thalheim
15b0a84314 nixoTestLib: split setting up function for port-forwarding and setuping up flake 2025-07-04 16:56:42 +02:00
Jörg Thalheim
a58e128b3a inline create_test_machine again 2025-07-04 14:36:05 +02:00
Jörg Thalheim
f5b54443da move nixosTestLib to pkgs/testing 2025-07-04 14:36:05 +02:00
Jörg Thalheim
3059f10da3 move setup_nix_in_nix into nixos_test_lib 2025-07-04 14:36:02 +02:00
Jörg Thalheim
63397a7c8b share more code between installation and update test 2025-07-04 14:14:28 +02:00
Jörg Thalheim
2a64e50798 change install test to run clan outside of the VM 2025-07-04 14:14:28 +02:00
lassulus
a055b4d1eb refactor: remove deployment.json and use direct selectors
- Remove deployment.json file generation from outputs.nix
- Add throw for deprecated deployment.file usage with upgrade instructions
- Remove vars data from deployment.data
- Update Machine class to use direct select() calls instead of deployment property
- Update all deployment property accesses to use direct selectors
- Add precaching for frequently accessed values in update.py:
  - Module paths for facts and vars
  - Deployment settings (requireExplicitUpdate, nixosMobileWorkaround)
  - Services and generators data
  - Secret upload locations
- This removes unnecessary JSON serialization and makes the code more composable
2025-07-02 20:56:23 +02:00
DavHau
e219a636ca checks: fix some tests not named correctly 2025-06-30 19:50:16 +07:00
Johannes Kirschbauer
d8d49c9d72 chore: clean up logic around clanInternals 2025-06-26 16:12:35 +02:00
Jörg Thalheim
a6914a0598 use a clan-core snapshots for ci tests
We currently have to re-run our integration tests a lot because they are
depending on the whole repository. This pull request changes locks the
clan-core used for vm tests. This has the caveat that we might not run
the latest NixOS machine of our profiles. On the upside we can test
behaviour against an older clan-core version and capture breakages and
make it backwards compatible. If we actually want to test the latest
version, the PR that changes the exposed flake api, could also bump the
clan-core snapshot.
2025-05-12 13:21:25 +02:00
DavHau
e2d1ca0439 ci-performance: remove self reference from installation test 2025-04-30 15:53:18 +07:00
Johannes Kirschbauer
abd9519412 Refactor: move checks/lib into lib/ to avoid duplicate lib
Lets avoid the mistake of nixpkgs having multiple
libs
2025-04-23 16:19:16 +02:00
Johannes Kirschbauer
75c8541a8d tests(clan): move test-inventory.nix to clanLib. And name it 'makeTestClan'
Exposing the function via clanLib makes it more accessible to clan modules
This allows each module to define its own test without needing to depend on any fileSystem path assumptions in the clan-core repo
2025-04-15 18:17:40 +02:00
Michael Hoang
fe523e928d treewide: switch back to pkgs.nix 2025-04-12 13:15:53 +02:00
RTUnreal
3e6518b0fc checks: fix shellcheck errors 2025-04-09 19:44:00 +02:00
Jörg Thalheim
2c83211c1d checks/installation: restore the install without system aspect 2025-04-09 11:32:28 +00:00
Jörg Thalheim
e25cd73e99 installation: use clan-cli-full so that nix doesn't try to evaluate deps 2025-04-09 09:52:56 +00:00
Jörg Thalheim
4e9c214c68 checks/installation: move updating hardware configuration to it's own test
for some reason those are very slow. Moving them to their own test
breaks down the critical path.
2025-04-09 09:52:56 +00:00
Jörg Thalheim
164b1a6c68 installation: speed up by installing to localhost
we test other types of installation already in nixos-anywhere so we can
speed up this test quite a bit by not having a seperate machine to
install to.
2025-04-09 09:36:46 +00:00
Jörg Thalheim
1ba872f75f installation: use ip addresses to decrease flakiness 2025-04-08 21:19:47 +02:00
Jörg Thalheim
d45deff922 replace original installation test with installation-without-system 2025-04-08 20:41:31 +02:00
Jörg Thalheim
99bcd3f797 installation: use networkd everywhere 2025-04-08 10:33:48 +02:00
Michael Hoang
199bac0201 checks: disable all failing aarch64-linux checks 2025-03-24 12:50:57 +09:00
Jörg Thalheim
a4ded2fd70 tests/installer/client: increase RAM 2025-03-22 17:07:52 +01: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
88a516855a work around in installation test by using newer nix version 2025-03-18 13:29:28 +01:00
Michael Hoang
0ec2797441 checks/installation: use test-flake instead of self 2025-03-10 11:58:32 +09:00
DavHau
74b30cca9f switch to nixpkgs hosteded by cache.nixos.org
take 2 on https://git.clan.lol/clan/clan-core/pulls/2921
2025-03-07 07:20:07 +00:00
Michael Hoang
9458fdf7bc clan-cli: fix clan-cli accidentally dependending on all packages 2025-02-04 04:52:47 +00:00
lassulus
292a488cce extend installation-test to check partitioning secrets 2025-01-21 11:13:51 +00:00
Jörg Thalheim
cb8ca601e2 switch to nixos-facter for hardware-config 2025-01-15 13:59:49 +00:00
lassulus
b09d3b15a7 installer-test: adapt to upstream changes 2024-12-09 17:21:14 +01:00
Jörg Thalheim
4a49c10451 disable installation/backup test on arm64 2024-12-06 17:03:57 +01:00
Jörg Thalheim
68dd2b9b9d installation: fix correct binary on aarch64 2024-12-06 15:39:35 +00:00
DavHau
c2a60dcbb6 tests: minify test machines to decrease runtime 2024-11-13 20:40:01 +07:00
a-kenji
23d0e2f115 pkgs/cli: Query target-host for machines install from configuration
Query `target-host` for `clan machines install` from the nixos
configuration (deployment.json), if possible.

Remove `TARGET_HOST` option and introduce `--target-host` command
line flag.

This brings the installation subcommand in line with the update
subcommand - improving consistency and usability.

Closes: #2309
2024-11-10 18:18:51 +01:00
Jörg Thalheim
2f3369cca5 add build-on-remote flag 2024-11-04 13:27:50 +01:00
Jörg Thalheim
036918aae2 fix nixos machines without hostPlatform 2024-10-09 12:08:23 +02:00
Jörg Thalheim
5f4bf819df add nixos-facter to nixos installation test 2024-09-29 16:59:02 +02:00
Jörg Thalheim
8a8b473236 rename hw-generate to update-hardware-config 2024-09-20 13:42:18 +02:00
a-kenji
b13ed922b1 Revert "Merge pull request 'machine_id_v2' (#2052) from Qubasa/clan-core:machine_id_v2 into main"
This reverts commit 22a11abfe5, reversing
changes made to 208b71ac0e.
2024-09-10 14:01:12 +02:00
Qubasa
5c975a5eef clanCore: init machineId and diskId v2 2024-09-09 15:51:31 +02:00
Qubasa
2efa096d29 revert machine_id pull request 2024-09-06 21:38:50 +02:00
Qubasa
4171d5ea4e clanCore: init machine_id.nix with clan.core.machine.{id,diskId} 2024-09-06 18:05:40 +02:00
Qubasa
e35fd0976a nixosModules: remove unnecessary ./iso and disk-layout, clanModules: fix issue #1349 2024-09-03 00:09:45 +02:00
Jörg Thalheim
a2471bf3ec hw-generate: add to nixos test 2024-08-24 12:07:22 +02:00
Jörg Thalheim
d365699991 use compliant machine name in installation test 2024-08-24 12:07:22 +02:00
DavHau
79d6f8e893 Reapply "clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking}"
This reverts commit 71009f80d8.

workaround upstream bug: https://github.com/NixOS/nixpkgs/issues/324802
2024-07-05 19:29:01 +07:00
Jörg Thalheim
71009f80d8 Revert "clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking}"
This reverts commit 18b64f2d0b.

The old configuration cannot be updated like this:

eve] error:
[eve]        … while calling the 'head' builtin
[eve]          at /nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/lib/attrsets.nix:1575:11:
[eve]          1574|         || pred here (elemAt values 1) (head values) then
[eve]          1575|           head values
[eve]              |           ^
[eve]          1576|         else
[eve]
[eve]        … while evaluating the attribute 'value'
[eve]          at /nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/lib/modules.nix:809:9:
[eve]           808|     in warnDeprecation opt //
[eve]           809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
[eve]              |         ^
[eve]           810|         inherit (res.defsFinal') highestPrio;
[eve]
[eve]        … while evaluating the option `system.build.toplevel':
[eve]
[eve]        … while evaluating definitions from `/nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/nixos/modules/system/activation/top-level.nix':
[eve]
[eve]        … while evaluating the option `assertions':
[eve]
[eve]        … while evaluating definitions from `/nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/nixos/modules/system/boot/systemd.nix':
[eve]
[eve]        … while evaluating the option `systemd.services':
[eve]
[eve]        … while evaluating definitions from `/nix/store/kpzcdgndym0qm1w490mjvk9c2qmz03h5-source/nixosModules/clanCore/zerotier':
[eve]
[eve]        … while evaluating the option `clan.core.networking.zerotier.networkId':
[eve]
[eve]        (stack trace truncated; use '--show-trace' to show the full, detailed trace)
[eve]
[eve]        error: A definition for option `clan.core.networking.zerotier.networkId' is not of type `null or string'. Definition values:
[eve]        - In `/nix/store/kpzcdgndym0qm1w490mjvk9c2qmz03h5-source/nixosModules/clanCore/networking.nix':
[eve]            {
[eve]              _type = "override";
[eve]              content = "267efd4a15b69623";
[eve]              priorit
2024-07-05 11:16:05 +02:00
DavHau
18b64f2d0b clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking} 2024-07-04 17:05:37 +07:00