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

Add --only-pending CLI option #3068

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jvon1904
Copy link

As requested on issue #3066, this work adds the CLI option filter --only-pending. This is similar to --only-failures.

If example_status_persistence_file_path is not configured, it will fail with a message.

If both this new flag and --only-failures are set, it will fail with a message.

@@ -2196,15 +2219,27 @@ def run_suite_hooks(hook_description, hooks)
end
end

Copy link
Author

Choose a reason for hiding this comment

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

Gathering the intersection of files here is where I found it getting messy. Specifically if there were ever to be more flags similar to these set, it might be worth extracting some of this functionality.

def configure_only_pending(options)
options[:only_pending] = true
add_tag_filter(options, :inclusion_filter, :last_run_status, 'pending')
end
Copy link
Member

Choose a reason for hiding this comment

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

These could probably be collapsed to a configure_only(options, :pending) configure_only(options, :failures) type call

Copy link
Author

Choose a reason for hiding this comment

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

@JonRowe , as a tradeoff here, I'm supplying three arguments. This accounts for the difference between 'failures' and 'failed'. If the terms were the same like 'pending', then I could just construct the symbol like

options["only_#{type}"] = true

My other thought was some sort of constant mapping.

@@ -2196,15 +2219,27 @@ def run_suite_hooks(hook_description, hooks)
end
end

def get_files_to_run(paths)
Copy link
Member

Choose a reason for hiding this comment

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

Why the extra method here?

Copy link
Author

Choose a reason for hiding this comment

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

@JonRowe , I was thinking the method #get_files_to_run was getting too large, so I wanted to break it up. Maybe that's premature, since nothing else calls #get_files.

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.

None yet

2 participants