Skip to content

TEST: Run the 51Did and Human Confidence cloud tests against staging - #290

Merged
Rakesh51D merged 2 commits into
rcfrom
ci/cloud-tests-on-staging
Nov 30, 2026
Merged

Rakesh51D merged 2 commits into
rcfrom
ci/cloud-tests-on-staging

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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:

  1. Cloud Human Confidence on rc itself, so on the release pull request Release candidate #240 (job log), and on Human Confidence web example in client side and server side modes #271 (job log). Both runs used the staging cloud. 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 took Unknown as a level, and HumanConfidence is only High, Medium or Low.
  2. Cloud 51Did reads vars._51DEGREES_CLOUD_ENDPOINT, the production cloud. Moved to staging, BrowserCreatorContextLiveTests fails on rc as it stands, because the _51DEGREES_RESOURCE_KEY_51DID key 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 in values does not change that for a Resource Key call on staging, which I checked.

What changed

Workflows:

  • .github/workflows/cloud-51did.yml sets _51DEGREES_CLOUD_ENDPOINT from vars.CLOUD_STAGING_ENDPOINT in 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.yml sets _51DEGREES_LICENSE_KEY from secrets._51DEGREES_LICENSE_KEY_BESPOKE and requires it with the other names.
  • ci/key-names.Tests.ps1 allows vars.CLOUD_STAGING_ENDPOINT in the Cloud 51Did workflow, only as _51DEGREES_CLOUD_ENDPOINT, gives the Human Confidence step _51DEGREES_LICENSE_KEY and 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, create makes the 51Did with _51DEGREES_LICENSE_KEY_51DID alone, in the X-51D-License-Key header, naming FODiD.IdProbGlobal and FODiD.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_result replaces test_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_level posts to the staging json endpoint with the License Key alone in the body, values=derived.humanconfidence,derived.humanconfidencesource, and the visitor's ja4, h2 and client-ip. It expects High, Medium or Low and the source Passive.
    • test_a_servers_call_without_the_visitors_values_gets_no_value makes the same call without those three and expects no value and a reason.
    • LEVELS is High, Medium and Low. No other test in the repository takes Unknown as a HumanConfidence value.

Keys, checked on the staging cloud

Checked by name, with the values read from the environment and never printed:

  • /api/v4/accessibleproperties on staging resolves _51DEGREES_RESOURCE_KEY_51DID, _51DEGREES_RESOURCE_KEY_BASIC and RESOURCE_KEY_BESPOKE_STAGING.
  • With ja4, h2 and client-ip, _51DEGREES_LICENSE_KEY_BESPOKE alone gets a level with the source Passive. _51DEGREES_LICENSE_KEY_51DID gets "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_51DID alone, 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.py in pipeline/fiftyone_pipeline_did: 8 passed. The same 8 pass against the production cloud.
  • pytest -m staging in pipeline/fiftyone_pipeline_cloudrequestengine/examples: 4 passed.
  • ci/check-environment-variable-names.ps1: passes.

Outstanding

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.
@jwrosewell
jwrosewell marked this pull request as ready for review November 30, 2026 16:58
@Rakesh51D
Rakesh51D merged commit 61def98 into rc Nov 30, 2026
7 checks passed
@Rakesh51D
Rakesh51D deleted the ci/cloud-tests-on-staging branch November 30, 2026 17:56
@Rakesh51D

Copy link
Copy Markdown
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.
@Rakesh51D Rakesh51D mentioned this pull request Nov 30, 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.

2 participants