@@ -271,51 +271,44 @@ format(".")
271271
272272The full test of ` Lux.jl ` takes a long time, here's how to test a portion of the code.
273273
274- For each ` @testitem ` , there are corresponding ` tags ` , for example:
274+ Tests are organized by directories, where each directory contains test files with ` @testset `
275+ blocks. For example, tests for ` SkipConnection ` are in ` test/core_layers/containers_tests.jl ` .
275276
276- ``` julia
277- @testitem " SkipConnection" setup= [SharedTestSetup] tags= [:core_layers]
278- ```
277+ #### Running a Specific Test File
279278
280- For example, let's consider the tests for ` SkipConnection ` :
279+ The easiest way to run a specific test is to directly activate the test directory and
280+ include the test file:
281281
282282``` julia
283- @testitem " SkipConnection" setup= [SharedTestSetup] tags= [:core_layers] begin
284- ...
285- end
286- ```
287-
288- We can test the group to which ` SkipConnection ` belongs by testing ` core_layers ` .
289- To do so set the ` LUX_TEST_GROUP ` environment variable, or rename the tag to
290- further narrow the test scope:
283+ # From the Lux.jl root directory
284+ using Pkg
285+ Pkg. activate(" test" )
291286
292- ``` shell
293- export LUX_TEST_GROUP= " core_layers"
287+ # Run a specific test file
288+ include( " test/ core_layers/containers_tests.jl " )
294289```
295290
296- Or directly modify the default test tag in ` runtests.jl ` :
291+ This approach allows you to quickly iterate on specific tests without running the entire
292+ test suite.
297293
298- ``` julia
299- # const LUX_TEST_GROUP = lowercase(get(ENV, "LUX_TEST_GROUP", "all"))
300- const LUX_TEST_GROUP = lowercase(get(ENV , " LUX_TEST_GROUP" , " core_layers" ))
301- ```
294+ See [ ParallelTestRunners.jl] ( https://github.com/JuliaTesting/ParallelTestRunner.jl ) for
295+ details on executing specific groups of tests.
302296
303- But be sure to restore the default value "all" before submitting the code.
297+ #### Running Test Groups via CI
304298
305- Furthermore if you want to run a specific test based on the name of the testset , you can
306- use [ TestEnv.jl ] ( https://github.com/JuliaTesting/TestEnv.jl ) as follows. Start with activating the Lux environment and then run the following :
299+ To run a specific group of tests via the test runner , you can pass the directory name as a
300+ positional argument :
307301
308- ``` julia
309- using TestEnv; TestEnv. activate(); using ReTestItems;
310-
311- # Assuming you are in the main directory of Lux
312- ReTestItems. runtests(" tests/" ; name = " NAME OF THE TEST" )
302+ ``` shell
303+ julia --project -e ' using Pkg; Pkg.test(test_args=["core_layers"])'
313304```
314305
315- For the ` SkipConnection ` tests that would be:
306+ #### Running All Tests
316307
317- ``` julia
318- ReTestItems. runtests(" tests/" ; name = " SkipConnection" )
308+ To run the full test suite:
309+
310+ ``` shell
311+ julia --project -e ' using Pkg; Pkg.test()'
319312```
320313
321314### 📖 Documentation
0 commit comments