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 add exclude pattern running tests #2361

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

julienbrs
Copy link

@julienbrs julienbrs commented Aug 9, 2024

Closes #1512

Introduced changes

  • Added an --exclude flag that functions similarly to the existing FilterName. This flag allows users to exclude tests based on their names.
  • Note: The current filter functionality works without a specific flag (snforge test simple_test launches all tests beginning with "simple_test", rather than requiring snforge test --filter simple_test). Given this, I believe the new --exclude option might not be compatible with the existing filter option. What do you think?

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

@julienbrs julienbrs marked this pull request as ready for review August 19, 2024 08:38
crates/forge/src/run_tests/package.rs Outdated Show resolved Hide resolved
crates/forge/src/run_tests/test_target.rs Show resolved Hide resolved
crates/forge/src/run_tests/package.rs Outdated Show resolved Hide resolved
crates/forge/src/run_tests/package.rs Outdated Show resolved Hide resolved
@integraledelebesgue
Copy link
Member

Please fill the checklist and add your changes to the changelog :)

@integraledelebesgue
Copy link
Member

Also, always make sure to run cargo fmt and cargo lint before committing your changes

Copy link

github-actions bot commented Feb 3, 2025

Hi! This pull request hasn't had any activity for a while, so I am
marking it as stale. It will close in 14
days if it is not updated. Thanks for contributing!

@github-actions github-actions bot added the stale Stale Bot label Feb 3, 2025
@julienbrs julienbrs requested a review from a team as a code owner February 7, 2025 15:01
@github-actions github-actions bot removed the stale Stale Bot label Feb 10, 2025
Copy link
Member

@kkawula kkawula left a comment

Choose a reason for hiding this comment

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

Please run cargo lint before committing changes and address CI run errors.

Comment on lines +189 to +190
#[arg(long)]
exclude_filter: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

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

I would call it "exclude" in CLI

@@ -208,7 +212,7 @@ pub struct NewArgs {
/// Do not initialize a new Git repository
#[arg(long)]
no_vcs: bool,
/// Try to create the project even if the specified directory at <PATH> is not empty, which can result in overwriting existing files
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason of this change?

@@ -85,6 +85,7 @@ impl RunForPackageArgs {
args.include_ignored,
args.rerun_failed,
FailedTestsCache::new(cache_dir),
args.exclude_filter.clone(),
Copy link
Member

Choose a reason for hiding this comment

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

Is clone necessary here?

Comment on lines +51 to +53
if tests_filter.is_excluded(&case) {
continue;
}
Copy link
Member

Choose a reason for hiding this comment

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

TestCaseSummary should be pushed to tasks as below

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.

Add exclusion of the tests in CLI
3 participants