Commit Graph

305 Commits

Author SHA1 Message Date
9825c179a8 impure-tests: migrate bash to pytest and fix stuff
All checks were successful
checks-impure / test (pull_request) Successful in 7s
checks / test (pull_request) Successful in 23s
2023-09-22 18:32:28 +02:00
b482dcd466 make git idempotent
All checks were successful
checks-impure / test (pull_request) Successful in 8s
checks / test (pull_request) Successful in 21s
2023-09-22 16:38:46 +02:00
e3b2424d9d make git optional again 2023-09-22 16:07:39 +02:00
5125ebe1eb Merge pull request 'get rid of impure test' (#323) from Mic92-docs into main
All checks were successful
checks / test (push) Successful in 58s
assets1 / test (push) Successful in 6s
checks-impure / test (push) Successful in 9s
2023-09-22 12:34:51 +00:00
51e8da2a74 config: get rid of impure eval
All checks were successful
checks-impure / test (pull_request) Successful in 8s
checks / test (pull_request) Successful in 23s
2023-09-22 14:32:38 +02:00
0196fd72c3 git.commit_file: fix file path & repo path finding
All checks were successful
checks-impure / test (pull_request) Successful in 11s
checks / test (pull_request) Successful in 1m3s
2023-09-22 13:42:04 +02:00
17520e2553 fix impure tests 2023-09-21 18:29:18 +02:00
0314132a1a rewrite sops backend for secret generation and add tests 2023-09-21 17:22:20 +02:00
6a359c0a2f clan-cli: add git.commit_file() to auto commit files if inside a git
All checks were successful
checks-impure / test (pull_request) Successful in 10s
checks / test (pull_request) Successful in 34s
- commit only if inside a git repo
- commit only the specified file and nothing else
- auto-generate commit message if not specified
2023-09-21 14:07:54 +02:00
0ee6de86af checks: run impure pytest tests in CI pipeline
All checks were successful
checks-impure / test (pull_request) Successful in 10s
checks / test (pull_request) Successful in 34s
2023-09-19 16:46:46 +02:00
c11f73c4d0 clan config: fix settings file location
All checks were successful
checks-impure / test (pull_request) Successful in 12s
checks / test (pull_request) Successful in 1m10s
2023-09-19 15:12:29 +02:00
90718da5b4 Merge pull request 'use experimental flags everywhere' (#298) from Mic92-vm-api into main
Some checks reported warnings
checks / test (push) Has been cancelled
checks-impure / test (push) Has been cancelled
2023-09-19 11:16:30 +00:00
f6a7e42e38 cli: rename admin create to create 2023-09-19 13:12:10 +02:00
d41cca2e28 add clan_core path helper function 2023-09-19 13:12:10 +02:00
a65413c98e use experimental flags everywhere 2023-09-19 13:12:10 +02:00
1bcff16b66 add join clan page
Some checks failed
checks-impure / test (pull_request) Successful in 8s
checks / test (pull_request) Failing after 1m39s
2023-09-16 16:21:33 +02:00
a29f301f84 add vms 2023-09-15 14:02:40 +00:00
87f0b090ef cli: rename clan_flake to test_flake
All checks were successful
checks-impure / test (pull_request) Successful in 9s
checks / test (pull_request) Successful in 1m24s
2023-09-15 12:36:16 +02:00
2697ad54b7 drop useless test_update test
All checks were successful
checks-impure / test (pull_request) Successful in 6s
checks / test (pull_request) Successful in 32s
This test was not finished by me?
Now it's going to be broken by lassulus.
2023-09-14 17:25:48 +02:00
02f421546c rename machine_flake back to clan_flake
All checks were successful
checks-impure / test (pull_request) Successful in 8s
checks / test (pull_request) Successful in 1m22s
2023-09-14 17:06:07 +02:00
2048ffccb0 drop clan_flake fixture
All checks were successful
checks-impure / test (pull_request) Successful in 6s
checks / test (pull_request) Successful in 32s
2023-09-14 16:57:48 +02:00
4905e0cecd move machine_flake fixture to its own file
All checks were successful
checks-impure / test (pull_request) Successful in 8s
checks / test (pull_request) Successful in 1m25s
2023-09-14 16:49:02 +02:00
451ecbb691 rename test_api_machines test to be consistent with the rest
All checks were successful
checks-impure / test (pull_request) Successful in 8s
checks / test (pull_request) Successful in 1m23s
2023-09-14 13:02:58 +02:00
17af763ad1 add edit flag to secret cli
All checks were successful
checks-impure / test (pull_request) Successful in 6s
checks / test (pull_request) Successful in 51s
2023-09-13 10:52:03 +02:00
c3ccf68007 only list valid secrets/users/machines
All checks were successful
checks-impure / test (pull_request) Successful in 6s
checks / test (pull_request) Successful in 58s
Git often leaves empty directories behind
2023-09-07 12:48:34 +02:00
e6762d8b3f sops: add explicit commands to generate secrets
All checks were successful
checks-impure / test (pull_request) Successful in 6s
checks / test (pull_request) Successful in 49s
2023-09-07 11:41:20 +02:00
3bdd3af248 cli: fix nixpkgs unfree import
All checks were successful
checks-impure / test (pull_request) Successful in 12s
checks / test (pull_request) Successful in 1m55s
2023-09-06 17:37:41 +02:00
4ac91ccdcb drop clan flake monkeypatch 2023-09-06 16:04:00 +02:00
0108d84fe3 speed up machine_flake eval 2023-09-06 16:03:40 +02:00
cd8cd62894 Merge pull request 'clan-cli: use dependency flake instead of registry' (#250) from DavHau-deps into main
All checks were successful
checks-impure / test (push) Successful in 12s
checks / test (push) Successful in 1m54s
2023-09-06 12:50:16 +00:00
fcbc3ec899 clan-cli: use dependency flake instead of registry
All checks were successful
checks / test (pull_request) Successful in 1m53s
checks-impure / test (pull_request) Successful in 25s
2023-09-06 14:47:28 +02:00
949b72bd0b actual implement secret rename function
All checks were successful
checks-impure / test (pull_request) Successful in 13s
checks / test (pull_request) Successful in 24s
2023-09-03 11:03:14 +02:00
a1d825d0a0 clan-config: fix: read options from nixosConfigurations instead of nixosModules
All checks were successful
checks-impure / test (pull_request) Successful in 10s
checks / test (pull_request) Successful in 21s
2023-09-02 16:35:59 +02:00
8ca0a2aee4 clan-config: introduce --machine + add tests
All checks were successful
checks / test (pull_request) Successful in 1m16s
checks-impure / test (pull_request) Successful in 4s
2023-08-30 20:59:26 +02:00
af38408a3e secret cli: add get command that returns the key of users/machines
All checks were successful
checks-impure / test (pull_request) Successful in 3s
checks / test (pull_request) Successful in 3s
2023-08-30 11:30:57 +02:00
5e2e95e9c7 clan-cli: add zerotier subcommand 2023-08-29 16:16:11 +02:00
81d02bb218 tests: rewrite port allocation function 2023-08-27 09:34:36 +02:00
b55ceec40c clan-config: use pinned nixpkgs + fix test flake
All checks were successful
build / test (pull_request) Successful in 19s
2023-08-26 23:33:32 +02:00
8c7ee25dc9 webui: fixes for machines endpoint
All checks were successful
build / test (pull_request) Successful in 1m8s
- fix machines settings file location
- raise 404 if machine doesn't exist
- improve machine api test
2023-08-26 14:17:25 +02:00
672e760e2a replace mock_env with monkeypatch
All checks were successful
build / test (pull_request) Successful in 1m5s
2023-08-26 11:45:09 +02:00
fb7c77690a replace environment variable with nixpkgs directory
In this directory we generate all the files that we need to load nixpkgs.
This seems more robust than all those environment variables that may or not may be set.
2023-08-26 11:45:09 +02:00
518bf4197f webui: tests for machine config endpoints
All checks were successful
build / test (pull_request) Successful in 1m4s
2023-08-26 08:46:53 +02:00
fb76ad45e8 webui: implement /api/machines/{name}/schema
All checks were successful
build / test (pull_request) Successful in 18s
2023-08-25 21:26:30 +02:00
33b43ae146 add tests for machines api
All checks were successful
build / test (pull_request) Successful in 15s
2023-08-24 19:16:44 +02:00
58adf91af8 test machine subcommand
All checks were successful
build / test (pull_request) Successful in 27s
2023-08-24 18:28:33 +02:00
6adfadd8b9 re-enable config subcommand if CLAN_OPTIONS_FILE is set 2023-08-24 18:28:33 +02:00
dcbf1613fb delete test_cli test
we already cover this in integration tests
2023-08-24 18:28:33 +02:00
d600a927ea tests: generalize secret cli parser to work for all cli commands 2023-08-24 18:28:33 +02:00
3b099ccb89 clan-cli: move arg parsing to extra method 2023-08-24 18:28:33 +02:00
56542ca5ef mv update command to machines update command 2023-08-24 16:25:06 +02:00
13a6386004 add integration test for webui 2023-08-24 14:09:19 +02:00
b16f314c80 clan-config: add option --quiet
All checks were successful
build / test (pull_request) Successful in 25s
2023-08-23 12:25:02 +02:00
999fbe0d89 clan-config: add readme
Some checks failed
build / test (pull_request) Failing after 24s
Also add capability of reading an option value
2023-08-23 01:01:07 +02:00
780fd881c3 clan-config: fix tests 2023-08-22 21:17:47 +00:00
48686591d8 clan-config: improve and add flake-parts module for clan-config 2023-08-22 21:17:47 +00:00
52d6798315 clan-config: stop using jsonschema at all for CLI
All checks were successful
build / test (pull_request) Successful in 19s
- instead use options.json coming from nixosOptionsDoc
2023-08-15 15:48:17 +02:00
348e503789 clan-config: get rid of jsonschema dependency
All checks were successful
build / test (pull_request) Successful in 27s
2023-08-15 13:29:48 +02:00
51f40a4f09 test_update_cli: also test --help
All checks were successful
build / test (pull_request) Successful in 20s
2023-08-11 17:11:47 +02:00
a096d8ddcc clan-cli: add update command
All checks were successful
build / test (pull_request) Successful in 28s
2023-08-11 16:10:25 +02:00
c9b77e5927 clan-cli/tests/clan_flake: add flake.nix 2023-08-11 16:10:12 +02:00
8bf809d0ec clan-cli/sshd: fix pytest warnings 2023-08-11 16:10:12 +02:00
2a31b1d65b add host_group fixture 2023-08-11 16:10:12 +02:00
b3a665cb19 clan-cli/ssh: rename Group -> HostGroup 2023-08-11 16:10:12 +02:00
0a9b914ad5 clan-config: improve jsonschema arg parsing
All checks were successful
build / test (pull_request) Successful in 21s
- output json to stdout after success
- expect args in the style: `foo.bar = baz`
- handle different input types
- cast input types on best effort basis
- throw meaningful errors
2023-08-11 00:05:52 +02:00
d04278e9b1 clan-config: add tests 2023-08-10 21:17:17 +02:00
2fa0c38625 Merge pull request 'add test for remote ssh commands' (#115) from Mic92-mic92 into main
All checks were successful
build / test (push) Successful in 29s
2023-08-10 09:05:48 +00:00
a17baa4861 add test for remote ssh commands
All checks were successful
build / test (pull_request) Successful in 28s
2023-08-10 11:05:05 +02:00
dd9f1820a5 Merge pull request 'add test for local commands' (#114) from Mic92-mic92 into main
All checks were successful
build / test (push) Successful in 23s
2023-08-09 14:24:06 +00:00
f8f9cd457a add test for local commands
All checks were successful
build / test (pull_request) Successful in 21s
2023-08-09 16:23:15 +02:00
7262208a4c clanLib.jsonschema: move tests from pkgs/clan-cli
All checks were successful
build / test (pull_request) Successful in 26s
2023-08-09 16:05:33 +02:00
9438a9eb5f clan-config: move jsonschema lib to clanLib 2023-08-09 16:05:33 +02:00
d977499ffe rename cli tests to have a common suffix
All checks were successful
build / test (pull_request) Successful in 25s
rename test_import_sops -> test_import_sops
2023-08-09 15:54:27 +02:00
8fea55da32 move ssh cli to cli submodule
Some checks failed
build / test (pull_request) Failing after 23s
2023-08-09 15:46:34 +02:00
daf1058312 clan-cli: fix secrets test
All checks were successful
build / test (pull_request) Successful in 37s
2023-08-09 10:50:48 +02:00
68905fc233 don't add user to a secret if they already can access the secret
Some checks failed
build / test (pull_request) Failing after 21s
If the user is part of a group we don't need to add them explicitly
2023-08-09 10:17:30 +02:00
2988532909 allow to set groups/admins/users when setting secrets
All checks were successful
build / test (pull_request) Successful in 20s
2023-08-08 19:40:35 +02:00
6f9aaef56a add option to import sops secrets with groups,users,machines,prefixes
All checks were successful
build / test (pull_request) Successful in 25s
2023-08-08 18:46:37 +02:00
d8c2df2e72 add test for import-sops command
All checks were successful
build / test (pull_request) Successful in 24s
2023-08-08 16:28:38 +02:00
0533948085 fix rotating keys with sops
All checks were successful
build / test (push) Successful in 8s
2023-08-08 13:44:15 +02:00
b88ac7a2bf clan-config: init
All checks were successful
build / test (push) Successful in 20s
- nixos-modules to jsonschema converter
- nix unit testing via adisbladis/nix-unit
- clan config: configuration CLI for nixos-modules
2023-08-02 20:04:16 +02:00
dab483339a test list/remove secret 2023-08-02 12:00:32 +00:00
658c76336f add secrets integration
clan-cli: also depend on age for secrets
2023-08-02 09:19:14 +00:00
6e7c34cd5c tests/clan-flake: yield flake path rather than homedir
All checks were successful
build / test (push) Successful in 13s
2023-07-28 15:01:37 +02:00
bc7dada58c tests/clan_flake: fix fixture name
All checks were successful
build / test (push) Successful in 12s
2023-07-28 13:47:32 +02:00
29c711db30 add clan_flake fixture to setup a temporary clan
All checks were successful
build / test (push) Successful in 12s
2023-07-28 12:54:49 +02:00
88a2c2656a get_clan_flake_toplevel: fix check
All checks were successful
build / test (push) Successful in 12s
2023-07-28 12:36:01 +02:00
5e5fbfcf06 write test for get_clan_flake_toplevel 2023-07-28 10:22:25 +00:00
df6e94b20e move environment to helpers module
This fixes registering pytest plugins
2023-07-28 10:22:25 +00:00
b4ba9c70cd move moc_env to module 2023-07-26 15:22:52 +02:00
09cc79867d cli: get optional deps from our own flake
All checks were successful
build / test (push) Successful in 10s
This ensures we actually test if all those binaries build
2023-07-26 09:31:49 +02:00
83005a6795 cli: use nixpkgs in nix shell in pure mode
This avoids nixpkgs config and overlay provided by the user.
Also enables caching in nix.
2023-07-26 09:31:49 +02:00
9aa75336b7 cli: use nix_shell also in ssh.py 2023-07-26 06:53:33 +00:00
a6e8e08dec add module to generate zerotier configuration 2023-07-25 19:13:24 +02:00
1183ac9618 clan-cli: format
All checks were successful
build / test (push) Successful in 14s
2023-07-25 15:43:45 +02:00
310bdacb9d clan-cli/ssh: add tests + fixes 2023-07-25 15:16:05 +02:00
a3bcb93f2f clan-cli: split out ssh subcommand, add more tests 2023-07-24 21:15:39 +02:00
0b654c7434 apply treefmt
All checks were successful
build / test (push) Successful in 11s
2023-07-21 14:11:46 +02:00
DavHau
7223b25ac6 clan-cli: fix tests
Some checks failed
build / test (push) Failing after 4s
2023-07-21 14:07:38 +02:00
b7cf89dba8 clan-cli: add missing typing 2023-07-21 13:50:46 +02:00
DavHau
e806b5549d clan-cli: enable mypy for tests
Some checks failed
build / test (push) Failing after 8s
2023-07-21 13:43:29 +02:00
7f937077cf clan-cli/tests: fixup imports 2023-07-21 13:30:49 +02:00
3ce01871e5 fix black and ruff checks 2023-07-21 13:03:51 +02:00
926de547e2 clan-cli/tests: reformat 2023-07-21 12:48:26 +02:00
DavHau
4c4ff01b64 clan-cli: write some unit tests 2023-07-21 11:19:03 +02:00
DavHau
9906d12384 clan-cli: initialize python project from template
clan-cli: remove unnecessary unit test file

clan-cli: fix shell.nix too stateful

clan-cli: remove conftest.py

clan-cli: fix flake-module.nix
2023-07-21 11:19:03 +02:00