Skip to content

Test refactoring: @testmodule opacity #1225

@abussy

Description

@abussy

In various places in the tests, e.g. in silicon tests such as silicon_lda.jl, the following pattern appears:

@testitem "Silicon LDA (small, Float64)" #=
=# tags=[:minimal] setup=[RunSCF, TestCases, SiliconLDA] begin
SiliconLDA.run_silicon_lda(Float64; Ecut=7, test_tol=0.03, n_ignored=0, grid_size=17,
scf_ene_tol=1e-5)
end

There is a couple of issues with that:

  1. Without having a close look at the SiliconLDA @testmodule, it is not obvious that TestCases is required in the setup. Arguably, it's not even that clear when looking at the code.

  2. The order of the required modules in the test setup matters: setup=[RunSCF, TestCases, SiliconLDA] works, but setup=[RunSCF, SiliconLDA, TestCases] does not.

This is a somewhat opaque and error prone. Making things more explicit might save time in the long run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    testingTest system and test improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions