Repository navigation
Read the _51DEGREES_ names for the demo's key and endpoint, before the older ones - #35
Merged
Merged
Conversation
…e older ones The suite read the demo's resource key from 51DEGREES_RESOURCE_KEY and then _51DEGREES_RESOURCE_KEY_51DID, and its cloud endpoint only from 51DEGREES_CLOUD_ENDPOINT. A job that set only _51DEGREES_RESOURCE_KEY and _51DEGREES_CLOUD_ENDPOINT therefore had every browser test skip as not configured, and still passed. The key is now read from _51DEGREES_RESOURCE_KEY, then the CI name _51DEGREES_RESOURCE_KEY_51DID, then the older 51DEGREES_RESOURCE_KEY. The endpoint is read from _51DEGREES_CLOUD_ENDPOINT, then the older 51DEGREES_CLOUD_ENDPOINT. Every current name comes before any older one, which is the order the .NET demo reads its own names in, and a value taken from an older name is reported once on the error stream with a sentence naming the name that replaces it. RequireFirst had no other caller, so RequireCurrentOrOld replaces it. The settings tests cover each order and the deprecation sentence, and the harness messages, comments and both READMEs name the current names.
…urrent names start with an underscore NoEndpointNameSet_TheFailureNamesBoth pins the message when neither endpoint name is set, so the category's README now counts seven settings tests. The TestConfig comment said every name starts with an underscore, which the two older ones do not, and the Demo.cs summary line is wrapped near 80 columns.
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.
The problem
TestConfigread the demo's resource key from51DEGREES_RESOURCE_KEYand then_51DEGREES_RESOURCE_KEY_51DID, and its cloud endpoint only from51DEGREES_CLOUD_ENDPOINT(TestsCommon/TestConfig.cslines 33 to 51 on this pull request's base). It never read_51DEGREES_RESOURCE_KEYor_51DEGREES_CLOUD_ENDPOINT, which has two effects._51DEGREES_names gets everyBrowser51Didtest reported inconclusive as not configured, and the run still passes._51DEGREES_name, the CI name included, before any older name (Settings.FromEnvironment, lines 130 to 160).Both were found in review of #32, and neither is caused by it.
The change
_51DEGREES_RESOURCE_KEY, then_51DEGREES_RESOURCE_KEY_51DID, then the older51DEGREES_RESOURCE_KEY._51DEGREES_CLOUD_ENDPOINT, then the older51DEGREES_CLOUD_ENDPOINT.The environment variable 51DEGREES_RESOURCE_KEY is deprecated and _51DEGREES_RESOURCE_KEY replaces it. Set _51DEGREES_RESOURCE_KEY to the same value instead.The value itself never appears.RequireCurrentOrOldreplacesRequireFirst, which had no other caller.DemoSettingsTestshas seven tests, covering each order of the key's three names and the endpoint's two, the deprecation sentence, and the failure message where no name is set, for the key and for the endpoint.README.mdandBrowser51Did/README.mdname the current names, and the example command sets them directly, since a name that starts with an underscore can be exported in bash.The order follows the rule the .NET packages use for a renamed environment variable. Every
_51DEGREES_name is tried before any old name, and the old name is still read for at least one release, deprecated and pointing at the new one (51degrees-dotnet #144).Note for anyone running the suite
A job that sets both an older name and a current name, meaning different keys, gets the current name's key once it takes a suite release with this change. Such a job should set the
_51DEGREES_names to the key and endpoint it means first.How it was checked
Browser51Didcategory with the example and contract settings tests ran 44, of which 29 passed and 15 skipped, the skips being the browser tests with no cloud configured. Their message now names both endpoint names in the order they are read.DemoSettingsTestspass by name:AllThreeKeyNamesSet_TheRuntimeNameWins,CiAndOldKeyNamesSet_TheCiNameWins,OnlyTheOldKeyNameSet_ItIsReadAndReported,NoKeyNameSet_TheFailureNamesAllThree,BothEndpointNamesSet_TheRuntimeNameWins,OnlyTheOldEndpointNameSet_ItIsReadAndReportedandNoEndpointNameSet_TheFailureNamesBoth.Browser51Didcategory ran twice against the cloud service over HTTPS, with only_51DEGREES_RESOURCE_KEYand_51DEGREES_CLOUD_ENDPOINTset and both older names taken out of the environment. The shared choice tests were left out, because this branch does not carry their wait (Wait for the shared store read in the shared choice test #29). Each time 24 of the 25 results passed and none reported the harness as not configured. The other one wasIsGdpr_ReadFromTheClientScript_SetsGdprApplies, which reports inconclusive with its own reason, that the client script's object carries noisgdprvalue yet.What remains
fix/demo-new-variable-names) because both change the same documentation lines. Retarget it torcbefore Start the .NET demo with the _51DEGREES_ names as well as the older ones #32 merges._51DEGREES_names first.