Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ jobs:

- name: Run Pytest
run: |
export PYTHONPATH=src:$PYTHONPATH
pytest
21 changes: 21 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import pytest


def pytest_addoption(parser):
parser.addoption(
"--runslow", action="store_true", default=False, help="run slow tests"
)


def pytest_configure(config):
config.addinivalue_line("markers", "slow: mark test as slow to run")


def pytest_collection_modifyitems(config, items):
if config.getoption("--runslow"):
# --runslow given in cli: do not skip slow tests
return
skip_slow = pytest.mark.skip(reason="need --runslow option to run")
for item in items:
if "slow" in item.keywords:
item.add_marker(skip_slow)
14 changes: 8 additions & 6 deletions tests/test_vip_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ def setup_teardown_vip_launcher():
yield
assert delete_path(BASE_PATH_VIP)

@pytest.mark.slow
def test_upload_download():
assert upload(BASE_PATH_LOCAL + 'file.txt', BASE_PATH_VIP + 'file.txt')
assert exists(BASE_PATH_VIP + 'file.txt')
assert download(BASE_PATH_VIP + 'file.txt', BASE_PATH_LOCAL + 'file_copy.txt')
assert compare_files(BASE_PATH_LOCAL + 'file.txt', BASE_PATH_LOCAL + 'file_copy.txt')
assert delete_path(BASE_PATH_VIP + 'file.txt')


@pytest.mark.slow
def test_init_exec():
input_values = {
'mand_text': 'value1',
Expand All @@ -44,7 +45,7 @@ def test_init_exec():
exec_info = execution_info(exec_id)
assert exec_info['status'] == 'Running'


@pytest.mark.slow
def test_kill_exec():
input_values = {
'mand_text': 'value1',
Expand All @@ -65,6 +66,7 @@ def test_kill_exec():
if counter > 100:
raise Exception("Execution not ended after delay")

@pytest.mark.slow
def test_get_exec_stdout():
input_values = {
'mand_text': 'value1',
Expand All @@ -80,7 +82,7 @@ def test_get_exec_stdout():
stdout = get_exec_stdout(exec_id)
assert isinstance(stdout, str)


@pytest.mark.slow
def test_get_exec_results():
input_values = {
'mand_text': 'value1',
Expand All @@ -101,7 +103,7 @@ def test_get_exec_results():
assert 'executionId' in r
assert 'path' in r


@pytest.mark.slow
def test_list_pipeline():
pipelines = list_pipeline()
# assert that this is a list of dictionaries
Expand All @@ -115,7 +117,7 @@ def test_list_pipeline():
assert 'canExecute' in p
assert 'description' in p


@pytest.mark.slow
def test_pipeline_def():
pipeline = pipeline_def('CQUEST/0.3')
assert isinstance(pipeline, dict)
Expand All @@ -126,7 +128,7 @@ def test_pipeline_def():
assert 'canExecute' in pipeline
assert 'description' in pipeline


@pytest.mark.slow
def test_platform_info():
info = platform_info()
assert isinstance(info, dict)
Expand Down