Skip to content

test(fwdctl): refactor CLI test setup#2037

Merged
demosdemon merged 2 commits into
ava-labs:mainfrom
sueun-dev:refactor-fwdctl-cli-test-tempdir
Jun 1, 2026
Merged

test(fwdctl): refactor CLI test setup#2037
demosdemon merged 2 commits into
ava-labs:mainfrom
sueun-dev:refactor-fwdctl-cli-test-tempdir

Conversation

@sueun-dev

Copy link
Copy Markdown

Why this should be merged

Closes #1545.

The fwdctl CLI tests repeated the same temporary-directory setup and simple database create/insert commands in most test cases. This keeps the tests doing the same assertions while moving that setup into small helpers.

How this works

Adds helpers for running a test with a temp dir, creating a database, and inserting a key/value pair. The individual tests now pass the temp DB path through those helpers instead of re-declaring the setup each time.

How this was tested

  • cargo fmt --check
  • cargo test -p firewood-fwdctl --test cli
  • cargo clippy -p firewood-fwdctl --test cli -- -D warnings
  • git diff --check

Breaking Changes

  • firewood
  • firewood-storage
  • firewood-ffi (C api)
  • firewood-go (Go api)
  • fwdctl

@github-actions github-actions Bot added the 3rd party contributor PR from a fork; flags extra review attention. label May 29, 2026
@rkuris rkuris requested a review from Copilot May 29, 2026 16:46

This comment was marked as low quality.

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@demosdemon demosdemon force-pushed the refactor-fwdctl-cli-test-tempdir branch from 131cdd5 to 6d3d164 Compare June 1, 2026 15:56
@demosdemon demosdemon enabled auto-merge (squash) June 1, 2026 15:57
@demosdemon

Copy link
Copy Markdown
Contributor

This is great. Thanks for the refactor!

@demosdemon demosdemon merged commit 487d399 into ava-labs:main Jun 1, 2026
42 checks passed
@demosdemon demosdemon added area/cli fwdctl command-line tool kind/tech-debt Refactors, cleanup, debt paydown kind/testing Tests, flaky tests, test infrastructure labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3rd party contributor PR from a fork; flags extra review attention. area/cli fwdctl command-line tool kind/tech-debt Refactors, cleanup, debt paydown kind/testing Tests, flaky tests, test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewriting tests as closures

3 participants