Error with runtest.jl and Aqua

Using VSCode I right click on runtests.jl and select Julia: Execute File in REPL. I obtain the following error and then try a few more commands as follows:

ERROR: LoadError: ArgumentError: Package Aqua not found in current path.
- Run `import Pkg; Pkg.add("Aqua")` to install the Aqua package.
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:2403 [inlined]
 [2] macro expansion
   @ .\lock.jl:376 [inlined]
 [3] __require(into::Module, mod::Symbol)
   @ Base .\loading.jl:2386
 [4] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:2362
 [5] include(mapexpr::Function, mod::Module, _path::String)
   @ Base .\Base.jl:307
 [6] top-level scope
   @ c:\Users\jakez\.julia\dev\Gantner\test\runtests.jl:5
in expression starting at c:\Users\jakez\.julia\dev\Gantner\test\Aqua.jl:1

(Gantner) pkg> activate test
  Activating project at `C:\Users\jakez\.julia\dev\Gantner\test`

(test) pkg> st
Status `C:\Users\jakez\.julia\dev\Gantner\test\Project.toml`
  [4c88cf16] Aqua v0.8.14
  [f686b519] Gantner v0.1.1 `..`
  [ade2ca70] Dates v1.11.0
  [8dfed614] Test v1.11.0

(test) pkg> test
ERROR: The Project.toml of the package being tested must have a name and a UUID entry

(test) pkg> 

The runtests.jl file starts as:

using Dates
using Gantner
using Test

include("Aqua.jl")

And Aqua.jl is:

using Aqua

@testset "Aqua.jl" begin
    Aqua.test_all(Gantner; deps_compat=(ignore=[:Dates],))
end

I am not sure what is happening here, as the test Project.toml indicates that Aqua is present. And Aqua is registered in the Local Registry. The complete package is here.

Edit! I edited the include statement in Gantner from the line commented out to the current line as shown below.

#include(joinpath(@__DIR__, "read_exact.jl"))
include("read_exact.jl")

Now if I go ]test the tests complete but right clicking on runtests.jl gives the same error as before.

Try to add something like:

using Pkg
if ! ("Aqua" ∈ keys(Pkg.project().dependencies))
    Pkg.activate("test")
end

at the beginning of the runtests.jl script.

I found the problem. The top 4 lines of the Project.toml were

name = "Gantner"
uuid = "f686b519-92d3-45a6-8ed5-da98460f9b0d"
version = "0.1.1"
authors = ["JakeZw "]

After looking at some other Project.toml files I changed it to:

name = "Gantner"
uuid = "f686b519-92d3-45a6-8ed5-da98460f9b0d"
authors = ["JakeZw <jake.zwart@spectrum-tec.com> and contributors"]
version = "0.1.1"

And now the tests work! Not sure internally how Julia interprets this differently. I expect that Gantner was one of my earlier packages and not setup correctly

I doubt that this was the reason for the failure. I assume you changed something else that fixed your problem.

That was what I thought when I posted this, but I looked and VSCode only showed the Project.toml as having been changed. But I was not thorough and testing it with changing it back. So I changed it back to the first version posted above and the tests still run. So now I assume that editing the file caused something hidden to change somewhere and that caused it to work? I am confused, but it is working.

In University days using WATFIV at University of Waterloo, a bunch of terminals in a room were wired into a PDF11. When we submitted a job for execution, the program went to the mainframe for execution and the results sent back to the PDP 11. At times there would be an unprintable character inserted into the program and the only way to correct is was to eliminate the word and retype it. The program looked identical to what it was previously but now it ran. I think those types of errors have largely disappeared but who knows what happened here. Mysteries still happen I guess.

1 Like