Skip to content

Commit 0a86f3f

Browse files
committed
nix/tests: assert commits produce new derivations
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I722e9447acfb64dd898c540c2a164a8a6a6a6964
1 parent 46f3d3d commit 0a86f3f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

nix/tests/e2e.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ testers.runNixOSTest {
150150
f"curl -sf 'http://127.0.0.1:3000/api/v1/builds?evaluation_id={e2e_eval_id}' | jq -r '.items[0].drv_path'"
151151
).strip()
152152
assert drv_path.startswith("/nix/store/"), f"Expected /nix/store/ drv_path, got '{drv_path}'"
153+
e2e_drv_path = drv_path
153154
154155
# Get the build ID for later
155156
e2e_build_id = machine.succeed(
@@ -203,6 +204,16 @@ testers.runNixOSTest {
203204
f"test $(curl -sf 'http://127.0.0.1:3000/api/v1/evaluations?jobset_id={e2e_jobset_id}' | jq '.items | length') -gt {before_count_int}",
204205
timeout=60
205206
)
207+
updated_eval_id = machine.succeed(
208+
f"curl -sf 'http://127.0.0.1:3000/api/v1/evaluations?jobset_id={e2e_jobset_id}' "
209+
"| jq -r '.items[] | select(.status==\"completed\") | .id' | head -1"
210+
).strip()
211+
updated_drv_path = machine.succeed(
212+
f"curl -sf 'http://127.0.0.1:3000/api/v1/builds?evaluation_id={updated_eval_id}' "
213+
"| jq -r '.items[0].drv_path'"
214+
).strip()
215+
assert updated_drv_path != e2e_drv_path, \
216+
"Expected the updated commit to produce a different derivation"
206217
207218
with subtest("Queue runner builds pending derivation"):
208219
# Poll the E2E build until succeeded (queue-runner is already running)

0 commit comments

Comments
 (0)