-
-
Notifications
You must be signed in to change notification settings - Fork 906
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
Unique identifiers for all test examples #771
Unique identifiers for all test examples #771
Conversation
Generated by 🚫 danger |
d27a99a
to
6f95c8c
Compare
) {} | ||
groupContainingExamplesDuplicatedAcrossGroupsA.appendExample(exampleDupedAcrossSpecA) | ||
|
||
let groupContainingExamplesDuplicatedAcrossGroupsB = ExampleGroup( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'groupContainingExamplesDuplicatedAcrossGroupsB' (identifier_name)
|
||
rootExampleGroup.appendExampleGroup(groupContainingExamplesWithDuplicateDescriptions) | ||
|
||
let groupContainingExamplesDuplicatedAcrossGroupsA = ExampleGroup( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'groupContainingExamplesDuplicatedAcrossGroupsA' (identifier_name)
) {} | ||
rootExampleGroup.appendExample(rootExample) | ||
|
||
let groupContainingExamplesWithDuplicateDescriptions = ExampleGroup( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'groupContainingExamplesWithDuplicateDescriptions' (identifier_name)
import Nimble | ||
|
||
class ExampleTests: XCTestCase { | ||
func test_uniqueIdentifier_uniquelyIdentifiesTheExampleAcrossASpec() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 84 lines (function_body_length)
raiseError("'pending' cannot be used inside 'afterEach', 'pending' may only be used inside 'context' or 'describe'. ") | ||
} | ||
guard currentExampleMetadata == nil else { | ||
raiseError("'pending' cannot be used inside 'it', 'pending' may only be used inside 'context' or 'describe'. ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 123 characters (line_length)
raiseError("'pending' cannot be used inside 'beforeEach', 'pending' may only be used inside 'context' or 'describe'. ") | ||
} | ||
if aftersCurrentlyExecuting { | ||
raiseError("'pending' cannot be used inside 'afterEach', 'pending' may only be used inside 'context' or 'describe'. ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 130 characters (line_length)
@nonobjc | ||
internal func pending(_ description: String, file: String, line: UInt, closure: @escaping () -> Void) { | ||
if beforesCurrentlyExecuting { | ||
raiseError("'pending' cannot be used inside 'beforeEach', 'pending' may only be used inside 'context' or 'describe'. ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 131 characters (line_length)
@ikesyo - The file with the "c99 identifier" behavior is the only one that had to significantly change as part of my work to rebase this back into a happy state with |
For what it's worth, I don't think that CI failure is legit. It passed for all but one macOS config, and both Linux configs. Something went wrong with Ruby land in there. |
Hey there! 👋🏼 I'm a new maintainer for this project and I'm trying to get the next release out ASAP and also clean up old issues and old PRs. I'm closing all PRs older than 1-2 years, but that doesn't mean these changes are necessarily being rejected. If you are still interested in contributing these changes, please submit a new PR branching from the top of We appreciate your work here and acknowledge the time and effort you put in to contribute! You're awesome. 💯 However, we are all volunteers here with limited capacity working for free. Unfortunately, that means we must close out stale issues and PRs to move the project forward in a reasonable way. We apologize for the inconvenience and appreciate your understanding! 😎 ✌🏼 |
This PR addresses #770 by doing two things:
pending
elements to full-fledged example objects that print these unique identifiers but still do not run their content.There are a couple specific things that I would appreciate feedback on:
For the sake of trying to change one thing at a time (at least in spirit), I changed the
Filter.pending
flag toFilter.excluded
. This is because I did not know whether there was some strong reason thatxit
and the like were removed entirely from the Quick test list as opposed to just neutering their content. I'll lean on @modocache and @jeffh to hopefully provide any history they can. It makes sense to me and would simplify the code to just treatx
-type examples the same as pending, but I don't want to make that decision alone.Also, @shx7, will you need those
xit
,xdescribe
, etc examples to printPending: blah_blah_blah
as well? If so, then we'll definitely have to make some more changes. Fortunately, I already experimented with that and it will be easy for me to do. I just need to know whether that's what we want.Tests only start appending digits once its apparent they are duplicated. In other words, a set of tests which happen to be duplicated will have the following identifiers:
Notice that the first one does not have a
1
appended to it. @shx7 will that satisfy the ask?I still have a couple things to do on this PR, but wanted to start a review of the code and a conversation about its progress ASAP. I'll maintain the list here:
xit
and its like elements to use the new pending codeCheers, y'all.