Unflakify deployment tests #449

Merged
Niols merged 6 commits from Niols/Fediversity:unflakify-tests-3 into main 2025-07-09 15:07:04 +02:00
Owner

This PR builds on top of #447 and #448. Since these might be rejected, there will be some changes needed for this PR as well. Let's see how the discussions go in #447.

In the meantime, @fricklerhandwerk, would you mind (in)validating the core idea of this PR? You only need to look at 7cf43c4041, really.

This PR builds on top of #447 and #448. Since these might be rejected, there will be some changes needed for this PR as well. Let's see how the discussions go in #447. In the meantime, @fricklerhandwerk, would you mind (in)validating the core idea of this PR? You only need to look at https://git.fediversity.eu/Niols/Fediversity/commit/7cf43c404178dbf3501b955349836fc8b5a4ec5c, really.
Niols added 8 commits 2025-07-08 15:58:13 +02:00
Get rid of flake dependency on flake-parts - grab it from npins
Some checks failed
/ check-data-model (pull_request) Successful in 31s
/ check-peertube (pull_request) Successful in 21s
/ check-panel (pull_request) Successful in 1m28s
/ check-deployment-basic (pull_request) Successful in 11m37s
/ check-deployment-cli (pull_request) Successful in 40m29s
/ check-pre-commit (pull_request) Successful in 13s
/ check-deployment-panel (pull_request) Has been cancelled
e9f7409ed0
Also define systems in mkFlake.nix
All checks were successful
/ check-pre-commit (pull_request) Successful in 14s
/ check-data-model (pull_request) Successful in 30s
/ check-peertube (pull_request) Successful in 21s
/ check-panel (pull_request) Successful in 1m31s
/ check-deployment-basic (pull_request) Successful in 11m14s
/ check-deployment-cli (pull_request) Successful in 39m1s
/ check-deployment-panel (pull_request) Successful in 43m7s
f7a55963ec
Grab git-hooks from npins
Some checks failed
/ check-pre-commit (pull_request) Successful in 17s
/ check-data-model (pull_request) Successful in 37s
/ check-peertube (pull_request) Successful in 25s
/ check-panel (pull_request) Successful in 1m35s
/ check-deployment-basic (pull_request) Failing after 7m10s
/ check-deployment-cli (pull_request) Failing after 7m37s
/ check-deployment-panel (pull_request) Failing after 8m23s
a6b6d66292
Panel deployment test: same
Some checks failed
/ check-pre-commit (pull_request) Successful in 13s
/ check-data-model (pull_request) Successful in 30s
/ check-peertube (pull_request) Successful in 20s
/ check-panel (pull_request) Successful in 1m30s
/ check-deployment-cli (pull_request) Has been cancelled
/ check-deployment-panel (pull_request) Has been cancelled
/ check-deployment-basic (pull_request) Has been cancelled
1190a54e0a
Niols added 1 commit 2025-07-08 16:06:35 +02:00
Plug everything directly from deployment/flake-part.nix
All checks were successful
/ check-pre-commit (pull_request) Successful in 14s
/ check-data-model (pull_request) Successful in 30s
/ check-peertube (pull_request) Successful in 20s
/ check-panel (pull_request) Successful in 1m30s
/ check-deployment-basic (pull_request) Successful in 11m5s
/ check-deployment-cli (pull_request) Successful in 39m39s
/ check-deployment-panel (pull_request) Successful in 44m28s
aba96a84d5
kiara approved these changes 2025-07-08 17:59:46 +02:00
kiara left a comment
Owner

for what it's worth, i don't currently have strong opinions on this, so i'll leave it to y'all

for what it's worth, i don't currently have strong opinions on this, so i'll leave it to y'all
fricklerhandwerk approved these changes 2025-07-09 08:34:52 +02:00
fricklerhandwerk left a comment
Owner

LGTM conceptually! More comments on mkFlake in the respective PR.

LGTM conceptually! More comments on mkFlake in the respective PR.
fricklerhandwerk reviewed 2025-07-09 10:19:32 +02:00
@ -136,2 +136,3 @@
## instance by allowing to grab things directly from the host's store.
with subtest("Override the lock"):
with subtest("Override the flake and its lock"):
deployer.succeed("cp ${config.pathFromRoot}/flake-under-test.nix flake.nix")

It may be worth noting in a comment here that we're otherwise using the entire repository as is. Otherwise it's slightly too magical when you try to trace it through in your head.

