Replies: 1 comment
-
If you want to know how https://github.com/CliMA/Oceananigans.jl/blob/main/.buildkite/pipeline.yml For CI purposes, the Oceananigans tests are organized into " https://github.com/CliMA/Oceananigans.jl/blob/main/test/runtests.jl For example, the "abstract operations" tests are run by setting some environment variables: Oceananigans.jl/.buildkite/pipeline.yml Lines 375 to 378 in c74dfc6 and then executing Oceananigans.jl/.buildkite/pipeline.yml Lines 379 to 380 in c74dfc6 Groups can be exploited on your local machine with the command TEST_GROUP=abstract_operations julia --project -e 'using Pkg; Pkg.test()' or by just starting julia with TEST_GROUP=abstract_operations julia --project and running tests from "package manager mode" by pressing pkg> test Finally, note that The way it's written now, we run only on GPU if a GPU is detected. So change |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm starting this thread to share productivity tips about developing Oceananigans and also discuss in detail how Oceananigans testing system works. If anyone has other tips to share beyond this first post, please do! And questions are welcome.
For new developers the basic process, as suggested by @iuryt on #2281, is
main
branch, or another branch.Oceananigans
main branch.@iuryt also asked:
There's a short answer and a long answer to this question.
The short answer is to clone the fork to your local machine, navigate to the root directory of the repository, and run
This basically executes
test/runtests.jl
in an isolated environment.However, you rarely want to run all the tests with one command, because this will take hours. Instead you want to test individual functionality. One way to do this is to navigate to
/test/
, and then launch julia:Next, you can
include
individual test files at the REPLFor most of the test files (
test/test_*.jl
), this should work, because most of them have been written to "stand alone". For the most part, if this doesn't work for a particular file, then we just need to addinclude("dependencies_for_runtests.jl")
at the top of the file.The nice thing about including the tests interactively is that we can make changes to the tests without having to recompile Oceananigans. In addition, if we are using
Revise.jl
, we can also make changes to Oceananigans source code and rerun the tests with minimal recompilation cost. This results in a relatively speedy and productive workflow compared to, say, always executing the entire test suite to exercise a particular feature.Some other ways to test new source code are:
Add a script to
validation
(in the appropriate sub-directory), and to run that script. Stuff invalidation
should read like ordinary scripts (like examples, but without the need for extensive annotation). For example, if I implement a new turbulence closure, I might write a simple script that implements an example to see if the closure is behaving as I "expect".Use the REPL and Revise.jl. For example, if I'm developing a
show
method, I might just build the object that I'm developing theshow
method:Beta Was this translation helpful? Give feedback.
All reactions