Skip to content

Read the _51DEGREES_ names for the demo's key and endpoint, before the older ones - #35

Merged
jwrosewell merged 2 commits into
rcfrom
fix/suite-reads-underscore-names
Nov 16, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
fix/suite-reads-underscore-names

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The problem

TestConfig 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 (TestsCommon/TestConfig.cs lines 33 to 51 on this pull request's base). It never read _51DEGREES_RESOURCE_KEY or _51DEGREES_CLOUD_ENDPOINT, which has two effects.

  1. A job that sets only the _51DEGREES_ names gets every Browser51Did test reported inconclusive as not configured, and the run still passes.
  2. Where both the older key name and the CI name are set, the older name won. The .NET demo reads them the other way round, with every _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

  • The key is read from _51DEGREES_RESOURCE_KEY, then _51DEGREES_RESOURCE_KEY_51DID, then the older 51DEGREES_RESOURCE_KEY.
  • The endpoint is read from _51DEGREES_CLOUD_ENDPOINT, then the older 51DEGREES_CLOUD_ENDPOINT.
  • A value taken from an older name is reported once on the error stream, in the sentence the .NET packages use, for example 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.
  • RequireCurrentOrOld replaces RequireFirst, which had no other caller.
  • DemoSettingsTests has 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.
  • The harness's messages and comments, the root README.md and Browser51Did/README.md name 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

  • Locally at 643425c the build has no warnings. The Browser51Did category 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.
  • The seven DemoSettingsTests pass by name: AllThreeKeyNamesSet_TheRuntimeNameWins, CiAndOldKeyNamesSet_TheCiNameWins, OnlyTheOldKeyNameSet_ItIsReadAndReported, NoKeyNameSet_TheFailureNamesAllThree, BothEndpointNamesSet_TheRuntimeNameWins, OnlyTheOldEndpointNameSet_ItIsReadAndReported and NoEndpointNameSet_TheFailureNamesBoth.
  • At 15f46fc on 16 November, before the last commit, which adds a unit test and changes only comments and documentation, the Browser51Did category ran twice against the cloud service over HTTPS, with only _51DEGREES_RESOURCE_KEY and _51DEGREES_CLOUD_ENDPOINT set 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 was IsGdpr_ReadFromTheClientScript_SetsGdprApplies, which reports inconclusive with its own reason, that the client script's object carries no isgdpr value yet.

What remains

…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.
@jwrosewell
jwrosewell changed the base branch from fix/demo-new-variable-names to rc November 16, 2026 11:30
@jwrosewell
jwrosewell marked this pull request as ready for review November 16, 2026 11:31
@jwrosewell
jwrosewell merged commit 04afb0b into rc Nov 16, 2026
5 checks passed
@jwrosewell jwrosewell mentioned this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant