NASA-PDS / roundup-action

Do a "roundup", a/k/a PDS-style continuous integration and delivery
Apache License 2.0
1 stars 4 forks source link

As a continuous integrator, I'd like the Roundup Action to use the modern Python testing strategy #64

Closed nutjob4life closed 2 years ago

nutjob4life commented 2 years ago

As part of the Template Rollout Summer 2021, the pds-doi-service got the treatment that made it more like the pds-template-repo-python, complete with linting, code formatting, and the modern way of doing unit, functional, integration, user, acceptance, etc., tests.

However, this exposed a problem with the Roundup Action, which is making some assumptions about how testing should get done, namely that python setup.py test is sufficient.

It isn't anymore.

First, python setup.py test fails to install any of the development-dependencies in the package being tested—dependencies that the tests expect (such as flask_testing in this case). Second, python setup.py test is the old way of running tests in Python. Instead, tox should just be run.

But not all of the NASA-PDS software repositories are equipped to handle tox yet. Therefore, the Roundup Action should be adaptive to how it executes Python tests:

  1. First, the environment should use pip install --editable .[dev] to ensure test dependencies are installed.
  2. Next, the tox command should be invoked. If it succeeds, we can assume the tests were successful and there's no need to go to step-the-third.
  3. Step-the-third: tox failed or wasn't even found. In this case, fall back to python setup.py test.
jordanpadams commented 2 years ago

@nutjob4life how hard would it be to retrofit the DOI service to use tox vs. the effort to allow either? just want to get either of these fixed ASAP so we can easily tag / release the DOI Service. with test failures, it becomes a little more cumbersome/manual.

nutjob4life commented 2 years ago

The DOI service is already using tox.

To just get a release "out the door" we could copy the dev dependencies to install_require dependencies.

setup.cfg.diff.zip