-
Notifications
You must be signed in to change notification settings - Fork 75
Refactor some of the integration tests. #1763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor some of the integration tests. #1763
Conversation
3cae043 to
e5f2cc6
Compare
e07ef18 to
546405f
Compare
546405f to
dd4bc45
Compare
92512b3 to
7a34c66
Compare
7a34c66 to
875a49b
Compare
ryanrath
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alrighty, just some comments with no actual show stoppers. It's mainly documentation & naming related w/ a sprinkling of possible gotchas ( some Exception namespace stuff ).
153ab61 to
345670f
Compare
|
Lemme know what you think about the |
345670f to
653bb85
Compare
Description
This PR refactors some of the existing integration tests (a further refactoring from #1706) to make integration tests easier to write and maintain. Specifically, it moves test data out of JSON test artifact files and into PHP associative arrays in the integration test code. This makes the test data simpler for developers to find, read, write, reuse, and debug, and it also speeds up the validation.
This PR also changes the API token authentication tests to only run for a single public user and a single non-public user, resulting in the integration test framework finishing faster.
Motivation and Context
There are many integration tests that involve making HTTP requests to an endpoint and validating the JSON response. This PR organizes similar code into functions to avoid repetition.
This PR serves as a base for #1788, #1765, ubccr/xdmod-appkernels#95, and ubccr/xdmod-supremm#350.
Tests performed
In a Docker container, as I refactored tests, I manually changed the covered code to make sure the test still tests that code.
Also, 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 user hashes and amount of time the tests ran./component-{before,after}.txtand make sure the only differences are test name hashes and amount of time the tests ran./regression-{before,after}.txtand make sure the only differences are the progress dots at the top and the amount of time the tests ran./integration-{before,after}.txtand make sure the differences are correct:ControllerTest::testEnumTargetAddresses./integration-after.txt, onlyusrtests for:MetricExplorerTest::testGetDwDescripterTokenAuth.MetricExplorerTest::testGetDimensionFilters— and also a singlevalid_tokentest each forcd,cs,usr,pi, andmgr.UsageExplorerTest::testGetDataTokenAuth.WarehouseControllerProviderTest::testGetRawData.WarehouseControllerProviderTest::testGetRawDataLimit.WarehouseExportControllerProviderTest::testGetRealmsTokenAuth.UserControllerProviderTest::testGetCurrentUserandWarehouseControllerProviderTest::testGetRawData.Checklist: