Skip to content

TEST: Check the Bespoke key's Human Confidence property and source first - #236

Merged
jwrosewell merged 4 commits into
rcfrom
test/human-confidence-real-value
Nov 24, 2026
Merged

jwrosewell merged 4 commits into
rcfrom
test/human-confidence-real-value

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Running each Human Confidence live test with its own key is now on rc (#237). Before it calls the example, the Bespoke live test now checks that the staging cloud lists HumanConfidence for its key, and answers HumanConfidenceSource as Passive when asked for it. A key that lacks either fails with a message naming the variable.

What changes

  • HumanConfidenceLiveTest.java:
    • The Bespoke test asks accessibleproperties for HumanConfidence only, matching names ignoring case. It fails naming RESOURCE_KEY_BESPOKE_STAGING and every missing property in one message, and a property list that isn't JSON fails naming the variable.
    • It then asks the service for HumanConfidenceSource with the key, and fails naming the variable when the answer is not Passive. The list isn't asked about the source, as the staging cloud serves the source to a request that names it without listing it.
    • The source and level messages name the variable too.
  • Three tests that need no network check how the list is read: missingPropertiesNamesOnlyThePropertiesNoProductLists, missingPropertiesIgnoresTheCaseOfTheNames and missingMessageNamesEveryMissingPropertyAndTheVariable.
  • examples/device-detection/web/human-confidence/README.md and the class comment say what the test checks first.

Tests

  • HumanConfidenceTest and HumanConfidenceLiveTest, compiled with JDK 1.8 javac (no warnings with -Xlint:all) and run with JUnit 4.13.2: 15 run, 0 failed, the two live tests skipped as no key was set.
  • Pester on Windows: 206 passed, 0 failed, 4 skipped.
  • Maven was not run locally.
  • In CI on this head, Cloud Human Confidence Tests ran 5 tests, two live on the staging cloud and three that need no network, with 0 failures and 0 skipped (run 45337445428).

HumanConfidenceLiveTest had one test that read _51DEGREES_RESOURCE_KEY
and took the source it expected from a system property, and the
workflow ran it once for each key. It skipped when the cloud service
did not list HumanConfidenceSource for the key.

There are now two tests. The Bespoke test reads
_51DEGREES_RESOURCE_KEY_BESPOKE and expects the source Passive and a
level of High, Medium or Low. The Basic test reads
_51DEGREES_RESOURCE_KEY_BASIC and expects no source. Each starts the
example with the key it checks. A test skips only when its own key is
not set, and fails when the answer lacks what it checks.

cloud-human-confidence.yml runs Maven once with both keys under their
own names. It fails when a key is empty, when no test ran, when Maven
fails or when a test was skipped. New Pester tests in
ci/workflow-keys.Tests.ps1 cover that step.
# Conflicts:
#	.github/workflows/cloud-human-confidence.yml
#	ci/README.md
#	ci/workflow-keys.Tests.ps1
#	examples/device-detection/web/human-confidence/README.md
#	examples/device-detection/web/human-confidence/src/test/java/fiftyone/devicedetection/examples/web/HumanConfidenceLiveTest.java
…first

The Bespoke live test now asks the staging cloud which properties the key
in RESOURCE_KEY_BESPOKE_STAGING includes before it calls the example. If
HumanConfidence or HumanConfidenceSource is not listed, the test fails and
names the variable and the property, so it is clear which key to change.
The source and level messages name the variable as well. A test that needs
no network checks how the list of properties is read.
@jwrosewell jwrosewell changed the title TEST: Run each Human Confidence live test with its own tier key TEST: Check the Bespoke key includes the Human Confidence properties first Nov 24, 2026
The Bespoke test asked the list of accessible properties for both
HumanConfidence and HumanConfidenceSource. The staging cloud serves the
source to a request that names it without listing it there, so the test
failed for a key the cloud does serve.

The list is now asked for HumanConfidence only, as in .NET and PHP. The
test then asks the service for HumanConfidenceSource with the key and
fails, naming the variable, when the answer is not Passive.

The list check also names every missing property in one failure, matches
names ignoring case, and fails naming the variable when the list is not
JSON. The README and the class comment say the same.
@jwrosewell jwrosewell changed the title TEST: Check the Bespoke key includes the Human Confidence properties first TEST: Check the Bespoke key's Human Confidence property and source first Nov 24, 2026
@jwrosewell
jwrosewell marked this pull request as ready for review November 24, 2026 06:24
@jwrosewell
jwrosewell merged commit d22baa1 into rc Nov 24, 2026
9 checks passed
@jwrosewell
jwrosewell deleted the test/human-confidence-real-value branch November 24, 2026 06:24
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