Skip to content

Test: DeePKS unit test target passes in CI without running any test cases #7573

Description

@AsTonyshment

Summary

09_DeePKS_test1 is selected by CI through:

ctest --test-dir build -V --timeout 1700 -R 09_DeePKS

However, it currently passes without running any DeePKS unit-test cases.

This is different from 09_DeePKS, the DeePKS integration test, which does run real regression cases through tests/integrate/Autotest.sh.

What happens

tests/09_DeePKS/CMakeLists.txt registers:

add_test(
   NAME 09_DeePKS_test1
   COMMAND ${BASH} Autotest1.sh -a ${CMAKE_CURRENT_BINARY_DIR}/../../source/source_lcao/module_deepks/test/test_deepks
   WORKING_DIRECTORY ${ABACUS_TEST_DIR}/09_DeePKS
)

But tests/09_DeePKS/Autotest1.sh reads a missing file:

testdir=`cat CASES1 | grep -E $case`

In CI this produces:

Image

Since no cases are selected, the loop is skipped and the script exits successfully.

Additional concern

source/source_lcao/module_deepks/test/test_deepks is not registered like most module unit tests in ABACUS. It is built as a standalone executable and then indirectly included in CTest through tests/09_DeePKS/Autotest1.sh, instead of being registered directly with the project AddTest() / GTest-based unit-test flow.

Expected behavior

  • 09_DeePKS_test1 should fail if its case list is missing or empty.
  • DeePKS unit tests should actually run in CI.
  • Ideally, DeePKS unit tests should be refactored to follow the same AddTest() / GTest convention as other module unit tests.

Suggested fix

  • Refactor test_deepks into a normal module unit test registered directly through AddTest() / GTest.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions