Repository navigation
TEST: Run the 51Did and Human Confidence cloud tests against staging - #290
Merged
Merged
Conversation
For the 4.6.2 release the cloud 51Did tests ask the staging cloud, as the Human Confidence tests already do. Workflows: - Cloud 51Did sets _51DEGREES_CLOUD_ENDPOINT from vars.CLOUD_STAGING_ENDPOINT in both steps, and fails, naming each one, when a key, the license key or the endpoint is empty. - Cloud Human Confidence sets _51DEGREES_LICENSE_KEY from secrets._51DEGREES_LICENSE_KEY_BESPOKE, a License Key valid for Human Confidence, and requires it. Tests: - test_did_client_live: a page's call that requested HumanConfidence and was handed the browser tests gets no 51Did on its first answer. The browser creator context tests then make the 51Did with _51DEGREES_LICENSE_KEY_51DID alone, naming the 51Did Properties, and check the context from the same and from another browser as before. - test_cloud_humanconfidence_web: the example's passive call presents the Resource Key, which is the browser's route, so it gets a sealed result. A server's call with the License Key, requesting HumanConfidence with the visitor's ja4, h2 and client-ip, gets High, Medium or Low and the source Passive, and without those three gets no value and a reason. Unknown is no longer taken as a level.
…rkflows read The Cloud 51Did workflow now gives CLOUD_STAGING_ENDPOINT as _51DEGREES_CLOUD_ENDPOINT, and the Cloud Human Confidence step requires _51DEGREES_LICENSE_KEY, so the key name tests allow the first and give the step the second.
Collaborator
|
Merged into rc for the 4.6.2 release. The only failing check is the cloud available properties test, which fails because the CI resource key does not yet include the new ServiceWorkers property. Pull Requests run 46470818602 tested this head, 4942929, and every other test there passed. |
Rakesh51D
added a commit
that referenced
this pull request
Nov 30, 2026
Brings in #290, which runs the 51Did and Human Confidence cloud tests against the staging cloud, and #281, #282 and #288. Two test files conflicted, and both keep the tests rc runs on staging. - pipeline/fiftyone_pipeline_did/tests/test_did_client_live.py: the browser creator context test names the 51Did Properties on the page's Resource Key call, as this branch does. Where that first answer carries no 51Did because the call requested HumanConfidence and was handed the browser tests, it asks with the licence key alone, as rc does. Any other answer without a 51Did still fails. The client test's own call is rc's, which gets its 51Did on staging. - pipeline/fiftyone_pipeline_cloudrequestengine/examples/tests/ test_cloud_humanconfidence_web.py: rc's tests, with is_sealed using the package's is_blank, so a blank value is never a sealed result. Run locally on Python 3.12 with no keys: fiftyone_pipeline_did 343 passed and 8 skipped, the cloud request engine examples 99 passed and 32 skipped. The live and staging tests skip without keys, so the Cloud 51Did and Cloud Human Confidence checks prove them.
Merged
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.
Problem
For the 4.6.2 release the cloud 51Did tests test against the staging cloud, as the Human Confidence tests already do. Two checks fail:
test_passive_source_and_level_come_from_the_cloud(rc line 170, Human Confidence web example in client side and server side modes #271 line 180) asks through the example's passive call, which presents the Resource Key alone and sends no License Key. A call with a Resource Key alone is the browser's route, so the staging cloud seals HumanConfidence, and the assertion that the answer is a level failed on the sealed result. rc's test also tookUnknownas a level, and HumanConfidence is only High, Medium or Low.vars._51DEGREES_CLOUD_ENDPOINT, the production cloud. Moved to staging,BrowserCreatorContextLiveTestsfails on rc as it stands, because the_51DEGREES_RESOURCE_KEY_51DIDkey carries HumanConfidence and the staging cloud gives a page's call that requested HumanConfidence and was handed the browser tests no 51Did on its first answer. Naming the 51Did Properties invaluesdoes not change that for a Resource Key call on staging, which I checked.What changed
Workflows:
.github/workflows/cloud-51did.ymlsets_51DEGREES_CLOUD_ENDPOINTfromvars.CLOUD_STAGING_ENDPOINTin both steps. Each step fails, naming each empty name and the secret or variable it comes from, because a secret that does not exist reaches the step as an empty value..github/workflows/cloud-human-confidence.ymlsets_51DEGREES_LICENSE_KEYfromsecrets._51DEGREES_LICENSE_KEY_BESPOKEand requires it with the other names.ci/key-names.Tests.ps1allowsvars.CLOUD_STAGING_ENDPOINTin the Cloud 51Did workflow, only as_51DEGREES_CLOUD_ENDPOINT, gives the Human Confidence step_51DEGREES_LICENSE_KEYand checks the step fails when it is empty.Tests:
pipeline/fiftyone_pipeline_did/tests/test_did_client_live.py: where the page's first answer carries no 51Did and the call requested HumanConfidence and was handed the browser tests,createmakes the 51Did with_51DEGREES_LICENSE_KEY_51DIDalone, in theX-51D-License-Keyheader, namingFODiD.IdProbGlobalandFODiD.IdProbLic. The creator context is then checked from the same browser (verified) and from another (a mismatch naming all nine factors), as before. Any other answer without a 51Did still fails.pipeline/fiftyone_pipeline_cloudrequestengine/examples/tests/test_cloud_humanconfidence_web.py:test_passive_call_with_the_resource_key_gets_a_sealed_resultreplacestest_passive_source_and_level_come_from_the_cloud, and expects a sealed result, with the source Passive or none.test_a_servers_call_with_the_visitors_values_gets_a_levelposts to the stagingjsonendpoint with the License Key alone in the body,values=derived.humanconfidence,derived.humanconfidencesource, and the visitor'sja4,h2andclient-ip. It expects High, Medium or Low and the source Passive.test_a_servers_call_without_the_visitors_values_gets_no_valuemakes the same call without those three and expects no value and a reason.LEVELSis High, Medium and Low. No other test in the repository takesUnknownas a HumanConfidence value.Keys, checked on the staging cloud
Checked by name, with the values read from the environment and never printed:
/api/v4/accessiblepropertieson staging resolves_51DEGREES_RESOURCE_KEY_51DID,_51DEGREES_RESOURCE_KEY_BASICandRESOURCE_KEY_BESPOKE_STAGING.ja4,h2andclient-ip,_51DEGREES_LICENSE_KEY_BESPOKEalone gets a level with the source Passive._51DEGREES_LICENSE_KEY_51DIDgets "HumanConfidence is a paid feature", so it is not valid for Human Confidence, and the Human Confidence tests use the Bespoke one._51DEGREES_LICENSE_KEY_51DIDalone, naming the 51Did Properties, gets a 51Did, and that 51Did redeems as verified from the same browser and as a mismatch from another.All the organization secrets and the variable used here exist.
Verification
Run locally against
https://cloud-staging.51degrees.com/api/v4/with the same names:pytest tests/test_did_client_live.py tests/test_did_tier_live.pyinpipeline/fiftyone_pipeline_did: 8 passed. The same 8 pass against the production cloud.pytest -m staginginpipeline/fiftyone_pipeline_cloudrequestengine/examples: 4 passed.ci/check-environment-variable-names.ps1: passes.Outstanding
test_cloud_humanconfidence_web.pyand will conflict with this. Itstest_passive_source_and_level_come_from_the_cloudstill expects a level from the example's passive call, which presents the Resource Key alone, so it fails on staging until the test expects a sealed result or the example's passive call becomes a server's call with a License Key valid for Human Confidence and the visitor'sja4,h2andclient-ip.