Run Python extension tests (pytest) in CI

Aperta
#492 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
50/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
github-actions, python
Ambito
ci-cd, testing

Direzione di ricerca

Start with the R testthat step in the simple-extensions job of .github/workflows/extensions.yml and copy its conditional pattern for a Python step. Read each extension's manifest.json for the Python version and its requirements.txt for dependencies, then check that pytest passes in content-health-monitor and bundle-storage-report. Done means the step runs only when Python tests exist and a failure blocks packaging. The open question about a shared action needs a maintainer decision first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement github_actions

Python extensions can ship pytest tests, but no workflow runs them, so a failing test never blocks packaging or release.

The simple-extensions job in .github/workflows/extensions.yml already runs R testthat tests when an extension has tests/testthat/*.R. It has no matching step for Python. The custom workflows (usage-metrics-dashboard, runtime-version-scanner, and others) run only R tests too.

Two extensions currently have Python tests that CI never runs:

  • content-health-monitor: test_content_health_utils.py and test_integration.py, which mock the Connect client.
  • bundle-storage-report (#489): test_storage_utils.py.
Proposal

Add a step to simple-extensions, next to the R tests, that runs only when the extension has Python tests (for example hashFiles('extensions/<ext>/test_*.py', 'extensions/<ext>/tests/**/*.py') != ''). It would:

  1. Set up the Python version from the extension's manifest.json.
  2. Install the extension's requirements.txt plus pytest, so tests run against the versions the extension ships with.
  3. Run pytest in the extension directory, so a failure stops packaging and release, as the R step does.

These tests need no Connect server, so they belong in this job rather than in the integration suite. The integration suite only checks that each extension deploys (integration/tests/posit/connect/test_deployments.py).

Open question

Should the custom workflows get the same step, or should a shared action handle it for both?

Lingua principale
R
Stelle
10
Fork
8
Merge medio
9h 43m
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di posit-dev/connect-extensions

Tutte le issue di posit-dev/connect-extensions

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.