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

Adding a test that is pinned to a specific commit of the General registry? #2445

Closed
DilumAluthge opened this issue Mar 23, 2021 · 5 comments · Fixed by #2439
Closed

Adding a test that is pinned to a specific commit of the General registry? #2445

DilumAluthge opened this issue Mar 23, 2021 · 5 comments · Fixed by #2439

Comments

@DilumAluthge
Copy link
Member

I want to add a test to the Pkg test suite that involves instantiating a project that has a direct dependency (Example.jl) that does not have a [compat] entry.

This test is subject to breakage in the future. Therefore, I would like to run this test using a specific commit of the General registry. Since commits are immutable, this ensures that the test will not break in the future.

What is the best way to use a specific commit of the General registry in a Utils.isolate() test?

cc: @IanButterworth @KristofferC

@DilumAluthge
Copy link
Member Author

@IanButterworth I know you recently improved a bunch of stuff regarding how we cache the General registry in the Pkg test suite, so I'm wondering if you have any thoughts on how I might be able to get (and cache) a specific commit of the registry?

The trick is that I only want to use this specific commit of the registry for a specific test. For all other tests, we can just use the latest General registry.

@IanButterworth
Copy link
Member

IanButterworth commented Mar 23, 2021

There might be a simpler way, but something like this?
You're not going to use the linked reg, but you might as well specify the linked one as it will be faster to setup before you delete the symlinked dir

isolate(loaded_depot=false, linked_reg=true) do
    this_gen_reg_path = joinpath(last(ENV["DEPOT_PATH"]), "registries", "General")
    rm(this_gen_reg_path) # delete the symlinked reg dir
    # Then clone General to the same path and do stuff?

end

@DilumAluthge
Copy link
Member Author

Thanks!

I get a KeyError from the last(ENV["DEPOT_PATH"]) part. Should I be using last(Base.DEPOT_PATH) instead?

@DilumAluthge
Copy link
Member Author

Take a look at the changes I made to the test/utils.jl in #2439

@DilumAluthge
Copy link
Member Author

Also, I needed to add force=true to the rm; otherwise it errors.

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 a pull request may close this issue.

2 participants