-
Notifications
You must be signed in to change notification settings - Fork 0
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
Issue with Running Tests: Need to Add PiCLES Manually #31
Comments
You may be interested this tool: https://github.com/JuliaTesting/TestEnv.jl Not sure it applies here, but test environments can have requirements that are additional to those required strictly by the package. |
Thanks @glwagner . Also @mochell in the current version,
Without this the code isn't running! Here is the error message that I was getting -
and it was referring to line 72, here is the code where Revise is being used -
|
Why would |
Sorry I updated my comment. I don't know why
|
Can you paste a hyperlink to the code into this thread? |
Something like this: Line 4 in 2f0c987
I just don't know where in the repo the code is you're referring to. It's also helpful to link to individual lines! |
Oh yeah, here is the code - PiCLES/tests/T04_2D_reg_test.jl Line 72 in 2f0c987
|
Nice thanks. Note when you put a hyperlink to code, if you do not wrap it in text, it will display the code inline which is very helpful for reading a comment quickly. (I have edited your comment to use this feature.) It is also possible to link to a range of lines, eg PiCLES/tests/T04_2D_reg_test.jl Lines 60 to 76 in 2f0c987
do that you edit the hyperlink. To see the syntax, try to "edit" my post, and you will see how I added a line range to the end of the hyperlink. |
As for PiCLES/tests/T04_2D_reg_test.jl Line 72 in 2f0c987
presumably its irrelevant and can be deleted. I think there is a broader problem with the tests. In the first place the correct directory name is https://github.com/mochell/PiCLES/tree/main/tests This matters because the tests must be runnable via using Pkg
Pkg.test() from the package environment. This is required for CI. This comes from the docstring for help?> Pkg.test
Pkg.test(; kwargs...)
Pkg.test(pkg::Union{String, Vector{String}; kwargs...)
Pkg.test(pkgs::Union{PackageSpec, Vector{PackageSpec}}; kwargs...)
Keyword arguments:
• coverage::Bool=false: enable or disable generation of coverage statistics.
• allow_reresolve::Bool=true: allow Pkg to reresolve the package versions in the test environment
• julia_args::Union{Cmd, Vector{String}}: options to be passed the test process.
• test_args::Union{Cmd, Vector{String}}: test arguments (ARGS) available in the test process.
│ Julia 1.9
│
│ allow_reresolve requires at least Julia 1.9.
Run the tests for package pkg, or for the current project (which thus needs to be a package) if no positional argument is given to Pkg.test. A package
is tested by running its test/runtests.jl file. Moreover the tests cannot make any plots nor rely on GLMakie. GLMakie will fail to load on a headless system, like those used for CI: PiCLES/tests/T04_2D_reg_test.jl Line 26 in 2f0c987
I strongly suggest distinguishing between "examples" or "validation cases", and tests, which have a specific meaning in the context of CI. I also would suggest that before generating documentation about how to run the this cases (some of which perhaps are meant to become tests), that this infrastructure be created. Without CI and testing the package will be difficult to develop I think because many things will break routinely. |
yes the I know @glwagner the tests are on the way, just no time to develop that all the way through. So you would exclude validations, i.e. testing if the numbers are right, from the strict tests? |
thanks for trying this.
|
It doesn't need to be a registered package to make the tests, nor to add CI. Registering the package is purely a convenience for installation. |
I revised the introduction in the branch |
Hi @mochell, While following the quick start guide, I encountered an issue when trying to run the
T04_2D_reg_test.jl
file. Specifically, I had to manually add the PiCLES package in the test repository in order to run the test file, which can be confusing with current documentation.Steps to Reproduce:
Navigate to the tests directory.
Attempt to run the T04_2D_reg_test.jl file using:
Workaround
I resolved this by manually adding the PiCLES package while I was in the
test
repository using:and then run
Additionally, the test case (
T04_2D_reg_test.jl
) requires theOceananigans
package. This package seems to be missing from the environment, possibly because it's not listed in the Project.toml or Manifest.toml files. Adding Oceananigans manually using Pkg.add("Oceananigans") should resolve the issue.Can we add a paragraph on why it needs
Oceananigans.jl
?The text was updated successfully, but these errors were encountered: