-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Refactor and test Pkg.test
#1427
Refactor and test Pkg.test
#1427
Conversation
817758a
to
e1bb47e
Compare
This comment has been minimized.
This comment has been minimized.
71a307c
to
54cf424
Compare
Regarding #311, it doesn't make much sense to me. You should probably set the environment variable yourself in that case. |
src/Operations.jl
Outdated
|
||
function collect_developed!(ctx::Context, pkg::PackageSpec, developed::Vector{PackageSpec}) | ||
source = project_rel_path(ctx, source_path(pkg)) | ||
Pkg.activate(source) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of activating here, can't we give the path to Context
? Something like Context(env = EnvCache(source))
.
src/Operations.jl
Outdated
pkgs = load_all_deps(Context()) | ||
for pkg in filter(is_tracking_path, pkgs) | ||
# normalize path | ||
pkg.path = project_rel_path(Context(), source_path(pkg)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably shouldn't remake the Context
here every time?
src/Operations.jl
Outdated
# normalize path | ||
pkg.path = project_rel_path(Context(), source_path(pkg)) | ||
push!(developed, pkg) | ||
collect_developed!(ctx, pkg, developed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this trying to help with #1005?
src/Operations.jl
Outdated
@@ -767,6 +793,16 @@ function dependency_order_uuids(ctx::Context, uuids::Vector{UUID})::Dict{UUID,In | |||
return order | |||
end | |||
|
|||
function gen_build_project(ctx::Context, pkg::PackageSpec, source_path::String) | |||
build_project = Types.Project() | |||
Pkg.activate(source_path) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here with path to Context
Would be great to get rid of that compat file! |
test/repl.jl
Outdated
@@ -394,6 +394,7 @@ temp_pkg_dir() do project_path; cd(project_path) do | |||
end # testset | |||
end end | |||
|
|||
#= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get rid of the specific test that checks the LibFoo
thing, but most of this should still be active.
1083339
to
ad55c39
Compare
7b0cadf
to
b03c53b
Compare
dependencies(fn::Function, uuid::UUID) = fn(dependencies()[uuid]) | ||
function dependencies(fn::Function, uuid::UUID) | ||
dep = get(dependencies(), uuid, nothing) | ||
if dep === nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you could write this as
dep = get(dependencies, uuid) do
pkgerror("depenendency with UUID `$uuid` does not exist")
end
But I am not sure this is preferable even.
I feel this is in a mergeable state now, if anyone wants to take another look. I've tested most of the basic cases I can think of, hopefully we can pin down most of the I'll be happy to test any other cases that people can think of. |
a3b67eb
to
e57f1ed
Compare
Great job! Nice to get rid of that duplication. |
e754718
to
97b2752
Compare
97b2752
to
2067980
Compare
I appreciate it Kristoffer. And thanks for the review! |
I think this caused packages to fail during tests if they don't have a project file (for example: https://github.com/maleadt/BasePkgEvalReports/blob/adfa530cc2662ca9abd85544d3ed41aa6d0ad95f/pkgeval-daily_2019_12_16/logs/Permutations/1.4.0-DEV-a6bf74a2f9.log#L36-L65). I think we need to try fix that. |
Definitely. Taking a look now |
I want "targets" based testing to reuse the same machinery as "test/Project.toml" based testing. This will allow us to get rid of
backwards_compatible_isolation.jl
.fix #1287 fix #1423