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

Tweak POST to use pure POST api #1

Merged
merged 1 commit into from
May 6, 2014
Merged

Conversation

staticfloat
Copy link
Member

Instead of multipart nonsense, use the undocumented form-data POST API (I got the idea from this guy)

Note that I haven't tested this, since I'm not sure how to run this Coverage.jl thing, but in a REPL session, the following returned me something:

julia> data
{"source_files"=>[{"coverage"=>{nothing,1,nothing},"name"=>"example.rb","source"=>"def four\
n  4\nend"},{"coverage"=>{nothing,1,0,nothing},"name"=>"lib/two.rb","source"=>"def seven\n  
eight\n  nine\nend"}],"repo_token"=>"NnS70s2bP8Wwvxquax6rdRz4zDnEwW5OK"}

julia> r = Requests.post(URI("https://coveralls.io/api/v1/jobs"), data = {"json" => json(dat
a)}, headers={"Content-Type" => "text/form-data"})
<snip a bunch of deprecation warnings>
Response(200 OK, 20 Headers, 66 Bytes in Body)

julia> r.data
"{\"message\":\"Job #3.1\",\"url\":\"https://coveralls.io/jobs/1754807\"}\r\n"

Instead of multipart nonsense, use the undocumented form-data POST API
@IainNZ
Copy link
Contributor

IainNZ commented May 6, 2014

We can see what the Travis output says, and hope for the best!

@IainNZ
Copy link
Contributor

IainNZ commented May 6, 2014

{"message":"Job #10.1","url":"https://coveralls.io/jobs/1754899"}
Looking VERY promising

@IainNZ
Copy link
Contributor

IainNZ commented May 6, 2014

https://coveralls.io/r/IainNZ/Coverage.jl
Hah wonderfull!

IainNZ added a commit that referenced this pull request May 6, 2014
Tweak POST to use pure POST api
@IainNZ IainNZ merged commit c08ab04 into JuliaCI:master May 6, 2014
@IainNZ
Copy link
Contributor

IainNZ commented May 6, 2014

💯 very grateful!

@staticfloat
Copy link
Member Author

Ah, didn't realize you'd already set it up to run alongside travis. Very neat!

@IainNZ
Copy link
Contributor

IainNZ commented May 6, 2014

I'm gonna polish it on https://github.com/IainNZ/RationalSimplex.jl (as a test case) then I'm hoping its something people will be able to drop as an extra line in their travis, e.g.

- julia -e 'Pkg.add("Coverage"); using Coverage; report_coveralls("PkgName")'

@staticfloat
Copy link
Member Author

Sounds good to me! Neat tools like this make me happy. :)

@Keno
Copy link
Member

Keno commented May 7, 2014

I tried this out: https://coveralls.io/r/loladiro/SIUnits.jl. So how does it work? Does it only consider functions that are actually called?

@IainNZ
Copy link
Contributor

IainNZ commented May 7, 2014

Yeah if you look at the .cov files, for each line they either have a - or a number. - just means no count is possible (e.g. multiline statements, function declarations, comments), and the number will be 0 if the line is countable but never hit.
All I'm doing is taking the files, taking the .cov files, and converting them to the Coveralls format, which is the same: uncallable/untrackable lines are "null", everything else gets a count.

So it looks like you are missing 3 lines:
https://coveralls.io/files/193437379

When I ran this on JuMP.jl almost all the lines not called where error lines/early breakouts that weren't tested.

@Keno
Copy link
Member

Keno commented May 7, 2014

But there is also big functions like https://coveralls.io/files/193437379#L377, which don't show up as not covered.

@IainNZ
Copy link
Contributor

IainNZ commented May 7, 2014

Also reported here: JuliaLang/julia#5423 seems to be an issue with the tool

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.

3 participants