Deprecate CodeCov for Codecov

This commit is contained in:
Chris de Graaf 2018-11-05 16:05:30 -06:00
parent aa3758476a
commit 34f30637a2
11 changed files with 47 additions and 46 deletions

View File

@ -4,7 +4,7 @@
[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/PkgTemplates.jl/latest)
[![Build Status](https://travis-ci.org/invenia/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/invenia/PkgTemplates.jl)
[![Build Status](https://ci.appveyor.com/api/projects/status/r24xamruqlm88uti/branch/master?svg=true)](https://ci.appveyor.com/project/christopher-dG/pkgtemplates-jl/branch/master)
[![CodeCov](https://codecov.io/gh/invenia/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/invenia/PkgTemplates.jl)
[![Codecov](https://codecov.io/gh/invenia/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/invenia/PkgTemplates.jl)
**PkgTemplates is a Julia package for creating new Julia packages in an easy,
repeatable, and customizable way.**
@ -80,7 +80,7 @@ julia> t = Template(;
julia_version=v"0.7",
plugins=[
TravisCI(),
CodeCov(),
Codecov(),
Coveralls(),
AppVeyor(),
GitHubPages(),
@ -97,7 +97,7 @@ Template:
• AppVeyor:
→ Config file: Default
→ 0 gitignore entries
• CodeCov:
• Codecov:
→ Config file: None
→ 3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem"
• Coveralls:

View File

@ -4,7 +4,7 @@
[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/PkgTemplates.jl/latest)
[![Build Status](https://travis-ci.org/invenia/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/invenia/PkgTemplates.jl)
[![Build Status](https://ci.appveyor.com/api/projects/status/r24xamruqlm88uti/branch/master?svg=true)](https://ci.appveyor.com/project/christopher-dG/pkgtemplates-jl/branch/master)
[![CodeCov](https://codecov.io/gh/invenia/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/invenia/PkgTemplates.jl)
[![Codecov](https://codecov.io/gh/invenia/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/invenia/PkgTemplates.jl)
**PkgTemplates is a Julia package for creating new Julia packages in an easy,
repeatable, and customizable way.**
@ -40,7 +40,7 @@ t = Template(;
ssh=true,
plugins=[
TravisCI(),
CodeCov(),
Codecov(),
Coveralls(),
AppVeyor(),
GitHubPages(),

View File

@ -19,7 +19,7 @@ GitLabCI
## Code Coverage
```@docs
CodeCov
Codecov
Coveralls
```

View File

@ -24,7 +24,7 @@ export
AppVeyor,
TravisCI,
GitLabCI,
CodeCov,
Codecov,
Coveralls
"""
@ -46,6 +46,6 @@ include(joinpath("plugins", "gitlabci.jl"))
include(joinpath("plugins", "githubpages.jl"))
const DEFAULTS_DIR = normpath(joinpath(@__DIR__, "..", "defaults"))
const BADGE_ORDER = [GitHubPages, TravisCI, AppVeyor, GitLabCI, CodeCov, Coveralls]
const BADGE_ORDER = [GitHubPages, TravisCI, AppVeyor, GitLabCI, Codecov, Coveralls]
end

View File

@ -321,7 +321,7 @@ function substitute(
"USER" => pkg_template.user,
"VERSION" => "$(v.major).$(v.minor)",
"DOCUMENTER" => any(map(p -> isa(p, Documenter), values(pkg_template.plugins))),
"CODECOV" => haskey(pkg_template.plugins, CodeCov),
"CODECOV" => haskey(pkg_template.plugins, Codecov),
"COVERALLS" => haskey(pkg_template.plugins, Coveralls),
)
# d["AFTER"] is true whenever something needs to occur in a CI "after_script".

View File

@ -1,7 +1,7 @@
"""
CodeCov(; config_file::Union{AbstractString, Nothing}=nothing) -> CodeCov
Codecov(; config_file::Union{AbstractString, Nothing}=nothing) -> Codecov
Add `CodeCov` to a template's plugins to optionally add a `.codecov.yml` configuration file
Add `Codecov` to a template's plugins to optionally add a `.codecov.yml` configuration file
to generated repositories, and an appropriate badge to the README. Also updates the
`.gitignore` accordingly.
@ -9,14 +9,14 @@ to generated repositories, and an appropriate badge to the README. Also updates
* `config_file::Union{AbstractString, Nothing}=nothing`: Path to a custom `.codecov.yml`.
If left unset, no file will be generated.
"""
@auto_hash_equals struct CodeCov <: GenericPlugin
@auto_hash_equals struct Codecov <: GenericPlugin
gitignore::Vector{AbstractString}
src::Union{AbstractString, Nothing}
dest::AbstractString
badges::Vector{Badge}
view::Dict{String, Any}
function CodeCov(; config_file::Union{AbstractString, Nothing}=nothing)
function Codecov(; config_file::Union{AbstractString, Nothing}=nothing)
if config_file != nothing
config_file = if isfile(config_file)
abspath(config_file)
@ -30,7 +30,7 @@ to generated repositories, and an appropriate badge to the README. Also updates
".codecov.yml",
[
Badge(
"CodeCov",
"Codecov",
"https://codecov.io/gh/{{USER}}/{{PKGNAME}}.jl/branch/master/graph/badge.svg",
"https://codecov.io/gh/{{USER}}/{{PKGNAME}}.jl",
),
@ -39,5 +39,6 @@ to generated repositories, and an appropriate badge to the README. Also updates
)
end
end
Base.@deprecate_binding CodeCov Codecov
interactive(plugin_type::Type{CodeCov}) = interactive(plugin_type; file=nothing)
interactive(::Type{Codecov}) = interactive(Codecov; file=nothing)

View File

@ -47,18 +47,18 @@ end
println()
end
@testset "CodeCov" begin
@testset "Codecov" begin
write(stdin.buffer, "\n")
p = interactive(CodeCov)
p = interactive(Codecov)
@test p.src === nothing
write(stdin.buffer, "$test_file\n")
p = interactive(CodeCov)
p = interactive(Codecov)
@test p.src == test_file
write(stdin.buffer, "none\n")
p = interactive(CodeCov)
p = interactive(Codecov)
@test p.src === nothing
write(stdin.buffer, "$fake_path\n")
@test_throws ArgumentError interactive(CodeCov)
@test_throws ArgumentError interactive(Codecov)
println()
end

View File

@ -37,10 +37,10 @@ pkg_dir = joinpath(t.dir, test_pkg)
@test !occursin("%JL_CODECOV_SCRIPT%", appveyor)
rm(joinpath(pkg_dir, ".appveyor.yml"))
# Generating the plugin with CodeCov in the template should create a post-test step.
t.plugins[CodeCov] = CodeCov()
# Generating the plugin with Codecov in the template should create a post-test step.
t.plugins[Codecov] = Codecov()
gen_plugin(p, t, test_pkg)
delete!(t.plugins, CodeCov)
delete!(t.plugins, Codecov)
appveyor = read(joinpath(pkg_dir, ".appveyor.yml"), String)
@test occursin("on_success", appveyor)
@test occursin("%JL_CODECOV_SCRIPT%", appveyor)

View File

@ -1,38 +1,38 @@
t = Template(; user=me)
pkg_dir = joinpath(t.dir, test_pkg)
@testset "CodeCov" begin
@testset "Codecov" begin
@testset "Plugin creation" begin
p = CodeCov()
p = Codecov()
@test p.gitignore == ["*.jl.cov", "*.jl.*.cov", "*.jl.mem"]
@test p.src === nothing
@test p.dest == ".codecov.yml"
@test p.badges == [
Badge(
"CodeCov",
"Codecov",
"https://codecov.io/gh/{{USER}}/{{PKGNAME}}.jl/branch/master/graph/badge.svg",
"https://codecov.io/gh/{{USER}}/{{PKGNAME}}.jl",
)
]
@test isempty(p.view)
p = CodeCov(; config_file=nothing)
p = Codecov(; config_file=nothing)
@test p.src === nothing
p = CodeCov(; config_file=test_file)
p = Codecov(; config_file=test_file)
@test p.src == test_file
@test_throws ArgumentError CodeCov(; config_file=fake_path)
@test_throws ArgumentError Codecov(; config_file=fake_path)
end
@testset "Badge generation" begin
p = CodeCov()
@test badges(p, me, test_pkg) == ["[![CodeCov](https://codecov.io/gh/$me/$test_pkg.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/$me/$test_pkg.jl)"]
p = Codecov()
@test badges(p, me, test_pkg) == ["[![Codecov](https://codecov.io/gh/$me/$test_pkg.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/$me/$test_pkg.jl)"]
end
@testset "File generation" begin
p = CodeCov()
p = Codecov()
@test isempty(gen_plugin(p, t, test_pkg))
@test !isfile(joinpath(pkg_dir, ".codecov.yml"))
p = CodeCov(; config_file=test_file)
p = Codecov(; config_file=test_file)
@test gen_plugin(p, t, test_pkg) == [".codecov.yml"]
@test isfile(joinpath(pkg_dir, ".codecov.yml"))
end

View File

@ -40,10 +40,10 @@ pkg_dir = joinpath(t.dir, test_pkg)
@test !occursin("Pkg.add(\"Documenter\")", travis)
rm(joinpath(pkg_dir, ".travis.yml"))
# Generating the plugin with CodeCov in the template should create a post-test step.
t.plugins[CodeCov] = CodeCov()
# Generating the plugin with Codecov in the template should create a post-test step.
t.plugins[Codecov] = Codecov()
gen_plugin(p, t, test_pkg)
delete!(t.plugins, CodeCov)
delete!(t.plugins, Codecov)
travis = read(joinpath(pkg_dir, ".travis.yml"), String)
@test occursin("after_success", travis)
@test occursin("Codecov.submit", travis)

View File

@ -25,7 +25,7 @@ const template_text = """
PKGNAME: {{PKGNAME}}
VERSION: {{VERSION}}}
{{#DOCUMENTER}}Documenter{{/DOCUMENTER}}
{{#CODECOV}}CodeCov{{/CODECOV}}
{{#CODECOV}}Codecov{{/CODECOV}}
{{#COVERALLS}}Coveralls{{/COVERALLS}}
{{#AFTER}}After{{/AFTER}}
{{#OTHER}}Other{{/OTHER}}
@ -70,13 +70,13 @@ write(test_file, template_text)
# The template should contain whatever plugins you give it.
t = Template(;
user=me,
plugins = [GitHubPages(), TravisCI(), AppVeyor(), CodeCov(), Coveralls()],
plugins = [GitHubPages(), TravisCI(), AppVeyor(), Codecov(), Coveralls()],
)
@test Set(keys(t.plugins)) == Set(
[GitHubPages, TravisCI, AppVeyor, CodeCov, Coveralls]
[GitHubPages, TravisCI, AppVeyor, Codecov, Coveralls]
)
@test Set(values(t.plugins)) == Set(
[GitHubPages(), TravisCI(), AppVeyor(), CodeCov(), Coveralls()]
[GitHubPages(), TravisCI(), AppVeyor(), Codecov(), Coveralls()]
)
# Duplicate plugins should warn.
@ -128,7 +128,7 @@ end
ssh=true,
plugins=[
TravisCI(),
CodeCov(),
Codecov(),
GitHubPages(),
],
)
@ -143,7 +143,7 @@ end
Minimum Julia version: v$(PkgTemplates.version_floor())
SSH remote: Yes
Plugins:
CodeCov:
Codecov:
Config file: None
3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem"
GitHubPages:
@ -160,7 +160,7 @@ end
t = Template(;
user=me,
license="MPL",
plugins=[Coveralls(), TravisCI(), CodeCov(), GitHubPages(), AppVeyor()],
plugins=[Coveralls(), TravisCI(), Codecov(), GitHubPages(), AppVeyor()],
)
temp_dir = mktempdir()
pkg_dir = joinpath(temp_dir, test_pkg)
@ -304,7 +304,7 @@ end
text = substitute(template_text, view)
@test !occursin("PKGNAME: $test_pkg", text)
@test !occursin("Documenter", text)
@test !occursin("CodeCov", text)
@test !occursin("Codecov", text)
@test !occursin("Coveralls", text)
@test !occursin("After", text)
@test !occursin("Other", text)
@ -330,9 +330,9 @@ end
@test occursin("After", text)
empty!(t.plugins)
t.plugins[CodeCov] = CodeCov()
t.plugins[Codecov] = Codecov()
text = substitute(template_text, t; view=view)
@test occursin("CodeCov", text)
@test occursin("Codecov", text)
@test occursin("After", text)
empty!(t.plugins)