Repository navigation
Test GeoLocationCloud with a Resource Key that holds no location product - #116
Merged
Merged
Conversation
cloud-aspect-engine.md says a Resource Key with no product for a Cloud Aspect Engine does not fail the build, gives the engine empty data on each response with no error, and is logged once at warning level naming the Data Key. The IP Intelligence and Device Detection cloud engines had tests of this and GeoLocationCloud did not. The test replaces the cloud service, so it needs no key, and covers both location providers.
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.
Adds a test that
GeoLocationCloudbuilds and gives empty data, with no error, when the Resource Key holds no location product, and logs that once. #54 made every Cloud Aspect Engine here behave that way and tested it for IP Intelligence and Device Detection, and its body saidGeoLocationCloudhad no such test because none ran without a live service. This one replaces the cloud service, so it needs no key.What the specification says
cloud-aspect-engine.md, Start-up activity, at 6570727d:
and under Processing:
What changed
location/tests/MissingProductTests.php, added to location's Integration suite inlocation/phpunit.xml. It builds a Pipeline withGeoLocationPipelineBuilderand anHttpClientthat answers as the cloud service would for a Resource Key holding only a device product, once with the 51Degrees provider (Data Keylocation) and once with Digital Element (location_digitalelement). Each time it processes three requests with a latitude and longitude, and checks that no request has an error, that each gives empty location data, and that exactly one log entry names the Data Key, at warning level. No package code changes.Runs
Each throwaway run installs from the repository root and runs the test file alone, on Ubuntu with PHP 8.1 and 8.5 and on Windows with PHP 8.3. PHP 8.0 is left out because the root
composer.jsoncannot be installed there,fiftyone.pipeline.didneeding PHP 8.1.GeoLocationCloudthrew on each request before Build a Cloud Aspect Engine whose product is missing, and log the missing product once #54.rc36b71fd. Both cases passed, 16 assertions, with PHPUnit 10.5.67 on PHP 8.1, 13.4.7 on PHP 8.5 and 12.5.44 on Windows PHP 8.3. On PHP 8.5 PHPUnit also counted four deprecations, as it did in the red run on the older code, so they come from code the test reaches rather than from this change.rc49ea15c merged in, which holds #117 and its move ofcxxto 0312236c. The run printed 9 of 9Setting 'PullRequestSha'lines on 2856582, and Configure printed "Left out 5 macOS entries". All eight jobs passed, Ubuntu with PHP 7.4 and 8.0 to 8.5 and Windows with PHP 8.3. In the Ubuntu PHP 8.3 job, on ubuntu-26.04, the Unit suites passed 1,044 tests (pipeline/core 509 with 1 skipped, pipeline/engines 9, pipeline/cloudrequestengine 90, pipeline/did 192, pipeline/translation 22, pipeline/derivedproperty 52, device-detection/cloud 29, device-detection/onpremise 89 and ip-intelligence 52) and the Integration suites 134 (pipeline/cloudrequestengine 6, device-detection/cloud 36, location 18 and ip-intelligence 74).macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
What remains
Nothing for this test. The Cloud Request Engine still fetches what the Resource Key holds on the first request, not at build, until #128 moves that to the build, and #136 has each cloud aspect engine take its properties when it joins the Pipeline. Even with both, the missing product is logged only in
processInternal, on the first request, so the warning is written then, as #54 said. #146 tracks that warning.