Refactor test namespaces.#1789
Merged
aaronweeden merged 6 commits intoubccr:xdmod11.0from Dec 5, 2023
Merged
Conversation
66e7ffd to
6fd09bf
Compare
3 tasks
0a0a517 to
2b6420b
Compare
This was referenced Oct 20, 2023
eiffel777
previously approved these changes
Nov 28, 2023
2b6420b to
50046e7
Compare
eiffel777
previously approved these changes
Dec 5, 2023
50046e7 to
e4e3ea3
Compare
e4e3ea3 to
9638748
Compare
9638748 to
2ccff49
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes the unit, component, integration, and regression tests consistently follow the PSR-4-autoloader standard whereby each namespace prefix (
{Unit|Component|Integration|Regression}Tests) corresponds to a base directory (tests/{unit|component|integration|regression}/lib), and the sub-namespaces correspond to subdirectories, with namespace separators corresponding to directory separators. For example, the class inintegration/lib/TestHarness/XdmodTestHelper.phpshould have the namespaceIntegrationTests\TestHarness.This PR also makes the
tests/{unit,component,integration,regression}/bootstrap.phpfiles:/instead ofDIRECTORY_SEPARATORinstead of inconsistently using one or the other.tests/integration/libdirectory if a class wasn't found in their ownlibdirectory.This PR also removes
@packageand@subpackagecomments, since these are used inconsistently.This PR also adds
usestatements in a few cases rather than invoking classes via their fully qualified names.There are also PRs for ubccr/xdmod-supremm#355 and ubccr/xdmod-appkernels#98.
Motivation and Context
The goal is to make the code cleaner and more consistent.
Tests performed
To make sure the namespaces are consistent with their directory paths, I ran this and confirmed it produced no output:
To make sure the changes in this PR don't affect the tests that are run, I did the following in a Docker container running
tools-ext-01.ccr.xdmod.org/xdmod-10.5.0-x86_64:rockylinux8.5-0.3:/unit-{before,after}.txtand make sure the only differences are namespace names, user hashes, and amount of time the tests ran./component-{before,after}.txtand make sure the only differences are namespace names, test name hashes, and amount of time the tests ran./regression-{before,after}.txtand make sure the only differences are namespace names and amount of time the tests ran./integration-{before,after}.txtand make sure the only differences are namespace names, random values forControllerTest::testEnumTargetAddresses, and amount of time the tests ran.Checklist: