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

Partial package updates #17132

Merged
merged 6 commits into from
Jul 12, 2016
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Small fixes in test/pkg.jl
carlobaldassi committed Jul 12, 2016
commit 3f03d4e9cf8bfc7297b520708c612f4442ff79fb
26 changes: 13 additions & 13 deletions test/pkg.jl
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ macro grab_outputs(ex)
end

# Test basic operations: adding or removing a package, status, free
#Also test for the existence of REQUIRE and META_Branch
# Also test for the existence of REQUIRE and META_BRANCH
temp_pkg_dir() do
@test isfile(joinpath(Pkg.dir(),"REQUIRE"))
@test isfile(joinpath(Pkg.dir(),"META_BRANCH"))
@@ -219,69 +219,69 @@ temp_pkg_dir() do
# Various pin/free/re-pin/change-pin patterns (issue #17176)
begin
ret, out, err = @grab_outputs Pkg.free("Example")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Freeing Example")

ret, out, err = @grab_outputs Pkg.pin("Example")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test ismatch(r"INFO: Creating Example branch pinned\.[0-9a-f]{8}\.tmp", err)
@test !contains(err, "INFO: No packages to install, update or remove")
branchid = replace(err, r".*pinned\.([0-9a-f]{8})\.tmp.*"s, s"\1")
vers = Pkg.installed("Example")

ret, out, err = @grab_outputs Pkg.free("Example")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Freeing Example")

ret, out, err = @grab_outputs Pkg.pin("Example", v"0.4.0")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Creating Example branch pinned.b1990792.tmp")
@test contains(err, "INFO: No packages to install, update or remove")
@test Pkg.installed("Example") == v"0.4.0"

ret, out, err = @grab_outputs Pkg.pin("Example", v"0.4.0")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Package Example is already pinned to the selected commit")
@test !contains(err, "INFO: No packages to install, update or remove")
@test Pkg.installed("Example") == v"0.4.0"

ret, out, err = @grab_outputs Pkg.pin("Example")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Package Example is already pinned")
@test !contains(err, "INFO: No packages to install, update or remove")
@test Pkg.installed("Example") == v"0.4.0"

ret, out, err = @grab_outputs Pkg.update()
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Package Example: skipping update (pinned)...")
@test Pkg.installed("Example") == v"0.4.0"

ret, out, err = @grab_outputs Pkg.pin("Example", v"0.3.1")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Creating Example branch pinned.d1ef7b00.tmp")
@test contains(err, "INFO: No packages to install, update or remove")
@test Pkg.installed("Example") == v"0.3.1"

ret, out, err = @grab_outputs Pkg.pin("Example", v"0.4.0")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Package Example: checking out existing branch pinned.b1990792.tmp")
@test contains(err, "INFO: No packages to install, update or remove")
@test Pkg.installed("Example") == v"0.4.0"

ret, out, err = @grab_outputs Pkg.free("Example")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Freeing Example")
@test contains(err, "INFO: No packages to install, update or remove")
@test Pkg.installed("Example") == vers

ret, out, err = @grab_outputs Pkg.pin("Example")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Package Example: checking out existing branch pinned.$branchid.tmp")
@test !contains(err, "INFO: No packages to install, update or remove")
@test Pkg.installed("Example") == vers

ret, out, err = @grab_outputs Pkg.free("Example")
@test ret == nothing && out == ""
@test ret === nothing && out == ""
@test contains(err, "INFO: Freeing Example")
@test Pkg.installed("Example") == vers
end