Enable branch coverage, upload test results and use Codecov OIDC

Abierto
#1,611 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@yamilmaud ya está trabajando en esto.

Desde el 27/11/2026.

  • #1612 de @yamilmaud — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
20/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
github-actions, python
Área
ci-cd, testing-qa

Línea de trabajo

The change touches pyproject.toml ([tool.coverage.run]), tox.ini ([testenv] pytest call), .github/workflows/main.yml (the codecov-action steps and job permissions), and a new .codecov.yml. Start by reading the workflow and the tox config, then check the reference pattern in scrapinghub/andi. Done means the four checks pass, but open PR #1612 already covers this work, so review it rather than starting a new change.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

dateparser is currently missing four checks tracked by the Zyte OSS maintenance report:

  • codecov-test-results: no codecov/codecov-action step with report_type: test_results
  • codecov-auth: expected OIDC, found a token in .github/workflows/main.yml
  • codecov-status: no Codecov config file
  • branch-coverage: no branch = true in coverage config, and no --cov-branch

Proposed changes

  1. pyproject.toml: add branch = true under [tool.coverage.run].
  2. tox.ini: add --junitxml=testenv.junit.xml -o junit_family=legacy to the pytest invocation in [testenv], so a JUnit XML report is produced to upload.
  3. New .codecov.yml: disable the patch status and set the project status target to the current coverage (not 100%, since dateparser's coverage isn't there yet), e.g.:
    coverage:
      status:
        project:
          default:
            target: <current coverage>%
        patch: false
    
  4. .github/workflows/main.yml:
    • add id-token: write to the job's permissions (needed for OIDC)
    • replace the token-based codecov/codecov-action step with one using use_oidc: true instead of token: ${{ secrets.CODECOV_TOKEN }}
    • add a second codecov/codecov-action step with report_type: test_results (and use_oidc: true) to upload the JUnit XML, gated on if: ${{ !cancelled() }}

scrapinghub/andi's .github/workflows/test.yml already implements this OIDC + test-results pattern for a sibling scrapinghub project and can be used as a reference. scrapy/cssselect#225 did the equivalent test-results + config-file work for a scrapy-org project (tokenless there, since OIDC is only required for the scrapinghub org).

Heads up

Open PR #1567 ("Support Python 3.11-3.15: drop 3.10, add 3.15") also modifies .github/workflows/main.yml, so expect a minor merge conflict between the two.

Lenguaje dominante
Python
Estrellas
2.9k
Forks
545
Merge medio
2 d 4 h
PR fusionados (30 d)
17

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de scrapinghub/dateparser

Todos los issues de scrapinghub/dateparser

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.