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
XcodeServerEndpoints.endpointURL tests #80
XcodeServerEndpoints.endpointURL tests #80
Conversation
… in order to maintain the compatibility between names of files, classes and variables
Result of Integration 1Duration: 1 minute and 4 seconds |
] | ||
for params in paramsArray { | ||
let url = self.endpoints?.endpointURL(.Integrations, params: params) | ||
XCTAssertEqual(url!, "/api/bots/botValue/revValue/integrations", "endpointURL(.Integrations, \(params)) should return \"/api/bots/botValue/revValue/integrations\"") |
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.
Hmm, that looks weird. I would expect that url to be just /api/bots/botValue/integrations
. AFAIK, rev
is only used when deleting a bot. Maybe you found a bug 😆
This is some great stuff, @pmkowal, thanks so much! I added some comments, I'll have to look into the |
Thanks for comments @czechboy0 😃 The tests were modeled on the
I wanted to check all possibilites if additional/random parameters won't affect the path creation. Btw. In the meantime I will move a common sets of params to setUp() method. |
Result of Integration 2Duration: 48 seconds |
Btw. Weird thing about test coverage - I moved the common params from each method to setUp() method and test coverage changed from 54% to 53% - it looks like test coverage depends on the amount of code 😄 |
Hmm yeah, I guess it's a percentage of tested code / all code? Including tests probably. Xcode 7 Code Coverage still needs some love I think :) |
"rev": "revValue", | ||
"otherKey": "otherValue", | ||
"integration": "integrationValue" | ||
] |
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.
Here, for example. Why do we need 3 separate cases?
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.
[
"integration": "integrationValue",
]
This is the desired set of parameters when it comes to /api/integrations/integrationValue
path creation.
[
"otherKey": "otherValue",
"integration": "integrationValue"
]
In this case test checks if additional/random parameter won't affect path creation. Currently it's kind of obvious, but in the future someone can change the implementation and it's an additional protection.
[
"rev": "revValue",
"otherKey": "otherValue",
"integration": "integrationValue"
]
This case was meant to test if adding rev
key without bot
key won't add revValue
to the path, but it can be removed since testEndpointURLCreationForBots
tests it.
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.
Okay, if you feel like there's anything that can be removed, can you please do it? In the meantime I'll look at the rev
stuff. Thanks!
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.
Ok, thanks for review, will do it.
Ok, I made the code more explicit. See #82. I made the endpoints ONLY put in the Feel free to fix it whenever you have time 😉 |
Ok, thanks! After I make fixes to the old tests I will merge #82 and improve tests 😉 Btw. I'm currently checking |
No, that's what I meant by guarding |
- leaving tests which test success paths only - add expectations to each test to make them more readable
Result of Integration 3Duration: 48 seconds |
"/api/bots/bot_id/rev_id" path uses rev only when method is DELETE
Result of Integration 4Duration: 45 seconds |
@czechboy0 I made couple of fixes:
Please review. |
Great, this is much better, thank you! (And just for the future, you don't have to bother with So basically
and
give you the same information, so you can just use the second one. |
XcodeServerEndpoints.endpointURL tests
Thanks so much, @pmkowal! 👍 |
Cool, thanks @czechboy0 ! |
👏 Officially, we've got a new contributor! 🎉 |
🎆 |
😄 |
I've created tests for endpointURL method from XcodeServerEndpoints class. I set access level of XcodeServerEndpoints.endpointURL method as internal as we discussed in #79 issue.
I also renamed EndPoints -> Endpoints in XcodeServerEndPoints name in order to maintain the compatibility between names of files, classes and variables.
Please review.