Pkg test - ERROR: Cannot `develop` package with the same name or uuid as the project

In my package AppliAR, I have defined tests in runtests.jl. The tests run successfully.

When I add AppliAR (#dev) to another project and run test AppliAR I get the message: ERROR: Cannot develop package with the same name or uuid as the project.

The sub-modules are Domain, API, Infrastructure, and Report. I am using Julia 1.3.1.

What am I doing wrong?

Run test from another project

(AppliMaster) pkg> st
    Status `~/julia-projects/tc/AppliMaster/Project.toml`
  [1e47966d] AppliAR v0.3.4 #dev (https://github.com/rbontekoe/AppliAR.jl)
  [69311175] AppliGeneralLedger v0.1.0
  [c1345d04] AppliSales v0.1.2
  [df971d30] Rocket v1.2.4

(AppliMaster) pkg> test AppliAR
   Testing AppliAR
ERROR: Cannot `develop` package with the same name or uuid as the project

runtest.jl top

using AppliAR

using Test
using AppliSales
using AppliGeneralLedger
using Dates

# TEST MODEL
@testset "Orders" begin
    orders = AppliSales.process()
    @test length(orders) == 3
    @test orders[1].org.name == "Scrooge Investment Bank"
    @test orders[1].training.name == "Learn Smiling"
end

When you activate the project of a pack, just use test without arguments to run the tests

1 Like

Thank you, it gave me more information: ERROR: trying to test unnamed project - This is correct, AppliMaster is unnamed.

BTW: @giordano, how can I convert an unnamed project into a named project?

(v1.3) pkg> activate .
Activating environment at `~/julia-projects/tc/AppliMaster/Project.toml`

(AppliMaster) pkg> test
ERROR: trying to test unnamed project

The Project.toml file should have a name key, like this:
https://github.com/JuliaLang/Pkg.jl/blob/a8cc6d670ebe55002c5d5efb7fb19315c0c1cd55/Project.toml#L1

1 Like

@giordano, I am aware of it, but how do I generate a new uuid?

julia> using UUIDs

julia> uuid4()
UUID("3f0e5f6a-4f8c-4cce-b8da-6540b009afd0")
3 Likes

Every day I learn more and more. Thank you @GunnarFarneback.

1 Like