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

Cannot run tests on package with unregistered dependencies #47

Open
white-alistair opened this issue Apr 12, 2023 · 4 comments
Open

Cannot run tests on package with unregistered dependencies #47

white-alistair opened this issue Apr 12, 2023 · 4 comments

Comments

@white-alistair
Copy link

Hi, thanks a lot for this great package. Often during development I will have a package which depends on some other unregistered package, typically hosted on GitHub, but sometimes also dev'd to a local version.

As a MWE I created the following two repositories, where TestPkg.jl depends on RemoteTestPkg.jl:

https://github.com/white-alistair/TestPkg.jl
https://github.com/white-alistair/RemoteTestPkg.jl

When I run the tests for TestPkg.jl at the REPL using ] test, they pass as expected. However, when I try to run them using TestItemRunner (e.g. by clicking the play icon in the VS Code "Testing" tab), I get the following stack trace:

[ Info: Starting the Julia Test Server
┌ Info: This test server instance was started with the following configuration.
│   project_path = ""
│   package_path = "/home/alistair/code/TestPkg"
└   package_name = "TestPkg"
  Activating new project at `/tmp/jl_8wU3Ja`
   Resolving package versions...
┌ Error: Some Julia code in the VS Code extension crashed
└ @ Main ~/.vscode/extensions/julialang.language-julia-1.45.1/scripts/error_handler.jl:15
ERROR: Unsatisfiable requirements detected for package RemoteTestPkg [1c96aa74]:
 RemoteTestPkg [1c96aa74] log:
 ├─RemoteTestPkg [1c96aa74] has no known versions!
 └─restricted to versions * by TestPkg [f69f418b] — no versions left
   └─TestPkg [f69f418b] log:
     ├─possible versions are: 0.1.0 or uninstalled
     └─TestPkg [f69f418b] is fixed to version 0.1.0
Stacktrace:
  [1] check_constraints(graph::Pkg.Resolve.Graph)
    @ Pkg.Resolve /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/Resolve/graphtype.jl:998
  [2] Pkg.Resolve.Graph(compat::Dict{Base.UUID, Dict{VersionNumber, Dict{Base.UUID, Pkg.Versions.VersionSpec}}}, uuid_to_name::Dict{Base.UUID, String}, reqs::Dict{Base.UUID, Pkg.Versions.VersionSpec}, fixed::Dict{Base.UUID, Pkg.Resolve.Fixed}, verbose::Bool, julia_version::VersionNumber)
    @ Pkg.Resolve /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/Resolve/graphtype.jl:344
  [3] deps_graph(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, uuid_to_name::Dict{Base.UUID, String}, reqs::Dict{Base.UUID, Pkg.Versions.VersionSpec}, fixed::Dict{Base.UUID, Pkg.Resolve.Fixed}, julia_version::VersionNumber)
    @ Pkg.Operations /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:496
  [4] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
    @ Pkg.Operations /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:351
  [5] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1254
  [6] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
    @ Pkg.Operations /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1239
  [7] _resolve(io::Base.PipeEndpoint, env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1260
  [8] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1298
  [9] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; shared::Bool, preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.PipeEndpoint, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.PipeEndpoint}}})
    @ Pkg.API /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/API.jl:222
 [10] develop(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.PipeEndpoint, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/API.jl:156
 [11] develop(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/API.jl:145
 [12] #develop#14
    @ /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/API.jl:143 [inlined]
 [13] develop
    @ /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/API.jl:143 [inlined]
 [14] develop(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::String, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /opt/julia-1.8.2/share/julia/stdlib/v1.8/Pkg/src/API.jl:173
 [15] serve(conn::Base.PipeEndpoint, project_path::String, package_path::String, package_name::String; is_dev::Bool, crashreporting_pipename::Nothing)
    @ VSCodeTestServer ~/.vscode/extensions/julialang.language-julia-1.45.1/scripts/packages/VSCodeTestServer/src/VSCodeTestServer.jl:195
 [16] serve(conn::Base.PipeEndpoint, project_path::String, package_path::String, package_name::String)
    @ VSCodeTestServer ~/.vscode/extensions/julialang.language-julia-1.45.1/scripts/packages/VSCodeTestServer/src/VSCodeTestServer.jl:190
 [17] top-level scope
    @ ~/.vscode/extensions/julialang.language-julia-1.45.1/scripts/testserver/testserver_main.jl:14
 [18] include(mod::Module, _path::String)
    @ Base ./Base.jl:419
 [19] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:303
 [20] _start()
    @ Base ./client.jl:522

@white-alistair
Copy link
Author

So I guess Pkg is trying to resolve the environment from Project.toml even though Manifest.toml is also present, and therefore failing to find the unregistered package RemoteTestPkg. So I'm not sure if this is specifically an issue with TestItemRunner. Nonetheless I will leave this issue open for now in case there's a way of making this workflow work.

@davidanthoff
Copy link
Member

Can you try the insider build of the VS Code extension? I think this might be fixed in the pre-release build.

@white-alistair
Copy link
Author

I'm already on the pre-release (v1.45.1) version if that's what you mean.

@white-alistair
Copy link
Author

Hi, I've run into this problem again. Just wondering if there's any known workaround?

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

No branches or pull requests

2 participants