Skip to content

BUILD: Say when no staging test ran, and run the staging tests for the files they use - #278

Merged
jwrosewell merged 2 commits into
rcfrom
test/hc-source-null-reason
Nov 24, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
test/hc-source-null-reason

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

This follows #277, which moved the two Human Confidence source tests to the staging cloud and merged into rc as ebfffba. A review of #277 at its last head, cbf04fe, raised the points below, and #277 merged before they were made there.

What changes

  1. A run that selects no test. pytest exits 5 when it selects no test. The step in .github/workflows/cloud-human-confidence.yml stopped on that exit code with no message, so its check of the junit report for a run with no tests could never be reached. The step now writes No staging test ran when pytest exits 5, and the unreachable check is gone. In ci/key-names.Tests.ps1 the stand-in for pytest now takes the exit code to give, and gives 5 in the case where no test ran. A new case checks that a failed test fails the step with pytest's own exit code.
  2. Paths. The workflow's pull_request paths now also cover the files the staging tests import, examples/tests/live_cloud.py and examples/src/fiftyone_pipeline_examples/example_utils.py, and the files the install step uses, the examples' pyproject.toml, ci/write-package-versions.ps1, ci/packages.ps1 and ci/packages.json. Before, a pull request that changed only one of those did not run the staging tests.
  3. A test of the paths. A new case in ci/key-names.Tests.ps1, under "The cloud tests", reads the workflow's pull_request paths and checks that each one without a wildcard is a file in the checkout.

What #271 and #274 need

#271 (head 8357555) and #274 (head 34ea559, stacked on #271's branch) each conflict with rc in pipeline/fiftyone_pipeline_cloudrequestengine/examples/tests/test_cloud_humanconfidence_web.py and nowhere else, checked with git merge-tree against rc at ebfffba. #277 merged first, so when they are brought up to date with rc they must do the following. This pull request does not touch their branches.

  1. Keep the staging fixtures, the two staging tests and the list of answers that naming_the_properties returns, merged with Human Confidence web example in client side and server side modes #271's change to that fixture to match an address ending in ?. Human Confidence web example in client side and server side modes #271's test_passive_level_comes_from_the_cloud and test_a_basic_key_gets_a_passive_level can stay beside them on production, because they accept Unknown and check no source.
  2. test_cloud_humanconfidence_web_offline.py calls the Basic test directly to check its skip message. On rc it calls test_a_basic_key_gets_no_source, and in Human Confidence web example in client side and server side modes #271 and FIX: Redeem a sealed Human Confidence value in the cloud request engine #274 it calls test_a_basic_key_gets_a_passive_level, so after the merge it must call one that still exists.
  3. Mark staging, and run on a client built from the staging names, every test that reaches the Human Confidence redeem or expects HumanConfidenceSource. Those are the License Key test while it posts a value to the cloud (to /redeem in Human Confidence web example in client side and server side modes #271, and through post_unsealed to /active in FIX: Redeem a sealed Human Confidence value in the cloud request engine #274), FIX: Redeem a sealed Human Confidence value in the cloud request engine #274's test_a_value_that_does_not_redeem_gives_active_low, and both tests in FIX: Redeem a sealed Human Confidence value in the cloud request engine #274's pipeline/fiftyone_pipeline_cloudrequestengine/tests/test_human_confidence_live.py. Against production these expect a source that the production cloud does not serve yet.
  4. For FIX: Redeem a sealed Human Confidence value in the cloud request engine #274's test_a_request_without_a_sealed_value_gives_a_passive_level, the package test that expects the source Passive, do all of these.
    • Mark it staging and register the marker in pipeline/fiftyone_pipeline_cloudrequestengine/tests/conftest.py, whose pytest_configure registers only live.
    • Build its engine from CLOUD_STAGING_ENDPOINT (as cloud_endpoint) and RESOURCE_KEY_BESPOKE_STAGING, never from _51DEGREES_CLOUD_ENDPOINT or a default address, and skip naming the variable when either is not set.
    • Give the engine requested_properties of derived.humanconfidence,derived.humanconfidencesource. The staging Bespoke key's accessibleproperties lists HumanConfidence under derived and not HumanConfidenceSource. Through rc's engine with that key and no requested properties, the staging cloud's derived held only humanconfidence, and with the two properties named it held humanconfidencesource as well, so without them the test fails on staging. The example tests name the same two properties through naming_the_properties.
    • Let it run without _51DEGREES_LICENSE_KEY_BESPOKE. The class it is in skips without that License Key, the passive call needs none, and the workflow sets no License Key and fails on a skipped test.
    • Add a second -m staging run of pipeline/fiftyone_pipeline_cloudrequestengine/tests to .github/workflows/cloud-human-confidence.yml, with the same checks for an empty name, a skipped test and a run that selects no test, and add that folder to the workflow's pull_request paths. This pull request does not add that run now, because that folder has no staging test yet and pytest exits 5 when it selects none, so the run would fail every time.
  5. Decide which License Key the redeem tests send on staging, because no CI name holds one for the staging cloud. Those are test_a_sealed_value_that_does_not_redeem_gives_low_and_active in the package file and the two example tests in item 3. Until that is decided they cannot run in the staging workflow.

If #274 merges before this pull request, this one is brought up to date with it and the exit code 5 check goes into each run of the step.

How it was checked

Run locally on Windows with Python 3.12 in a virtual environment, with the packages installed editable after ci/write-package-versions.ps1. The names were set in the process environment only.

  1. Staging, from pipeline/fiftyone_pipeline_cloudrequestengine/examples with CLOUD_STAGING_ENDPOINT, RESOURCE_KEY_BESPOKE_STAGING and _51DEGREES_RESOURCE_KEY_BASIC set, python -m pytest -m staging -v -rs gave 2 passed, 112 deselected.
  2. The workflow's test step script, taken from the workflow as written and run with real pytest. In the examples folder with the three names set, it ran both staging tests (2 passed, 112 deselected) and exited 0. In a folder holding no tests, pytest gave no tests ran, and the step wrote ::error::No staging test ran. and exited 1.
  3. ci/key-names.Tests.ps1 and ci/check-environment-variable-names.Tests.ps1 gave 227 passed, 0 failed, with all 7 cases of the Cloud Human Confidence step passing. ./ci/check-environment-variable-names.ps1 passed.
  4. Every ci/*.Tests.ps1 together gave 446 passed and 1 failed. The failure is The integration test step as common-ci runs it in ci/common-ci-options.Tests.ps1, which lays out a common-ci checkout that has its own python folder and puts this repository inside it under its folder name. The local clone's folder is named python, so ./python/ci/run-integration-tests.ps1 was not found. That file is unchanged here, and on GitHub the checkout folder is named 51degrees-python.
  5. For item 4 of the section above, the staging key's accessibleproperties and two requests through rc's engine with that key, one with no requested properties and one naming the two properties, as described there.
  6. ci/key-names.Tests.ps1 alone, Pester 6.2.0 on Windows, at the second commit: 148 passed, 0 failed. With ci/packages.json written under another name in the workflow, the new case failed, and it passes on the real file.
  7. On this pull request at c694f39, Cloud Human Confidence Tests run 45288229034 gave 2 passed, 112 deselected, and CI script tests run 45288228792 gave 447 passed, 0 failed on both Ubuntu and Windows, which includes the file that failed locally on the folder name. Environment variable names, UTM link lint and Only rc into main also passed.

…e files they use

pytest exits 5 when it selects no test, so the Cloud Human Confidence step
stopped on that exit code with no message, and its check of the junit
report for a run with no tests could never be reached. The step now writes
"No staging test ran" when pytest exits 5, and the unreachable check is
gone. The Pester stand-in for pytest now takes the exit code to give, and
gives 5 in the case where no test ran. A new case checks that a failed test
fails the step with pytest's own exit code.

The workflow's pull_request paths now also cover the files the staging
tests import, tests/live_cloud.py and example_utils.py, and the files the
install step uses, the examples' pyproject.toml, ci/write-package-versions.ps1
and ci/packages.ps1. A pull request that changes only one of those now runs
the staging tests as well.
cloud-human-confidence.yml runs for a pull request that changes one of
its pull_request paths. A new case in ci/key-names.Tests.ps1 reads
those paths and checks that each one without a wildcard is a file in
the checkout. The paths now include ci/packages.json, which the
install step reads through ci/write-package-versions.ps1.
@jwrosewell
jwrosewell marked this pull request as ready for review November 24, 2026 02:04
@jwrosewell
jwrosewell merged commit 6e5c98c into rc Nov 24, 2026
6 checks passed
@jwrosewell
jwrosewell deleted the test/hc-source-null-reason branch November 24, 2026 02:04
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