It may be worth noting in a comment here that we're otherwise using the entire repository as is. Otherwise it's slightly too magical when you try to trace it through in your head.
Author
Owner

Fair enough. I have added a comment explaining this. (Only locally on my machine for now, as I don't want to overwhelm our CI.)

Fair enough. I have added a comment explaining this. (Only locally on my machine for now, as I don't want to overwhelm our CI.)

CI-killing comments...

CI-killing comments...
Author
Owner

Yeah, frustrating! It will come as soon as I rebase after the merge of #448.

Yeah, frustrating! It will come as soon as I rebase after the merge of #448.
fricklerhandwerk marked this conversation as resolved
fricklerhandwerk reviewed 2025-07-09 10:22:59 +02:00
@ -138,4 +139,3 @@
deployer.succeed("""
nix flake lock --extra-experimental-features 'flakes nix-command' \
--offline -v \
--override-input flake-parts ${inputs.flake-parts} \

Arguably we don't need flake inputs here at all as we can pass store paths via sources here, which means we don't need flakes at all at the project level (unless flake-parts wants a root flake to do its thing). Not saying we need to pull through with that now, just trying to separate accidental from essential complexity.

Arguably we don't need flake inputs here at all as we can pass store paths via `sources` here, which means we don't need flakes at all at the project level (unless flake-parts wants a root flake to do its thing). Not saying we need to pull through with that now, just trying to separate accidental from essential complexity.
Author
Owner

Is this comment different from #449 (comment)?

Is this comment different from https://git.fediversity.eu/Fediversity/Fediversity/pulls/449#issuecomment-8697?

I thought it was but seems like it's not.

I thought it was but seems like it's not.
fricklerhandwerk marked this conversation as resolved
fricklerhandwerk reviewed 2025-07-09 10:25:13 +02:00
@ -135,3 +135,3 @@
## NOTE: This is super slow. It could probably be optimised in Nix, for
## instance by allowing to grab things directly from the host's store.
with subtest("Override the lock"):
with subtest("Override the flake and its lock"):

Regarding the slowness -- do we even need the flake-under-test to have flake inputs? If we make the right store paths available in the test VM (e.g. by mounting the host store) we may as well get the sources in that flake-under-test from npins and save ourselves the lock override.

Regarding the slowness -- do we even *need* the flake-under-test to have flake inputs? If we make the right store paths available in the test VM (e.g. by mounting the host store) we may as well get the sources in that flake-under-test from npins and save ourselves the lock override.
Author
Owner

Well in my head we were aiming to have our flake.nix without inputs, grabbing everything from npins. This would then also give this for free: our flake-under-test.nix files would indeed be simple, grab everything from npins as well, and we would not have this slowness anymore.

Of course, we can still have our flake-under-test.nix have no flake inputs and grab everything from npins, while flake.nix still has some regular flake inputs, but then we have the problem of aligning the npins and flake dependencies.

I think we shouldn't tackle this in this PR. We should have a subsequent PR showing a way to grab nixops4 and nixops4-nixos from npins, and using that to replace the flake inputs of the flake-under-test.nix files, but maybe also from the flake.nix file.

Well in my head we were aiming to have our `flake.nix` without inputs, grabbing everything from npins. This would then also give this for free: our `flake-under-test.nix` files would indeed be simple, grab everything from npins as well, and we would not have this slowness anymore. Of course, we can still have our `flake-under-test.nix` have no flake inputs and grab everything from npins, while `flake.nix` still has some regular flake inputs, but then we have the problem of aligning the npins and flake dependencies. I think we shouldn't tackle this in this PR. We should have a subsequent PR showing a way to grab `nixops4` and `nixops4-nixos` from npins, and using that to replace the flake inputs of the `flake-under-test.nix` files, but maybe also from the `flake.nix` file.

Yes agreed. And I didn't imply we should do anything about that in this PR.

Yes agreed. And I didn't imply we should do anything about that in this PR.
Niols marked this conversation as resolved
Niols force-pushed unflakify-tests-3 from aba96a84d5 to e0a4d652b4 2025-07-09 13:23:15 +02:00 Compare
Niols merged commit de38611572 into main 2025-07-09 15:07:04 +02:00
Niols deleted branch unflakify-tests-3 2025-07-09 15:07:04 +02:00
Niols referenced this pull request from a commit 2025-07-09 15:07:05 +02:00
Sign in to join this conversation.
No description provided.