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

Refactor and test Pkg.test #1427

Merged
merged 13 commits into from
Dec 9, 2019

Conversation

00vareladavid
Copy link
Contributor

@00vareladavid 00vareladavid commented Sep 27, 2019

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

@codecov

This comment has been minimized.

@00vareladavid 00vareladavid force-pushed the 00/rework/isolation branch 4 times, most recently from 71a307c to 54cf424 Compare September 30, 2019 03:12
@KristofferC
Copy link
Member

Regarding #311, it doesn't make much sense to me. You should probably set the environment variable yourself in that case.


function collect_developed!(ctx::Context, pkg::PackageSpec, developed::Vector{PackageSpec})
source = project_rel_path(ctx, source_path(pkg))
Pkg.activate(source) do
Copy link
Member

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)).

pkgs = load_all_deps(Context())
for pkg in filter(is_tracking_path, pkgs)
# normalize path
pkg.path = project_rel_path(Context(), source_path(pkg))
Copy link
Member

@KristofferC KristofferC Sep 30, 2019

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?

# normalize path
pkg.path = project_rel_path(Context(), source_path(pkg))
push!(developed, pkg)
collect_developed!(ctx, pkg, developed)
Copy link
Member

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?

@@ -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
Copy link
Member

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

@KristofferC
Copy link
Member

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

#=
Copy link
Member

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.

@00vareladavid 00vareladavid force-pushed the 00/rework/isolation branch 7 times, most recently from 1083339 to ad55c39 Compare November 19, 2019 07:55
@00vareladavid 00vareladavid reopened this Nov 19, 2019
dependencies(fn::Function, uuid::UUID) = fn(dependencies()[uuid])
function dependencies(fn::Function, uuid::UUID)
dep = get(dependencies(), uuid, nothing)
if dep === nothing
Copy link
Member

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.

@00vareladavid 00vareladavid changed the title [WIP] Refactor Pkg.test Refactor and test Pkg.test Nov 20, 2019
@00vareladavid
Copy link
Contributor Author

00vareladavid commented Dec 1, 2019

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 Pkg.test behavior with these tests. Perhaps @fredrikekre you can take a quick look at the tests? Since you have been good about finding holes in Pkg.test.

I'll be happy to test any other cases that people can think of.

@KristofferC
Copy link
Member

Great job! Nice to get rid of that duplication.

@00vareladavid 00vareladavid force-pushed the 00/rework/isolation branch 2 times, most recently from e754718 to 97b2752 Compare December 9, 2019 18:28
@00vareladavid
Copy link
Contributor Author

I appreciate it Kristoffer. And thanks for the review!

@00vareladavid 00vareladavid reopened this Dec 9, 2019
@00vareladavid 00vareladavid merged commit d69f6d7 into JuliaLang:master Dec 9, 2019
@00vareladavid 00vareladavid deleted the 00/rework/isolation branch December 9, 2019 22:14
@KristofferC
Copy link
Member

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.

@00vareladavid
Copy link
Contributor Author

Definitely. Taking a look now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing another package from a package environment is broken Test deps should not be direct deps
2 participants