Skip to content

Test the CLI against real Nix flakes - #11

Open
Mshehu5 wants to merge 1 commit into
mainfrom
test-flake-integration
Open

Mshehu5 wants to merge 1 commit into
mainfrom
test-flake-integration

Conversation

@Mshehu5

@Mshehu5 Mshehu5 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Closes #8.

The CLI tests used a fake nix script, so they never ran a real flake
check. Now:

  • CLI tests run real nix flake check on a tiny fixture flake
    (tests/flakes/flake.nix) whose check just passes or fails. They
    check that each commit's own flake is checked, that the run stops at
    the first failure, and that shallow clones work.
  • Commit selection tests moved to unit tests in src/history.rs

The CLI tests used a fake nix script, so they never ran a real flake
check. They now run real `nix flake check` on a tiny fixture flake
whose check just passes or fails. Commit selection tests moved to unit
tests in src/history.rs
@Mshehu5
Mshehu5 added this pull request to stack #13 November 13, 2026 14:17
Comment thread tests/cli.rs
String::from_utf8_lossy(&output.stderr)
assert_eq!(validated(&output), [first, second]);
assert_eq!(fixture.repository.head().unwrap().target().unwrap(), head);
assert_eq!(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkout test omits index and untracked files

For checkout preservation, the test checks HEAD and flake.nix only; the removed assert_checkout also compared the index bytes and an untracked file.

oak · automated · da3c5e8

Comment thread tests/flakes/flake.nix
@@ -0,0 +1,27 @@
{
outputs =

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lock-file flag no longer tested

The fixture flake has no inputs, so the new tests never assert --no-update-lock-file or a lock-file update; the removed fake-Nix test asserted it explicitly.

oak · automated · da3c5e8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve test

2 participants