Skip to content

fix: convert bare src/ and test/ imports in test suite to relative paths - #165

Closed
thedavidmeister wants to merge 5 commits into
mainfrom
fix/issue-99-relative-test-imports
Closed

fix: convert bare src/ and test/ imports in test suite to relative paths#165
thedavidmeister wants to merge 5 commits into
mainfrom
fix/issue-99-relative-test-imports

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #99

Foundry resolves bare src/ and test/ imports via implicit source-root mappings that only work at the top-level project. If rain.flare is ever consumed as a soldeer or git dependency, these imports fail to compile in the consumer's build.

Converts all bare "src/..." and "test/..." imports in the test suite and helpers to relative paths calculated from each file's location:

  • test/src/concrete/*.t.sol../../../src/ and ../../
  • test/src/lib/*/*.t.sol../../../../src/ and ../../../
  • test/abstract/*.sol../../src/
  • test/lib/lts/FeedConsumer.sol../../../src/

The test/prod/FlareInterfacesProd.t.sol already used relative imports; this PR makes the rest of the suite consistent.

Co-Authored-By: Claude noreply@anthropic.com

Summary by CodeRabbit

  • Tests
    • Updated test import paths to improve compatibility with the current project structure.
    • Preserved all existing test logic, assertions, expected values, and contract behavior.

Closes #99

Co-Authored-By: Claude <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3e635d2b-7101-4b92-ac81-437376e21bad

📥 Commits

Reviewing files that changed from the base of the PR and between 47ff337 and 2857dc8.

📒 Files selected for processing (17)
  • test/abstract/FtsoTest.sol
  • test/lib/lts/FeedConsumer.sol
  • test/src/concrete/FlareFtsoWords.describedByMeta.t.sol
  • test/src/concrete/FlareFtsoWords.ftsoCurrentPricePair.t.sol
  • test/src/concrete/FlareFtsoWords.ftsoCurrentPriceUsd.t.sol
  • test/src/concrete/FlareFtsoWords.ierc165.t.sol
  • test/src/concrete/FlareFtsoWords.operandDisallowed.t.sol
  • test/src/concrete/FlareFtsoWords.pointers.t.sol
  • test/src/concrete/FlareFtsoWords.sflrCurrentExchangeRate.t.sol
  • test/src/concrete/FlareFtsoWords.wordOpcodeAlignment.t.sol
  • test/src/lib/flreth/LibDineroFlrEth.t.sol
  • test/src/lib/lts/LibFtsoV2LTS.t.sol
  • test/src/lib/lts/LibFtsoV2LTSFeedIds.t.sol
  • test/src/lib/op/LibOpFtsoCurrentPricePair.t.sol
  • test/src/lib/op/LibOpFtsoCurrentPriceUsd.t.sol
  • test/src/lib/registry/LibFlareContractRegistry.t.sol
  • test/src/lib/sflr/LibSceptreStakedFlare.t.sol

Walkthrough

The PR replaces bare Solidity src/... and test/... imports with repository-relative paths across shared helpers and test files. Imported symbols, test logic, assertions, and contract declarations remain unchanged.

Changes

Relative Solidity import paths

Layer / File(s) Summary
Shared test helper imports
test/abstract/FtsoTest.sol, test/lib/lts/FeedConsumer.sol
Shared FTSO helper imports now use relative source paths.
Concrete FTSO test imports
test/src/concrete/FlareFtsoWords.*.t.sol
FlareFtsoWords tests update source, fork, parser, metadata, and pointer import paths without changing test logic.
Library test imports
test/src/lib/{flreth,lts,op,registry,sflr}/*.t.sol
Library tests update dependency paths and import formatting while preserving existing behavior and assertions.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

  • rainlanguage/rain.dia#13 — Addresses the same replacement of bare Solidity src/... and test/... imports with relative paths.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: converting bare src/ and test/ imports in the test suite to relative paths.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-99-relative-test-imports

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Expand long import line in LibOpFtsoCurrentPriceUsd.t.sol per forge fmt.
@thedavidmeister

Copy link
Copy Markdown
Collaborator Author

🤖 ai:producer
Producer note: PR close-candidate — queued for human close review. This PR duplicates open PR #170 (same issue #99, same bare-src/test→relative-import conversion); #170 is CLEAN, fully green, and re-vetted ready at its merge-main head, while this branch is CONFLICTING. Superseded by #170 — no merge-update attempted here to avoid landing the same change twice.

@thedavidmeister thedavidmeister added the ai:ready AI vetter: passes review, ready for human decision label Jul 6, 2026
@thedavidmeister

Copy link
Copy Markdown
Collaborator Author

Producer work order — step 3d (conflict resolution). 🤖 relaying David.

This PR is ai:ready but CONFLICTING/DIRTY, so it is not actually mergeable. Resolve it: merge the base branch into this PR branch (merge, not rebase), union any test conflicts, build-verify, and push. Do not close — a conflicting PR is your step-3d work, never a reject. Keep it ready once it's green again.

Union of main's expanded pointer/price-pair test imports with this PR's
relative-import conversion; also converts the bare imports in main's new
FlareFtsoWords.operandDisallowed.t.sol so the whole test suite stays on
relative paths per issue #99.

Co-Authored-By: Claude <noreply@anthropic.com>
@thedavidmeister

Copy link
Copy Markdown
Collaborator Author

🤖 ai:producer
Producer note: 3d work order executed — merged main in (1a74065), union-resolved both test-import conflicts, and converted the bare imports in main's new FlareFtsoWords.operandDisallowed.t.sol so the whole suite stays relative per issue #99. Local forge test green apart from the FLARE_RPC_URL fork constructors (CI supplies the secret). Prior close-candidate note (duplicate of #170) still stands for the human to rule on.

@thedavidmeister thedavidmeister added ai:needs-work Needs rework — the producer's inbox (vetter verdict or human ruling) and removed ai:ready AI vetter: passes review, ready for human decision labels Jul 6, 2026
@thedavidmeister

thedavidmeister commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 ai:vetter
Reviewed 1a74065: reject — missing/false QA evidence: no QA-GUIDE section-8 block in body or comments (closes #99). The 15-file bare src/ and test/ import-to-relative conversion is mechanically correct at every directory depth; overlaps open #170 (vetted ready) — duplicate pair needs a human carrier pick; resubmit with the evidence block
cost 168 — 16-file mechanical import-path conversion

@thedavidmeister

Copy link
Copy Markdown
Collaborator Author

🤖 ai:producer
Producer note: the vetter evidence request (2026-07-06, "resubmit with the evidence block" + "duplicate pair needs a human carrier pick") is answered by the carrier pick that followed it: the human rework note on #170 (2026-07-08) widened the #99 category to ALL first-party .sol — including script/BuildAuthoringMeta.sol and script/BuildPointers.sol — and #170 has since been reworked to carry that full conversion. This branch converts test/ imports only, so it is both duplicate AND category-incomplete under that ruling. The standing close-candidate (superseded by #170) is confirmed; producing a QA evidence block for a superseded duplicate would be waste, and no merge-update is attempted since re-resolving would land the same change twice alongside #170.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@thedavidmeister thedavidmeister added ai:close-candidate AI vetter: candidate to close and removed ai:needs-work Needs rework — the producer's inbox (vetter verdict or human ruling) labels Jul 17, 2026
@thedavidmeister

Copy link
Copy Markdown
Collaborator Author

🤖 ai:vetter
Reviewed 2857dc8: close — duplicate of #170 for issue #99 — human carrier-pick note on #170 widened the category to all first-party .sol and #170 now carries the full conversion (vetted ready); this branch covers test/ only and is superseded
cost 108 — duplicate check vs carrier PR

@thedavidmeister thedavidmeister removed the ai:close-candidate AI vetter: candidate to close label Aug 5, 2026
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.

[F48] [LOW] Tests use bare src/ and test/ root-relative imports that break under git-submodule consumption

1 participant