Browse Source

Add --full flag to invoke test

This is simpler than needing to know that --html-validation is the flag
to use to make sure that all tests are run, and can stay constant even
if we add other types of excluded-by-default tests in the future.
merge-requests/126/merge
Deimos 4 years ago
parent
commit
9652dfb722
  1. 2
      git_hooks/pre-push
  2. 12
      tildes/tasks.py

2
git_hooks/pre-push

@ -3,4 +3,4 @@
# Pre-push hook script that ensures all tests and code checks pass # Pre-push hook script that ensures all tests and code checks pass
vagrant ssh -c ". activate \ vagrant ssh -c ". activate \
&& invoke type-checking test --quiet --html-validation check-code-style --full"
&& invoke type-checking test --quiet --full check-code-style --full"

12
tildes/tasks.py

@ -39,12 +39,13 @@ def check_code_style(context, full=False):
@task( @task(
help={ help={
"full": "Include all tests",
"html-validation": "Include HTML validation (very slow, includes webtests)", "html-validation": "Include HTML validation (very slow, includes webtests)",
"quiet": "Reduce verbosity", "quiet": "Reduce verbosity",
"webtests": "Include webtests (a little slow)", "webtests": "Include webtests (a little slow)",
} }
) )
def test(context, quiet=False, webtests=False, html_validation=False):
def test(context, full=False, quiet=False, webtests=False, html_validation=False):
"""Run the tests. """Run the tests.
By default, webtests (ones that make actual HTTP requests to the app) and HTML By default, webtests (ones that make actual HTTP requests to the app) and HTML
@ -58,10 +59,11 @@ def test(context, quiet=False, webtests=False, html_validation=False):
pytest_args = [] pytest_args = []
excluded_markers = [] excluded_markers = []
if not webtests:
excluded_markers.append("webtest")
if not html_validation:
excluded_markers.append("html_validation")
if not full:
if not webtests:
excluded_markers.append("webtest")
if not html_validation:
excluded_markers.append("html_validation")
if excluded_markers: if excluded_markers:
excluded_marker_str = " or ".join(excluded_markers) excluded_marker_str = " or ".join(excluded_markers)

Loading…
Cancel
Save