Skip to content

test: wire up the CT suites ELP reported as unreachable, and bump erlang-ci - #176

Merged
Taure merged 1 commit into
mainfrom
fix/unreachable-ct-tests
Aug 11, 2026
Merged

test: wire up the CT suites ELP reported as unreachable, and bump erlang-ci#176
Taure merged 1 commit into
mainfrom
fix/unreachable-ct-tests

Conversation

@Taure

@Taure Taure commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Found while auditing whether kura's ELP settings matched reality after widgrensit/asobi#436.

kura's enable-elp-lint: true has been green, but only because the pinned erlang-ci (v2.0.5) installs ELP 2026-02-27, which does not carry the W0008 diagnostic. Under current ELP the tree has 5 lint errors, so a routine pin bump would have turned CI red with no obvious connection to the bump.

Three findings, two different fixes

collect_batches/1 in both coverage suites is a helper that drains batch messages, not a test case. ELP cannot tell: a name/1 in a CT suite that is not in all/0 looks exactly like a test case that never runs. Rather than a suppression comment, it now takes the drain window as a second argument - that says "helper" structurally, and puts the timeout at the call site next to the batch size it is waiting on.

insert_with_opts_returning_rows/1 was the real one, and worse than ELP could tell. It was never in all/0, and had it been, it asserted nothing:

insert_with_opts_returning_rows(_Config) ->
    %% Insert with on_conflict returning empty rows (noop branch, line 175-176)
    ok.

The branch it names is already covered by insert_with_opts_on_conflict_columns two functions above, which inserts the same unique key twice under {{columns, [name, email]}, nothing}. So this is dead weight, not missing coverage, and it is removed rather than wired in - a test that runs and asserts nothing is worse than no test.

Pin bump has to land with it

v2.0.5 -> v2.1.7. That moves ELP to 2026-08-10 (Taure/erlang-ci#71, #72, #73), which is the version that reports W0008 at all - so the bump and this cleanup have to go together or CI goes red on the three above.

v2.1.7 also compiles the test profile before linting, which is what removes the other two errors: kura_custom_type_tests and kura_types_prop_tests both -include_lib("proper/include/proper.hrl"), and under the old rebar3 compile those deps were never fetched, so ELP reported undefined function proper_transformer:parse_transform/2 for both. Measured on this tree: 5 errors before, 3 after the profile change, 0 after this cleanup.

Verification

  • kura_coverage_SUITE + kura_coverage2_SUITE: 87/87.
  • elp lint: 0 errors (29 warnings, unchanged), was 5.
  • rebar3 fmt --check, xref: clean.
  • kura_resilience_tests fails locally (2 failures, 1 cancelled) because it takes docker-compose control and another checkout holds port 5555. It fails identically on unmodified main and is skipped in CI, so it is environmental and unrelated.

Not in this PR

enable-elp-eqwalize stays false: 92 errors on this tree (76 incompatible_types, 16 redundant_nowarn_function). Worth noting the 16 redundant_nowarn_function are cheap - eqwalizer saying suppressions are no longer needed - so the real work is closer to 76. asobi tracks the equivalent in widgrensit/asobi#435 if you want the same shape of plan here.

…ang-ci

ELP's W0008 flagged three functions in the coverage suites as unreachable test
cases. Two are false positives and one is real, and they need opposite fixes.

`collect_batches/1` in both suites is a helper that drains batch messages, not
a test case - but a `name/1` in a CT suite that is not in all/0 is
indistinguishable from a test case ELP can see is never run. Taking the drain
window as a second argument says "helper" structurally rather than with a
suppression comment, and moves the timeout to the call site where it can be
read next to the batch size it is waiting on.

`insert_with_opts_returning_rows/1` was real: a test case that was never in
all/0 and, if it had been, asserted nothing - its whole body was `ok` under a
comment saying it meant to cover the on_conflict noop branch. That branch is
already covered by insert_with_opts_on_conflict_columns two functions above,
which inserts the same unique key twice under `{{columns, [...]}, nothing}`.
So the stub is dead weight rather than missing coverage, and it goes.

Pin moves to erlang-ci v2.1.7. That upgrades ELP from 2026-02-27 to 2026-08-10
(erlang-ci#71/#72/#73), which is the version that reports W0008 at all - the
bump and this cleanup have to land together or CI goes red on the three above.
v2.1.7 also compiles the test profile before linting, which is what stops ELP
reporting `proper_transformer:parse_transform/2` on the two suites that
include proper.hrl.

Verified: kura_coverage_SUITE + kura_coverage2_SUITE 87/87, elp lint 0 errors
(was 5), fmt and xref clean. kura_resilience_tests fails locally on
docker-compose control because another checkout holds port 5555; it fails
identically on unmodified main and is skipped in CI.
@github-actions

Copy link
Copy Markdown

🟢 Code Coverage — 92.4%

2612 of 2826 lines covered.


🟡 ELP Lint — 29 warnings

34 diagnostics found. See job logs for details.

@Taure
Taure merged commit 3901427 into main Aug 11, 2026
18 checks passed
@Taure
Taure deleted the fix/unreachable-ct-tests branch August 11, 2026 19:37
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