cesium-ml / baselayer

Fully customizable (scientific, compute-intensive) web application template
http://cesium-ml.org/baselayer/
31 stars 18 forks source link

allow users to control which tests they run using make directives #188

Closed dannygoldstein closed 3 years ago

dannygoldstein commented 3 years ago

Currently when users call

make test

or

make test_headless

there is no way of specifying which tests to run; all tests are run. Recently it was requested that the new skyportal model tests be broken out to run in a separate CI job than the api and frontend tests to keep the runtime of CI down. In order to do this we need a way of specifying which tests to run in a make directive. This PR facilitates that by allowing users to specify a TEST_SPEC to the make test and make test_headless directives. E.g., to run only the api tests via make test, one could do

make test TEST_SPEC='skyportal/tests/api'

and only the API tests would run. If TEST_SPEC is not specified then the current behavior is recovered, i.e., all tests run.

pep8speaks commented 3 years ago

Hello @dannygoldstein! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 82:80: E501 line too long (95 > 79 characters)

stefanv commented 3 years ago

The way to run specific tests is via the test_frontend tool currently, as specified in the (SkyPortal) developer docs.

Make is annoying this way, in that it is hard to extract parameters (or you have to send them in with environment variables like you did here).

Is there a good reason why the tool cannot be invoked directly? Python is much more flexible than bash.

dannygoldstein commented 3 years ago

@stefanv you are absolutely right - that's a way better way to go. Doing it that way is possible without this PR and works fine (actually better as there are fewer escaping issues). Closing this PR in favor of that.