-
Notifications
You must be signed in to change notification settings - Fork 75
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
Issues API unit tests #116
Conversation
|
I'm not sure what could be the cause. I'll try to take a look tomorrow. |
@BenFradet @fedefernandez This might solve the issues: #117 |
Codecov Report
@@ Coverage Diff @@
## master #116 +/- ##
==========================================
+ Coverage 87.4% 88.17% +0.77%
==========================================
Files 36 36
Lines 516 516
Branches 3 3
==========================================
+ Hits 451 455 +4
+ Misses 65 61 -4
Continue to review full report at Codecov.
|
I still have a few unit tests failing, still investigating why |
request | ||
.withMethod("GET") | ||
.withPath(s"/search/issues") | ||
.withQueryStringParameters(new Parameter("q", s"$nonExistentSearchQuery+")) |
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.
have you guys tried withQueryStringParameters
before?
Never seems to match.
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.
fixed it with regex 👍
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.
👍
response should be('left) | ||
} | ||
|
||
"Issues >> Edit" should "return the edited issue if valid data is provided" ignore { |
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.
for some reason this one's failing too
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.
You guys seem to have used post for patch request for the git data API: https://github.com/47deg/github4s/blob/master/github4s/jvm/src/test/scala/github4s/utils/MockGithubApiServer.scala#L328-L348.
So I'm assuming there is something wrong with how mock server deals with patch?
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.
We should create an issue to fix that part. The root of the problem is the call to postData
. In that part the request already has set the PATCH
method but if we take a look to this method in scalaj-http we can see that it's setting the method to POST
.
One solution could be to replace the postData
call by:
-- .postData(body)
++ .postData(d).method(rb.httpVerb.verb)
But I've not tested it yet. Sorry about the confusion
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.
I get it, thanks. I'll log an issue 👍
Good to review 👍 |
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.
This is great, thanks for your effort. I've left some minor comments, I don't understand why the tests in ApiSpec
are passing so I appreciate some clarifications around that. Other than that, looks good to me!
.when( | ||
request | ||
.withMethod("POST") | ||
.withPath(s"/repos/$validRepoOwner/$validRepoName/issues") |
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.
Should it be invalidRepoName
?
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.
true, I don't know how the tests manage to pass 😕
mockServer | ||
.when( | ||
request | ||
.withMethod("PATCH") |
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.
I think that our http client is applying a POST
method for this operation
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.
Yup I modified those, the sync doesn't seem to be reflected on gh, weird as well.
request | ||
.withMethod("GET") | ||
.withPath(s"/search/issues") | ||
.withQueryStringParameters(new Parameter("q", s"$nonExistentSearchQuery+")) |
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.
👍
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.
I don't know what's going on with GH but the sync isn't reflected here.
.when( | ||
request | ||
.withMethod("POST") | ||
.withPath(s"/repos/$validRepoOwner/$validRepoName/issues") |
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.
true, I don't know how the tests manage to pass 😕
mockServer | ||
.when( | ||
request | ||
.withMethod("PATCH") |
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.
Yup I modified those, the sync doesn't seem to be reflected on gh, weird as well.
nvm, pushed to my remote :'( |
on 2.12 |
|
Still need to add test cases to
ApiSpec