Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement forc-test filter #4566

Merged
merged 9 commits into from
May 24, 2023
Merged

feat: implement forc-test filter #4566

merged 9 commits into from
May 24, 2023

Conversation

kayagokalp
Copy link
Member

@kayagokalp kayagokalp commented May 16, 2023

Description

closes #3268.

This PR adds filtering capability to forc-test based on test names. Tests are executed if their name contains the given filter phrase.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@kayagokalp kayagokalp added enhancement New feature or request forc forc-test Everything related to the `forc-test` lib and `forc test` command. labels May 16, 2023
@kayagokalp kayagokalp self-assigned this May 16, 2023
@kayagokalp kayagokalp changed the title feat: implement forc-test filter feat: implement forc-test filter May 16, 2023
@kayagokalp kayagokalp marked this pull request as ready for review May 16, 2023 18:46
@kayagokalp kayagokalp requested a review from a team May 16, 2023 18:46
@sdankel
Copy link
Member

sdankel commented May 17, 2023

Thanks for the quick turnaround on this! From the LSP perspective, it would be nice to have a way to exact match on a test name. I would use this for the runnable button (which runs an individual test). Without exact matching, there would be no way to make it run only the 1. An --exact flag would do the trick!

Feel free to make a separate issue for this if it's out of scope.

forc-test/src/lib.rs Outdated Show resolved Hide resolved
forc-test/src/lib.rs Outdated Show resolved Hide resolved
Cargo.toml Show resolved Hide resolved
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

Looking good, mostly nits 👍

forc-test/src/lib.rs Outdated Show resolved Hide resolved
forc-test/src/lib.rs Outdated Show resolved Hide resolved
forc-test/src/lib.rs Show resolved Hide resolved
forc-test/src/lib.rs Outdated Show resolved Hide resolved
forc/src/cli/commands/test.rs Outdated Show resolved Hide resolved
@kayagokalp
Copy link
Member Author

Thanks for the review @sdankel, should be good to go!

@kayagokalp kayagokalp requested a review from sdankel May 19, 2023 10:28
sdankel
sdankel previously approved these changes May 19, 2023
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

🚢

@kayagokalp kayagokalp requested a review from a team May 19, 2023 19:09
@kayagokalp kayagokalp enabled auto-merge (squash) May 19, 2023 20:39
mitchmindtree
mitchmindtree previously approved these changes May 22, 2023
Copy link
Contributor

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

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

One tiny optional change but otherwise utACK

forc-test/test_data/test_library/src/lib.sw Show resolved Hide resolved
forc/src/cli/commands/test.rs Outdated Show resolved Hide resolved
@kayagokalp kayagokalp requested a review from sdankel May 23, 2023 10:58
@kayagokalp kayagokalp requested a review from a team May 24, 2023 11:05
@kayagokalp kayagokalp merged commit 2f0ee52 into master May 24, 2023
26 checks passed
@kayagokalp kayagokalp deleted the kayagokalp/3268 branch May 24, 2023 12:14
IGI-111 pushed a commit that referenced this pull request May 25, 2023
## Description
closes #3268.

This PR adds filtering capability to `forc-test` based on test names. Tests are executed if their name contains the given filter phrase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc forc-test Everything related to the `forc-test` lib and `forc test` command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for "filtering" unit tests using a string
4 participants