зеркало из https://github.com/mozilla/treeherder.git
made the long test only run if '--runslow' option is used
This commit is contained in:
Родитель
64132ee814
Коммит
08b4c24833
|
@ -4,8 +4,14 @@ import sys
|
|||
from django.core.management import call_command
|
||||
import pytest
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management import call_command
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--runslow",
|
||||
action="store_true",
|
||||
help="run slow tests",
|
||||
)
|
||||
|
||||
|
||||
def pytest_sessionstart(session):
|
||||
"""
|
||||
|
@ -62,6 +68,9 @@ def pytest_runtest_setup(item):
|
|||
|
||||
increment_cache_key_prefix()
|
||||
|
||||
if 'slow' in item.keywords and not item.config.getoption("--runslow"):
|
||||
pytest.skip("need --runslow option to run")
|
||||
|
||||
|
||||
def pytest_runtest_teardown(item):
|
||||
"""
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
from .sample_data_generator import job_json
|
||||
|
||||
slow = pytest.mark.slow
|
||||
|
||||
def test_unicode(jm):
|
||||
"""Unicode representation of a ``JobModel`` is the project name."""
|
||||
|
@ -123,9 +124,10 @@ def test_process_objects_unknown_error(jm, monkeypatch):
|
|||
assert row_data['processed_state'] == 'ready'
|
||||
|
||||
|
||||
@slow
|
||||
def test_ingest_sample_data(jm, sample_data):
|
||||
"""Process all job structures in the job_data.txt file"""
|
||||
job_data = sample_data.job_data[:250]
|
||||
job_data = sample_data.job_data
|
||||
for blob in job_data:
|
||||
jm.store_job_data(json.dumps(blob))
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ class JobsModel(TreeherderModelBase):
|
|||
|
||||
# @@@ sources
|
||||
|
||||
# Get/Set reference info, all inserts use ON DUPLICATE KEY
|
||||
# Get/Set reference info
|
||||
|
||||
rdm = self.refdata_model
|
||||
job_id = -1
|
||||
|
|
Загрузка…
Ссылка в новой задаче