The sound distributed version control system

#713 Tests don't compile anymore on main

Opened by multun on September 9, 2022
multun on September 9, 2022

bin_diff_test fails to compile

tankf33der on September 9, 2022

Can not confirm.

multun on September 9, 2022

run cargo test on main

multun added a change on September 9, 2022
DSLBAEDTSUX3IPCX3BNHDLPIKLHIZABP6XL37MDSMNREASVOPZSAC
tankf33der on September 10, 2022

+1

finchie on September 26, 2022

I also ran into this issue, however another patch (for libpijul/src/tests/mod.rs) was required to get tests working on main.

finchie added a change on September 26, 2022
DHMXWWMSWJT5EJK4PNCG46ETUJ4CMBWBQXIHCKRCNUUH2ULEFQDAC
joyously on September 27, 2022

I tried cargo test on a fresh clone with these two changes pulled in, and I got 3 failures.

failures:

---- tests::conflict::edit_after_conflict stdout ----
thread 'tests::conflict::edit_after_conflict' panicked at 'assertion failed: `(left == right)`
  left: `Ok("a\npre\n>>>>>>> 1 \npost\ny\npre\n======= 1 \npost\ny\n<<<<<<< 1\nc\n")`,
 right: `Ok("a\npre\n>>>>>>> 1\n>>>>>>> 2 \npost\ny\npre\n======= 2 \npost\ny\n<<<<<<< 2\nc\n======= 1 \n\n<<<<<<< 1\n")`', libpijul/src/tests/conflict.rs:833:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- tests::conflict::edit_conflict_sides stdout ----
thread 'tests::conflict::edit_conflict_sides' panicked at 'assertion failed: `(left == right)`
  left: `Ok("a\npre0\n>>>>>>> 1 \npost0\nx\npre1\n======= 1 \npost1\ny\npre2\n<<<<<<< 1\npost2\nc\nc\n")`,
 right: `Ok("a\npre0\n>>>>>>> 1 \npost0\nx\npre1\n======= 1\n>>>>>>> 2 \npost1\n======= 2 \n\n<<<<<<< 2\ny\npre2\n<<<<<<< 1\npost2\nc\nc\n")`', libpijul/src/tests/conflict.rs:708:5

---- tests::text_changes::hunk_roundtrip_test stdout ----
## Hunk: 

File deletion: "Yh" 15562461196558815645.13293187604556547502 "binary"
D:BF 10381440091355030729.14146891539310959409 -> 15102179113131652586.3404988008920428226:7352858222542416812/1403424514064325944
BFD:BD 15593334306929198365.17650129526746817111 -> 14294166411256165567.15853935310100612994:14198037820171455774/18446744073709551615
-baZA=

In:  FileDel { path: "Yh", pos: PrintablePos(15562461196558815645, 13293187604556547502), encoding: None, del_edges: [PrintableEdge { previous: PrintableEdgeFlags { block: false, folder: false, deleted: true }, flag: PrintableEdgeFlags { block: true, folder: true, deleted: false }, from: PrintablePos(10381440091355030729, 14146891539310959409), to_start: PrintablePos(15102179113131652586, 3404988008920428226), to_end: 7352858222542416812, introduced_by: 1403424514064325944 }], content_edges: [PrintableEdge { previous: PrintableEdgeFlags { block: true, folder: true, deleted: true }, flag: PrintableEdgeFlags { block: true, folder: false, deleted: true }, from: PrintablePos(15593334306929198365, 17650129526746817111), to_start: PrintablePos(14294166411256165567, 15853935310100612994), to_end: 14198037820171455774, introduced_by: 18446744073709551615 }], contents: [105, 144] }

Out: FileDel { path: "Yh", pos: PrintablePos(15562461196558815645, 13293187604556547502), encoding: None, del_edges: [PrintableEdge { previous: PrintableEdgeFlags { block: false, folder: false, deleted: true }, flag: PrintableEdgeFlags { block: true, folder: true, deleted: false }, from: PrintablePos(10381440091355030729, 14146891539310959409), to_start: PrintablePos(15102179113131652586, 3404988008920428226), to_end: 7352858222542416812, introduced_by: 1403424514064325944 }], content_edges: [PrintableEdge { previous: PrintableEdgeFlags { block: true, folder: true, deleted: true }, flag: PrintableEdgeFlags { block: true, folder: false, deleted: true }, from: PrintablePos(15593334306929198365, 17650129526746817111), to_start: PrintablePos(14294166411256165567, 15853935310100612994), to_end: 14198037820171455774, introduced_by: 18446744073709551615 }], contents: [] }

thread '<unnamed>' panicked at 'Hunks don't match.', libpijul/src/tests/text_changes.rs:143:21
thread '<unnamed>' panicked at '[quickcheck] TEST FAILED (runtime error). Arguments: (FileDel { path: "Yh", pos: PrintablePos(15562461196558815645, 13293187604556547502), encoding: None, del_edges: [], content_edges: [PrintableEdge { previous: PrintableEdgeFlags { block: true, folder: true, deleted: true }, flag: PrintableEdgeFlags { block: true, folder: false, deleted: true }, from: PrintablePos(15593334306929198365, 17650129526746817111), to_start: PrintablePos(14294166411256165567, 15853935310100612994), to_end: 14198037820171455774, introduced_by: 18446744073709551615 }], contents: [105, 144] })
Error: "Hunks don't match."', /home/eye/.cargo/registry/src/github.com-1ecc6299db9ec823/quickcheck-1.0.3/src/tester.rs:165:28
thread 'tests::text_changes::hunk_roundtrip_test' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', libpijul/src/tests/text_changes.rs:167:10


failures:
    tests::conflict::edit_after_conflict
    tests::conflict::edit_conflict_sides
    tests::text_changes::hunk_roundtrip_test

test result: FAILED. 100 passed; 3 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.18s

error: test failed, to rerun pass '-p libpijul --lib'
finchie on September 28, 2022

Unsure if this is exactly related to the discussion. While it’s definitely not ideal that these tests fail, they at least compile, which is (at least my understanding of) why this discussion was opened. Perhaps a new discussion should be created to diagnose & fix these failures.