janestreet / ppx_expect

Cram like framework for OCaml
MIT License
141 stars 28 forks source link

[windows] Assertion failure #40

Open rgrinberg opened 2 years ago

rgrinberg commented 2 years ago

This assertion failure happens only on Windows. I can add detailed instruction to reproduce if the stacktrace isn't enough to understand the issue.

Fatal error: exception ("Expect test evaluator bug" (exn "Assert_failure matcher/cst.ml:449:7")
(backtrace
"Raised at Expect_test_matcher__Cst.invariant in file \"matcher/cst.ml\", line 449, characters 7-78\
\nCalled from Expect_test_matcher__Cst.reconcile in file \"matcher/cst.ml\", line 645, characters 2-22\
\nCalled from Expect_test_matcher__Reconcile.expectation_body_internal in file \"matcher/reconcile.ml\", line 170, characters 9-150\
\nCalled from Expect_test_matcher__Reconcile.expectation_body in file \"matcher/reconcile.ml\", line 203, characters 4-131\
\nCalled from Expect_test_matcher__Matcher.evaluate_test.(fun).correction_for in file \"matcher/matcher.ml\", line 215, characters 10-208\
\nCalled from Base__List.rev_filter_map.loop in file \"src/list.ml\", line 944, characters 13-17\
\nCalled from Base__List.filter_map in file \"src/list.ml\" (inlined), line 951, characters 26-47\
\nCalled from Expect_test_matcher__Matcher.evaluate_test in file \"matcher/matcher.ml\" (inlined), line 211, characters 7-1023\
\nCalled from Expect_test_matcher__Matcher.evaluate_test in file \"matcher/matcher.ml\", line 210, characters 4-1023\
\nCalled from Ppx_expect_evaluator.process_group.(fun) in file \"evaluator/ppx_expect_evaluator.ml\", line 161, characters 8-82\
\nCalled from Base__Map.Tree0.fold in file \"src/map.ml\", line 828, characters 64-86\
\nCalled from Base__Map.Accessors.fold in file \"src/map.ml\" (inlined), line 1799, characters 24-50\
\nCalled from Ppx_expect_evaluator.process_group in file \"evaluator/ppx_expect_evaluator.ml\", line 159, characters 4-228\
\nCalled from Ppx_expect_evaluator.evaluate_tests.(fun) in file \"evaluator/ppx_expect_evaluator.ml\", line 219, characters 6-83\
\n")
(filename lev-fiber/test/bip_buffer_tests.ml))
Raised at Base__Error.raise in file "src/error.ml" (inlined), line 9, characters 14-30
Called from Base__Error.raise_s in file "src/error.ml", line 10, characters 19-40
Called from Base__List.count_map in file "src/list.ml", line 480, characters 13-17
Called from Base__List.map in file "src/list.ml" (inlined), line 493, characters 15-31
Called from Ppx_expect_evaluator.evaluate_tests in file "evaluator/ppx_expect_evaluator.ml" (inlined), line 217, characters 5-490
Called from Ppx_expect_evaluator.evaluate_tests in file "evaluator/ppx_expect_evaluator.ml", line 216, characters 2-576
Called from Stdlib__List.map in file "list.ml", line 92, characters 20-23
Called from Stdlib__List.map in file "list.ml", line 92, characters 32-39
Called from Ppx_inline_test_lib__Runtime.exit in file "runtime-lib/runtime.ml", line 646, characters 2-49
Called from Dune__exe__Inline_test_runner_lev_fiber_tests in file "lev-fiber/test/.lev_fiber_tests.inline-tests/inline_test_runner_lev_fiber_tests.ml-gen", line 1, characters 9-44
hhugo commented 2 years ago

As a workaround. Try changing your git config before doing the source checkout.

    steps:
+      - name: Set git to use LF
+        run: |
+          git config --global core.autocrlf false
+          git config --global core.eol lf
+          git config --global core.ignorecase false

      - name: Checkout code
        uses: actions/checkout@v3
rgrinberg commented 2 years ago

Thanks Hugo that seems to work.

hhugo commented 11 months ago

https://github.com/ocaml/ocaml/pull/12514 should make ppx_expect work out of the box without any special git config.