Add integration tests of invalid REST floating point and Boolean parameters. #1796
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 adds the ability to test for invalid REST floating point and Boolean parameters using the existing method
IntegrationTests\BaseTest::provideRestEndpointTests()
.This PR also adds an exception to that method if an option is provided that is unrecognized. This is to help with development of new tests that use the method by helping catching typos in option names.
Motivation and Context
The main
xdmod
module has no calls to the methodsgetFloatParam()
andgetBooleanParam()
fromRest\Controllers\BaseControllerProvider
, but thexdmod-appkernels
module does. ubccr/xdmod-appkernels#95 adds tests of invalid floating point and Boolean parameters that will use the changes in this PR.Tests performed
To make sure this didn't cause any changes in the tests that are run, in a Docker container running
tools-ext-01.ccr.xdmod.org/xdmod-10.5.0-x86_64:rockylinux8.5-0.3
:/unit-{before,after}.txt
and make sure the only differences are namespace names, user hashes, and amount of time the tests ran./component-{before,after}.txt
and make sure the only differences are namespace names, test name hashes, and amount of time the tests ran./regression-{before,after}.txt-sorted
and make sure the only differences are namespace names, amount of time the tests ran, and possibly transient "other notices" related to small differences in column values./integration-{before,after}.txt
and make sure the only differences are namespace names, random values forControllerTest::testEnumTargetAddresses
, and amount of time the tests ran.I also manually tested to make sure the
InvalidArgumentException
can be properly thrown by changing a call toprovideRestEndpointTests
to have an invalid argument key.Checklist: