Skip to content

Point a failed check at the check, not at the test - #488

Merged
samoht merged 2 commits into
mirage:mainfrom
samoht:fix-check-location
Nov 13, 2026
Merged

samoht merged 2 commits into
mirage:mainfrom
samoht:fix-check-location

Conversation

@samoht

@samoht samoht commented Nov 12, 2026

Copy link
Copy Markdown
Member

Since #451, a failure is located at the outermost frame of the test body, so a failed check in a helper reports the line where the test calls the helper. 1.9.1 reported the line of the check, and Test.check still documents that Alcotest guesses the location of the check.

A failed check now takes the innermost frame before Alcotest. Other exceptions keep the line of the test body.

Seen in owl 1.1, where test_rough_cdf_matches reported line 779 (the List.iter) instead of line 757 (the check). The new case in test_failure_shapes.ml reproduces it, and fails without the change to core.ml.

Since mirage#451, a failure is located at the outermost frame of the test
body, so a check in a helper called by the test reported the line of the
call to the helper. 1.9.1 reported the line of the check, and Test.check
still documents that Alcotest guesses the location of the check. A
failed check now takes the innermost frame before Alcotest; other
exceptions keep the line of the test body.

Seen in owl 1.1, whose test_rough_cdf_matches reported line 779 (the
List.iter) instead of line 757 (the check).
@samoht
samoht merged commit eef2817 into mirage:main Nov 13, 2026
7 checks passed
@samoht
samoht deleted the fix-check-location branch November 13, 2026 00:08
jmid pushed a commit to ocaml/opam-repository that referenced this pull request Nov 17, 2026
CHANGES:

- Fix parallel test runs failing with `Failed 6 times to create symlink`, and
  a dangling `latest` link (mirage/alcotest#479, @samoht, fixes mirage/alcotest#471 and mirage/alcotest#472 in 1.10.0)
- Fix tests failing with `EACCES` on a read-only source tree or with
  `DUNE_BUILD_DIR` (mirage/alcotest#480, @samoht, fixes mirage/alcotest#471 in 1.10.0)
- Honour `ALCOTEST_SOURCE_CODE_POSITION` when set by the program before `run`
  (mirage/alcotest#481, @samoht, fixes mirage/alcotest#451 in 1.10.0)
- Fix slow runs of suites with many cases of the same name (mirage/alcotest#482, @samoht,
  fixes mirage/alcotest#451 in 1.10.0)
- Under Eio, point the failure locations added in 1.10.0 (mirage/alcotest#451) at the test,
  not at the scheduler (mirage/alcotest#484, fixes mirage/alcotest#478, @samoht, report by @talex5)
- Point a failed `check` in a helper at the `check`, as in 1.9.1, not at the
  test that calls the helper (mirage/alcotest#488, @samoht, fixes mirage/alcotest#451 in 1.10.0)
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.

1 participant