Skip to content

Unit test cleanup + partial makefile linting#10048

Open
intrigus-lgtm wants to merge 6 commits into
firedancer-io:mainfrom
intrigus-lgtm:intrigus/feat/unit-test-cleanup
Open

Unit test cleanup + partial makefile linting#10048
intrigus-lgtm wants to merge 6 commits into
firedancer-io:mainfrom
intrigus-lgtm:intrigus/feat/unit-test-cleanup

Conversation

@intrigus-lgtm

Copy link
Copy Markdown
Contributor

I was recently PRing some fixes for forest and realized that the tests were broken even without my fix.
Which made me realize that the test wasn't run in CI at all...

There have been quite a few times we missed tests in the past (just a sample):
#8319
#8194
#5640
#1139

This PR adds linting for makefiles:

  1. make doesn't fail when github.com/firedancer-io/firedancer/commit/27a047b88378bdacc1fe3c56a665d4889b14ea2f $(call add-hdr,fd_uint256.h fd_uint256_mul.h) (should be add-hrds) or when there are typos. I didn't find any other good way to prevent this without custom linting.
  2. We often add make-unit-test calls, but don't add the corresponding run-unit-test calls. Linting now fails if there is a make-unit-test calls, but no corresponding run-unit-test calls.

Linting for 2. can be disabled using # lint-no-run-unit-test (e.g. if the test required CLI args).

In total, 21 tests were re-enabled. I disabled four of those again as they are broken and will be fixed in follow-up PRs.

Copilot AI review requested due to automatic review settings June 3, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a Makefile linter to catch silent $(call ...) typos and missing run-unit-test registrations, and updates various Local.mk files to satisfy/enforce these checks.

Changes:

  • Introduced contrib/lint/check_makefiles.py and a make lint target to validate Local.mk call-macro names and ensure built unit tests are registered to run (with allowlists/annotations for exceptions).
  • Enabled running a number of unit tests by default via new $(call run-unit-test,...) lines and added # lint-no-run-unit-test annotations where tests must remain non-default.
  • Wired the new lint into GitHub Actions (lint.yml) and invoked it on pull requests.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/vinyl/Local.mk Annotates a unit test to intentionally not run by default.
src/util/wksp/Local.mk Adds lint opt-out annotation for a unit test and adjusts run list.
src/util/tpool/Local.mk Registers test_tpool to run by default.
src/util/tmpl/Local.mk Registers additional template/data-structure tests to run by default.
src/util/simd/Local.mk Fixes typo in unit-test run macro invocation.
src/util/shmem/Local.mk Registers test_shmem to run by default.
src/util/sandbox/Local.mk Registers test_sandbox to run by default.
src/util/net/Local.mk Annotates a unit test to intentionally not run by default.
src/util/log/Local.mk Registers test_log to run by default.
src/util/bits/Local.mk Registers an additional bits test to run by default.
src/tango/cnc/Local.mk Annotates a unit test to intentionally not run by default.
src/flamenco/runtime/Local.mk Registers test_hashes to run; annotates another test to not run by default.
src/flamenco/log_collector/Local.mk Annotates a unit test to intentionally not run by default.
src/flamenco/accdb/Local.mk Registers test_accdb_v0 to run by default.
src/discof/restore/Local.mk Annotates a unit test to intentionally not run by default.
src/discof/forest/Local.mk Annotates a unit test to intentionally not run by default.
src/disco/keyguard/Local.mk Registers test_keyload to run by default.
src/choreo/eqvoc/Local.mk Annotates a unit test to intentionally not run by default.
src/choreo/Local.mk Registers test_choreo_base to run by default.
src/ballet/sbpf/Local.mk Annotates a unit test to intentionally not run by default.
src/ballet/reedsol/Local.mk Registers test_reedsol to run by default.
src/ballet/pb/Local.mk Registers test_pb to run by default.
src/ballet/lthash/Local.mk Registers test_lthash to run by default.
src/ballet/hmac/Local.mk Fixes typo in unit-test run macro invocation.
src/ballet/bigint/Local.mk Fixes typo in header macro invocation (add-hdrs).
src/ballet/aes/Local.mk Registers test_aes to run by default.
contrib/lint/check_makefiles.py Adds the new Local.mk linter (call-name + make→run checks).
config/everything.mk Adds lint phony/target and documents it in make help.
.github/workflows/on_pull_request.yml Adds a lint workflow call on non-draft PRs.
.github/workflows/lint.yml New workflow that runs make lint in CI.

Comment thread src/util/wksp/Local.mk
Comment thread src/util/tmpl/Local.mk
$(call run-unit-test,test_map_slot,)
$(call run-unit-test,test_map_slot_para,)
# FIXME: MAP_PERFECT?
$(call run-unit-test,test_map_perfect,)
@intrigus-lgtm intrigus-lgtm force-pushed the intrigus/feat/unit-test-cleanup branch from 4f5ccb8 to d074995 Compare June 3, 2026 14:26
Comment thread src/util/wksp/Local.mk
$(call run-unit-test,test_wksp_admin)
$(call run-unit-test,test_wksp_user)
#$(call run-unit-test,test_wksp_helper) # FIXME: why was this not enabled?
$(call run-unit-test,test_wksp_tpool)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unit test wastes too much CPU on one tile, should decrease --iter-max or use multiple tiles (in script-tests)

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.

3 participants