Refactor some of the integration tests.#1763
Merged
aaronweeden merged 2 commits intoubccr:xdmod11.0from Nov 7, 2023
Merged
Conversation
3 tasks
6 tasks
3cae043 to
e5f2cc6
Compare
e07ef18 to
546405f
Compare
546405f to
dd4bc45
Compare
92512b3 to
7a34c66
Compare
3 tasks
7a34c66 to
875a49b
Compare
ryanrath
reviewed
Nov 6, 2023
Contributor
ryanrath
left a comment
There was a problem hiding this comment.
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
Contributor
|
Lemme know what you think about the |
345670f to
653bb85
Compare
ryanrath
approved these changes
Nov 7, 2023
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 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: