Skip to content

ci: gate staging on extension tests (+ build-time caching)#205

Merged
cooper667 merged 5 commits into
ckan211-prod-deploy-prfrom
ci/gate-staging-on-extension-tests
May 29, 2026
Merged

ci: gate staging on extension tests (+ build-time caching)#205
cooper667 merged 5 commits into
ckan211-prod-deploy-prfrom
ci/gate-staging-on-extension-tests

Conversation

@cooper667
Copy link
Copy Markdown

Re-adds the CKAN extension test suite that died with the Jenkins pipeline, as a test job in build-deploy.yml.

What runs

  • On PRs (this): only the test job — brings up the docker-compose dev stack via adx and runs the 5 Fjelltopp suites (unaids, validation, scheming, dhis2harvester, emailasusername). No build/deploy.
  • On push to master / ckan211-prod-deploy-pr: test → build → deploy; a test failure blocks both.
  • Redeploy (workflow_dispatch + image_tag): tests skipped (image already tested).

Build-time caching

  • .adxvenv keyed on Pipfile.lock — the dominant cost is bootstrap's pipenv sync --dev, not the image build.
  • unaids React node_modules keyed on its yarn.lock.
  • Both safe on miss, so this first run is a clean cold signal.

Status

Wiring verified (YAML, job graph, test paths). The 5 suites are not yet proven green under CKAN 2.11/Py3.10 — this PR run is the proof. Once green, merging makes it a deploy gate.

cooper667 added 5 commits May 29, 2026 12:31
Re-adds the CKAN extension tests that died with the Jenkins pipeline,
now as a 'test' job in build-deploy.yml that build/deploy depend on.

Brings up the docker-compose dev stack (the same flow the old
ci_setup.sh/ci_test.sh drove via adx) on pinned submodule commits and
runs the 5 Fjelltopp suites:
  unaids, validation, scheming, dhis2harvester, emailasusername

Gate semantics:
- push: tests must pass before build and deploy run
- redeploy (workflow_dispatch + image_tag): tests skipped, image
  already tested when built
- test failure blocks both build and deploy

Tests run against the dev image + bind-mounted submodules, matching
local 'adx test'. Not yet verified green under CKAN 2.11/Py3.10.
- Add pull_request trigger so the extension-test job runs as a visible
  status check; build/deploy stay gated off pull_request events.
- Cache .adxvenv on Pipfile.lock — the dominant cost is bootstrap's
  'pipenv sync --dev' (CKAN + ~19 extensions), not the image build.
- Cache the unaids React node_modules on its yarn.lock.

Both caches are safe on miss, so the first run is a clean cold signal.
- Run all 5 extension suites and aggregate, so one run reports the full
  picture instead of stopping at the first failing suite.
- Split cache restore/save so .adxvenv and node_modules are saved even
  when tests fail, making triage runs warm instead of cold.
- Add 'mock' and 'pyfakefs' to dev-packages: ckanext-validation,
  -scheming and -emailasusername import the standalone 'mock' package
  (and pyfakefs in validation), which weren't installed, causing
  pytest collection errors. Dev-only — prod uses 'pipenv sync' without
  --dev, so these don't ship.
- run_tests: blank CKAN_SMTP_SERVER for test runs so suites never reach
  the dev stack's smtp4dev. Fixes ckanext-unaids'
  test_send_dataset_transfer_emails_errors, which asserts mail sending
  fails when no server is configured.
The validation/unaids extensions pin frictionless[ckan]==5.13.1 and
pyfakefs==4.6.* in their own requirements and pass their own CI against
those. Our merged Pipfile had frictionless>=5.0.0,<6.0.0 (drifted to a
newer 5.x that dropped Resource.__create__) and pyfakefs=* (6.x dropped
the CreateFile API), so ckanext-validation's test suite failed in our
stack only. Aligning the pins fixes it without touching the submodule;
frictionless is prod-facing but this matches the version the extensions
are built and tested against.
@cooper667 cooper667 merged commit 99a3046 into ckan211-prod-deploy-pr May 29, 2026
3 checks passed
@cooper667 cooper667 deleted the ci/gate-staging-on-extension-tests branch May 29, 2026 20:44
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