-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple version switching test from ExpontentialUtils (#831)
* Decouple version switching test from ExpontentialUtils And also fix a bug when revising from a package that was previously empty, where it would assume it hadn't been parsed yet because `modexsigs` was empty. * ALso fix start_late test * For prerelease versions, get source by commit * Adjust for release versions * Properly escape path for windows * Update test/switch_version.jl Co-authored-by: Tim Holy <[email protected]> --------- Co-authored-by: Tim Holy <[email protected]>
- Loading branch information
Showing
13 changed files
with
64 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name = "PkgChange" | ||
uuid = "ad1172b6-6378-44d8-862e-6490a202d023" | ||
version = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module PkgChange | ||
|
||
# Deliberately empty. This test also tests revising from an empty file to a file | ||
# with contents. | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name = "PkgChange" | ||
uuid = "ad1172b6-6378-44d8-862e-6490a202d023" | ||
version = "0.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module PkgChange | ||
|
||
export somemethod | ||
somemethod() = 1 | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Revise, Pkg, Test | ||
mktempdir() do thisdir | ||
Pkg.activate(thisdir) | ||
|
||
Pkg.develop(path = joinpath(dirname(@__FILE__), "pkgs", "PkgChange_v1")) | ||
|
||
# This is only needed on Pkg versions that don't notify | ||
Revise.active_project_watcher() | ||
|
||
# Back to toplevel | ||
@eval begin | ||
using PkgChange | ||
@test_throws UndefVarError somemethod() # not present in v1 | ||
# From a different process, switch the active version of ExponentialUtilities | ||
v2_cmd = """using Pkg; Pkg.activate("."); Pkg.develop(path = joinpath("$(escape_string(dirname(@__FILE__)))", "pkgs", "PkgChange_v2"))""" | ||
t = @async run(pipeline(Cmd(`$(Base.julia_cmd()) -e $v2_cmd`; dir=$thisdir); stderr, stdout)) | ||
isdefined(Base, :errormonitor) && Base.errormonitor(t) | ||
wait(Revise.revision_event) | ||
revise() | ||
@test somemethod() === 1 # present in v2 | ||
# ...and then switch back (check that it's bidirectional and also to reset state) | ||
v1_cmd = """using Pkg; Pkg.activate("."); Pkg.develop(path = joinpath("$(escape_string(dirname(@__FILE__)))", "pkgs", "PkgChange_v1"))""" | ||
t = @async run(pipeline(Cmd(`$(Base.julia_cmd()) -e $v1_cmd`; dir=$thisdir); stderr, stdout)) | ||
isdefined(Base, :errormonitor) && Base.errormonitor(t) | ||
wait(Revise.revision_event) | ||
revise() | ||
@test_throws MethodError somemethod() # not present in v1 | ||
end | ||
end |