Skip to content

Move legacy PHPUnit tests to /tests/Legacy - #4255

Merged
josephsnyder merged 2 commits into
Kitware:masterfrom
williamjallen:move-legacy-unit-tests
Nov 24, 2026
Merged

josephsnyder merged 2 commits into
Kitware:masterfrom
williamjallen:move-legacy-unit-tests

Conversation

@williamjallen

Copy link
Copy Markdown
Member

The PHPUnit tests in app/cdash/tests/case had their own CTest helper and bootstrap file. This PR moves them to tests/Legacy, next to the other test directories, so they're registered and run like every other test there. The tests themselves are unchanged apart from namespaces and imports. Converting them into proper unit or feature tests can follow file by file.

  • The files move from app/cdash/tests/case/CDash/... to tests/Legacy/..., dropping the redundant CDash directory, and get Tests\Legacy\... namespaces.
  • They're registered with add_laravel_test in the same dependency order as before, since several rely on database state left by earlier tests in the chain. The test that most legacy and browser tests wait for is now /Legacy/XmlHandler/UpdateHandlerTest.
  • add_legacy_unit_test and app/cdash/tests/bootstrap.php are removed. The bootstrap only added app/cdash to the include path, which none of the tests needs.
  • The check for unregistered test files now covers tests/Legacy. That turned up DynamicAnalysisUseCaseTest, which was never registered and so never ran. It's registered now, and it passes.
  • PHPUnitTestTest is deleted, since it only checked that the autoloader can load a model.

The PHPUnit tests in `app/cdash/tests/case` had their own CTest helper and bootstrap file. This PR moves them to `tests/Legacy`, next to the other test directories, so they're registered and run like every other test there. The tests themselves are unchanged apart from namespaces and imports. Converting them into proper unit or feature tests can follow file by file.

- The files move from `app/cdash/tests/case/CDash/...` to `tests/Legacy/...`, dropping the redundant `CDash` directory, and get `Tests\Legacy\...` namespaces.
- They're registered with `add_laravel_test` in the same dependency order as before, since several rely on database state left by earlier tests in the chain. The test that most legacy and browser tests wait for is now `/Legacy/XmlHandler/UpdateHandlerTest`.
- `add_legacy_unit_test` and `app/cdash/tests/bootstrap.php` are removed. The bootstrap only added `app/cdash` to the include path, which none of the tests needs.
- The check for unregistered test files now covers `tests/Legacy`. That turned up `DynamicAnalysisUseCaseTest`, which was never registered and so never ran. It's registered now, and it passes.
- `PHPUnitTestTest` is deleted, since it only checked that the autoloader can load a model.
@josephsnyder
josephsnyder added this pull request to the merge queue Nov 24, 2026
Merged via the queue into Kitware:master with commit 38e2db1 Nov 24, 2026
8 checks passed
@williamjallen
williamjallen deleted the move-legacy-unit-tests branch November 26, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants