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

Depend and use HTTP instead of Requests and drop 0.4 #127

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: julia
julia:
- 0.4
- 0.5
- nightly
notifications:
Expand Down
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.4
julia 0.5
JSON
Requests
HTTP
Git
Compat 0.9.5
9 changes: 3 additions & 6 deletions src/codecovio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ web service. It exports the `submit` and `submit_token` methods.
"""

module Codecov
using Requests
using Coverage
using JSON
using Compat
using Coverage, HTTP, JSON

export submit, submit_token, submit_local, submit_generic

Expand Down Expand Up @@ -154,9 +151,9 @@ module Codecov
if !dry_run
heads = Dict("Content-Type" => "application/json")
data = to_json(fcs)
req = Requests.post(URI(uri_str); json = data, headers = heads)
req = HTTP.post(uri_str; body = data, headers = heads)
println("Result of submission:")
println(Compat.UTF8String(req.data))
println(String(req.data))
end
end

Expand Down
17 changes: 7 additions & 10 deletions src/coveralls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ This module provides functionality to push coverage information to the Coveralls
web service. It exports the `submit` and `submit_token` methods.
"""
module Coveralls
using Coverage
using Requests
using JSON
using Compat
using Coverage, HTTP, JSON

export submit, submit_token

Expand Down Expand Up @@ -54,11 +51,11 @@ module Coveralls
"service_name" => "travis-ci",
"source_files" => map(to_json, fcs))
println("Submitting data to Coveralls...")
req = Requests.post(
URI("https://coveralls.io/api/v1/jobs"),
req = HTTP.post(
"https://coveralls.io/api/v1/jobs",
files = [FileParam(JSON.json(data),"application/json","json_file","coverage.json")])
println("Result of submission:")
println(Compat.UTF8String(req.data))
println(String(req.data))
end

# query_git_info
Expand Down Expand Up @@ -118,9 +115,9 @@ module Coveralls
end
end

r = post(URI("https://coveralls.io/api/v1/jobs"), files =
[FileParam(JSON.json(data),"application/json","json_file","coverage.json")])
r = HTTP.post("https://coveralls.io/api/v1/jobs",
files = [FileParam(JSON.json(data),"application/json","json_file","coverage.json")])
println("Result of submission:")
println(Compat.UTF8String(r.data))
println(String(r.data))
end
end # module Coveralls
8 changes: 4 additions & 4 deletions src/memalloc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

immutable MallocInfo
bytes::Int
filename::Compat.UTF8String
filename::String
linenumber::Int
end

Expand Down Expand Up @@ -32,7 +32,7 @@ function analyze_malloc_files(files)
end

function find_malloc_files(dirs)
files = Compat.String[]
files = String[]
for dir in dirs
filelist = readdir(dir)
for file in filelist
Expand All @@ -46,10 +46,10 @@ function find_malloc_files(dirs)
end
files
end
find_malloc_files(file::Compat.String) = find_malloc_files([file])
find_malloc_files(file::String) = find_malloc_files([file])

analyze_malloc(dirs) = analyze_malloc_files(find_malloc_files(dirs))
analyze_malloc(dir::Compat.String) = analyze_malloc([dir])
analyze_malloc(dir::String) = analyze_malloc([dir])

isfuncexpr(ex::Expr) =
ex.head == :function || (ex.head == :(=) && typeof(ex.args[1]) == Expr && ex.args[1].head == :call)
Expand Down
8 changes: 5 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#######################################################################

using Coverage, Base.Test, Compat
using Compat.String

# test our filename matching. These aren't exported functions but it's probably
# a good idea to have explicit tests for them, as they're used to match files
# that get deleted
@testset "Coverage" begin

@test Coverage.iscovfile("test.jl.cov")
@test Coverage.iscovfile("test.jl.2934.cov")
Expand Down Expand Up @@ -38,12 +38,12 @@ cd(dirname(@__DIR__)) do
end

# Test a file from scratch
srcname = joinpath("test", "data","testparser.jl")
srcname = joinpath(dirname(@__DIR__), "test", "data", "testparser.jl")
covname = srcname*".cov"
# clean out any previous coverage files. Don't use clean_folder because we
# need to preserve the pre-baked coverage file Coverage.jl.cov
clean_file(srcname)
cmdstr = "include(\"$srcname\"); using Base.Test; @test f2(2) == 4"
cmdstr = "include(\"$(escape_string(srcname))\"); using Base.Test; @test f2(2) == 4"
run(`$JULIA_HOME/julia --code-coverage=user -e $cmdstr`)
r = process_file(srcname, datadir)
# The next one is the correct one, but julia & JuliaParser don't insert a line number after the 1-line @doc -> test
Expand Down Expand Up @@ -248,3 +248,5 @@ withenv(
end

end

end # testset