2017-10-02 01:43:03 +00:00
|
|
|
user = gitconfig["github.user"]
|
|
|
|
t = Template(; user=me)
|
|
|
|
temp_dir = mktempdir()
|
|
|
|
pkg_dir = joinpath(temp_dir, test_pkg)
|
|
|
|
|
|
|
|
@testset "AppVeyor" begin
|
|
|
|
@testset "Plugin creation" begin
|
|
|
|
p = AppVeyor()
|
|
|
|
@test isempty(p.gitignore)
|
2018-09-19 19:19:16 +00:00
|
|
|
@test p.src == joinpath(PkgTemplates.DEFAULTS_DIR, "appveyor.yml")
|
2017-10-02 01:43:03 +00:00
|
|
|
@test p.dest == ".appveyor.yml"
|
|
|
|
@test p.badges == [
|
|
|
|
Badge(
|
|
|
|
"Build Status",
|
|
|
|
"https://ci.appveyor.com/api/projects/status/github/{{USER}}/{{PKGNAME}}.jl?svg=true",
|
|
|
|
"https://ci.appveyor.com/project/{{USER}}/{{PKGNAME}}-jl",
|
|
|
|
),
|
|
|
|
]
|
|
|
|
@test isempty(p.view)
|
|
|
|
p = AppVeyor(; config_file=nothing)
|
2018-09-19 19:19:16 +00:00
|
|
|
@test p.src === nothing
|
2017-10-02 01:43:03 +00:00
|
|
|
p = AppVeyor(; config_file=test_file)
|
2018-09-19 19:19:16 +00:00
|
|
|
@test p.src == test_file
|
2017-10-02 01:43:03 +00:00
|
|
|
@test_throws ArgumentError AppVeyor(; config_file=fake_path)
|
|
|
|
end
|
|
|
|
|
|
|
|
@testset "Badge generation" begin
|
|
|
|
p = AppVeyor()
|
|
|
|
@test badges(p, user, test_pkg) == ["[](https://ci.appveyor.com/project/$user/$test_pkg-jl)"]
|
|
|
|
end
|
|
|
|
|
|
|
|
@testset "File generation" begin
|
|
|
|
p = AppVeyor()
|
|
|
|
@test gen_plugin(p, t, temp_dir, test_pkg) == [".appveyor.yml"]
|
|
|
|
@test isfile(joinpath(pkg_dir, ".appveyor.yml"))
|
2018-09-19 19:25:09 +00:00
|
|
|
appveyor = read(joinpath(pkg_dir, ".appveyor.yml"), String)
|
2018-09-19 19:30:23 +00:00
|
|
|
@test !occursin("coverage=true", appveyor)
|
|
|
|
@test !occursin("after_test", appveyor)
|
|
|
|
@test !occursin("Codecov.submit", appveyor)
|
|
|
|
@test !occursin("Coveralls.submit", appveyor)
|
2017-10-02 01:43:03 +00:00
|
|
|
rm(joinpath(pkg_dir, ".appveyor.yml"))
|
|
|
|
t.plugins[CodeCov] = CodeCov()
|
|
|
|
gen_plugin(p, t, temp_dir, test_pkg)
|
|
|
|
delete!(t.plugins, CodeCov)
|
2018-09-19 19:25:09 +00:00
|
|
|
appveyor = read(joinpath(pkg_dir, ".appveyor.yml"), String)
|
2018-09-19 19:30:23 +00:00
|
|
|
@test occursin("coverage=true", appveyor)
|
|
|
|
@test occursin("after_test", appveyor)
|
|
|
|
@test occursin("Codecov.submit", appveyor)
|
|
|
|
@test !occursin("Coveralls.submit", appveyor)
|
2017-10-02 01:43:03 +00:00
|
|
|
rm(joinpath(pkg_dir, ".appveyor.yml"))
|
|
|
|
t.plugins[Coveralls] = Coveralls()
|
|
|
|
gen_plugin(p, t, temp_dir, test_pkg)
|
|
|
|
delete!(t.plugins, Coveralls)
|
2018-09-19 19:25:09 +00:00
|
|
|
appveyor = read(joinpath(pkg_dir, ".appveyor.yml"), String)
|
2018-09-19 19:30:23 +00:00
|
|
|
@test occursin("coverage=true", appveyor)
|
|
|
|
@test occursin("after_test", appveyor)
|
|
|
|
@test occursin("Coveralls.submit", appveyor)
|
|
|
|
@test !occursin("Codecov.submit", appveyor)
|
2017-10-02 01:43:03 +00:00
|
|
|
rm(joinpath(pkg_dir, ".appveyor.yml"))
|
|
|
|
p = AppVeyor(; config_file=nothing)
|
|
|
|
@test isempty(gen_plugin(p, t, temp_dir, test_pkg))
|
|
|
|
@test !isfile(joinpath(pkg_dir, ".appveyor.yml"))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
rm(temp_dir; recursive=true)
|