arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git
Apache License 2.0
3.37k stars 80 forks source link

Harmless `amend` test failures with git 2.44.1 #1345

Open bryango opened 2 weeks ago

bryango commented 2 weeks ago

Description of the bug

There are some seemingly harmless test failures with git 2.44.1 related to amend and AUTO_MERGE. Is it safe to temporarily disable these tests for now? I am trying to package the latest (0.9.0) version in nixpkgs.

failures:

---- test_amend_with_children stdout ----
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: amend_with_children
Source: git-branchless/tests/test_amend.rs:25
────────────────────────────────────────────────────────────────────────────────
Expression: stderr
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    0     0 │ branchless: creating working copy snapshot␊
    1       │-branchless: processing 1 update: ref HEAD
          1 │+branchless: processing 1 update: ref HEAD␊
          2 │+branchless: processing 1 update: ref AUTO_MERGE␊
          3 │+branchless: processing 1 update: ref AUTO_MERGE␊
────────────┴───────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
The application panicked (crashed).
Message:  snapshot assertion for 'amend_with_children' failed in line 25
Location: /build/git-branchless-0.9.0-vendor.tar.gz/insta/src/runtime.rs:563

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

---- test_amend_undo_detached_head stdout ----
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: amend_undo_detached_head-3
Source: git-branchless/tests/test_amend.rs:660
────────────────────────────────────────────────────────────────────────────────
Expression: stdout
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    0     0 │ Will apply these actions:␊
    1       │-1. Check out from 94b1077 create file1.txt␊
          1 │+1. Empty event for AUTO_MERGE␊
          2 │+   This may be an unsupported use-case; see https://github.com/arxanas/git-branchless/issues/57␊
          3 │+2. Check out from 94b1077 create file1.txt␊
    2     4 │                to c0bdfb5 create file1.txt␊
    3       │-2. Restore snapshot for c0bdfb5 create file1.txt␊
          5 │+3. Restore snapshot for c0bdfb5 create file1.txt␊
    4     6 │         backed up using 55e9304 branchless: automated working copy snapshot␊
    5       │-3. Rewrite commit 94b1077 create file1.txt␊
          7 │+4. Rewrite commit 94b1077 create file1.txt␊
    6     8 │               as c0bdfb5 create file1.txt␊
    7       │-4. Restore snapshot for c0bdfb5 create file1.txt␊
          9 │+5. Restore snapshot for c0bdfb5 create file1.txt␊
    8    10 │         backed up using 55e9304 branchless: automated working copy snapshot␊
    9    11 │ branchless: running command: <git-executable> checkout 55e9304c975103af25622dca880679182506f49f␊
   10    12 │ branchless: running command: <git-executable> reset --hard HEAD␊
   11    13 │ HEAD is now at 55e9304 branchless: automated working copy snapshot␊
┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
   15    17 │ M file1.txt␊
   16    18 │ O f777ecc (master) create initial.txt␊
   17    19 │ |␊
   18    20 │ @ c0bdfb5 create file1.txt␊
   19       │-Applied 4 inverse events.
         21 │+Applied 5 inverse events.␊
────────────┴───────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
The application panicked (crashed).
Message:  snapshot assertion for 'amend_undo_detached_head-3' failed in line 660
Location: /build/git-branchless-0.9.0-vendor.tar.gz/insta/src/runtime.rs:563

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

---- test_amend_undo stdout ----
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: amend_undo-5
Source: git-branchless/tests/test_amend.rs:562
────────────────────────────────────────────────────────────────────────────────
Expression: stdout
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    0     0 │ Will apply these actions:␊
    1       │-1. Move branch foo from 94b1077 create file1.txt␊
          1 │+1. Empty event for AUTO_MERGE␊
          2 │+   This may be an unsupported use-case; see https://github.com/arxanas/git-branchless/issues/57␊
          3 │+2. Move branch foo from 94b1077 create file1.txt␊
    2     4 │                      to 94b1077 create file1.txt␊
    3       │-2. Check out from 94b1077 create file1.txt␊
          5 │+3. Check out from 94b1077 create file1.txt␊
    4     6 │                to 94b1077 create file1.txt␊
    5       │-3. Restore snapshot for branch foo␊
          7 │+4. Restore snapshot for branch foo␊
    6     8 │             pointing to 94b1077 create file1.txt␊
    7     9 │         backed up using b4371f8 branchless: automated working copy snapshot␊
    8       │-4. Move branch foo from 94b1077 create file1.txt␊
         10 │+5. Move branch foo from 94b1077 create file1.txt␊
    9    11 │                      to c0bdfb5 create file1.txt␊
   10       │-5. Rewrite commit 94b1077 create file1.txt␊
         12 │+6. Rewrite commit 94b1077 create file1.txt␊
   11    13 │               as c0bdfb5 create file1.txt␊
   12       │-6. Restore snapshot for branch foo␊
         14 │+7. Restore snapshot for branch foo␊
   13    15 │             pointing to c0bdfb5 create file1.txt␊
   14    16 │         backed up using a293e0b branchless: automated working copy snapshot␊
   15    17 │ branchless: running command: <git-executable> checkout a293e0b4502882ced673f83b6742539ee06cbc74 -B foo␊
   16    18 │ branchless: running command: <git-executable> reset --hard HEAD␊
┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
   23    25 │ branchless: running command: <git-executable> symbolic-ref HEAD refs/heads/foo␊
   24    26 │ O f777ecc (master) create initial.txt␊
   25    27 │ |␊
   26    28 │ @ c0bdfb5 (> foo) create file1.txt␊
   27       │-Applied 6 inverse events.
         29 │+Applied 7 inverse events.␊
────────────┴───────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
The application panicked (crashed).
Message:  snapshot assertion for 'amend_undo-5' failed in line 562
Location: /build/git-branchless-0.9.0-vendor.tar.gz/insta/src/runtime.rs:563

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

failures:
    test_amend_undo
    test_amend_undo_detached_head
    test_amend_with_children

test result: FAILED. 12 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.14s

error: test failed, to rerun pass `--test test_amend`

This is probably related to what's found in #1245.

Expected behavior

No response

Actual behavior

No response

Version of rustc

rustc 1.77.2 (25ef9e3d8 2024-04-09) (built from a source tarball)

Automated bug report

No response

Version of git-branchless

git-branchless 0.9.0

Version of git

git version 2.44.1

arxanas commented 2 weeks ago

Are they the same as the test failures on master CI? If so, fine to ignore for now.

bryango commented 2 weeks ago

Are they the same as the test failures on master CI?

Unfortunately they are not exactly the same... Although both are related to the amend command.

arxanas commented 2 weeks ago

It's probably safe to ignore these, but FWIW I wasn't able to reproduce them myself with git v2.44.1 + git-branchless v0.9.0. Just to make sure, are you setting the TEST_GIT and TEST_GIT_EXEC_PATH environment variables appropriately? See this CI job for an example: https://github.com/arxanas/git-branchless/blob/8651f9200e1deb8d912ac913e97951ffd195f097/.github/workflows/linux-git-devel.yml#L63-L68