Skip to content

Commit

Permalink
Fix three tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BoPeng committed Feb 15, 2024
1 parent 9b3c4b2 commit 4c7a245
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion test/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sos.converter import extract_workflow


@pytest.mark.skip(reason="temporary skip")

def test_script_to_html(temp_factory, clear_now_and_after):
'''Test sos show script --html'''
clear_now_and_after('temp1.sos.html', 'temp2.sos.html')
Expand Down
2 changes: 1 addition & 1 deletion test/test_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ def test_reverse_shared_variable(clear_now_and_after):
assert env.sos_dict['b'] == 1


@pytest.mark.skip(reason="temporary skip")

def test_chained_depends(temp_factory):
'''Test chain dependent'''
temp_factory('a.bam', 'a.bam.bai', 'a.vcf')
Expand Down
8 changes: 4 additions & 4 deletions test/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ def test_step_id_vars():
""")


@pytest.mark.skip(reason="temporary skip")

def test_reexecution_of_dynamic_depends(clear_now_and_after):
"""Testing the rerun of steps to verify dependency"""
clear_now_and_after("a.bam", "a.bam.bai")
Expand Down Expand Up @@ -1804,7 +1804,7 @@ def test_reexecution_of_dynamic_depends(clear_now_and_after):
assert res["__completed__"]["__step_skipped__"] == 1


@pytest.mark.skip(reason="temporary skip")

def test_traced_function(clear_now_and_after):
clear_now_and_after("a.bam", "a.bam.bai")
script = """
Expand Down Expand Up @@ -2314,7 +2314,7 @@ def test_remove_empty_groups_empty_named(clear_now_and_after):
""")


@pytest.mark.skip(reason="temporary skip")

def test_multi_depends(clear_now_and_after, temp_factory):
"""Test a step with multiple depdendend steps"""

Expand Down Expand Up @@ -2596,7 +2596,7 @@ def test_concurrent_running_tasks(script_factory):
assert ret2.returncode == 0


@pytest.mark.skip(reason="temporary skip")

def test_reexecute_task_with_missing_output(clear_now_and_after):
'''Issue #1493'''
clear_now_and_after([f'a_{i}.txt' for i in range(10)])
Expand Down
4 changes: 2 additions & 2 deletions test/test_execute_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_removal_of_output_from_failed_step(clear_now_and_after):
assert not os.path.isfile("result.csv")


@pytest.mark.skip(reason="temporary skip")

def test_error_handling_of_substeps(clear_now_and_after):
clear_now_and_after(
[f"test_{i}.txt" for i in range(10)],
Expand Down Expand Up @@ -194,7 +194,7 @@ def test_for_each_as_target_property_nested_list(temp_factory):
]


@pytest.mark.skip(reason="temporary skip")

def test_rerun_with_zap(clear_now_and_after):
clear_now_and_after([f"zapped_example_{i}.txt.zapped" for i in range(3)])
clear_now_and_after([f"zapped_example_{i}.bak" for i in range(3)])
Expand Down
2 changes: 1 addition & 1 deletion test/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ def test_cell():
""")


@pytest.mark.skip(reason="temporary skip")

def test_overwrite_keyword(clear_now_and_after):
"""Test overwrite sos keyword with user defined one."""
clear_now_and_after("a.txt")
Expand Down
16 changes: 8 additions & 8 deletions test/test_python3_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,41 +61,41 @@ def test_py_module_with_version():
''')


@pytest.mark.skip(reason="temporary skip")

def test_upgrade_py_module():
'''Test upgrade py module #1246'''
# first install tabulate == 0.7.5
# first install tabulate == 0.8.5
execute_workflow(r'''
[10]
depends: Py_Module('tabulate==0.7.5', autoinstall=True)
depends: Py_Module('tabulate==0.8.9', autoinstall=True)
''')
# test should pass
execute_workflow(r'''
[10]
depends: Py_Module('tabulate'), Py_Module('tabulate==0.7.5')
depends: Py_Module('tabulate'), Py_Module('tabulate==0.8.9')
''')
# test for newer version should fail

with pytest.raises(Exception):
execute_workflow(r'''
[10]
depends: Py_Module('tabulate==0.8.3')
depends: Py_Module('tabulate==0.9.0')
''')

# auto install should work
execute_workflow(r'''
[10]
depends: Py_Module('tabulate==0.8.3', autoinstall=True)
depends: Py_Module('tabulate==0.9.0', autoinstall=True)
''')

# test for old version should fail
execute_workflow(r'''
[10]
depends: Py_Module('tabulate'), Py_Module('tabulate==0.8.3')
depends: Py_Module('tabulate'), Py_Module('tabulate==0.9.0')
''')
# test for old version should fail
with pytest.raises(Exception):
execute_workflow(r'''
[10]
depends: Py_Module('tabulate==0.7.5')
depends: Py_Module('tabulate==0.8.9')
''')
2 changes: 1 addition & 1 deletion test/test_r_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_r_library():
""")


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not shutil.which("Rscript"), reason="R not installed")
def test_depends_r_library():
"""Testing depending on R_library"""
Expand Down
12 changes: 6 additions & 6 deletions test/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
has_docker = False


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_to_host_option(clear_now_and_after):
"""Test from_remote option"""
Expand All @@ -50,7 +50,7 @@ def test_to_host_option(clear_now_and_after):
assert lc.read().strip().startswith("100")


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_to_host_option_with_named_path(clear_now_and_after):
"""Test from_remote option"""
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_worker_procs_with_task():
)


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_remote_execute(clear_now_and_after, script_factory):
clear_now_and_after("result_remote.txt", "result_remote1.txt", "local.txt")
Expand Down Expand Up @@ -180,7 +180,7 @@ def test_remote_workflow_remote_queue(script_factory):
assert 0 == subprocess.call(f"sos run {test_r_q} -c ~/docker.yml -r ts -q ts", shell=True)


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_remote_exec(clear_now_and_after):
clear_now_and_after("result_exec.txt")
Expand All @@ -207,7 +207,7 @@ def test_remote_exec(clear_now_and_after):
assert f"PWD: {root_dir}" in result


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_remote_exec_named_path(clear_now_and_after):
clear_now_and_after("result_named_path.txt")
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_remote_exec_named_path(clear_now_and_after):
assert f"PWD: {root_dir}" in result


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_remote_exec_workdir_named_path(clear_now_and_after):
clear_now_and_after(file_target("#home/wd/result_workdir_named_path.txt"))
Expand Down
2 changes: 1 addition & 1 deletion test/test_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ def test_signature_with_dependency_tracing_and_vars(clear_signatures,
assert res['__completed__']['__substep_completed__'] == 2


@pytest.mark.skip(reason="temporary skip")

def test_skip_mode(clear_signatures, temp_factory, clear_now_and_after):
'''Test skipping mode of signature'''
clear_now_and_after([f'a_{i}.bak' for i in range(4)])
Expand Down
6 changes: 3 additions & 3 deletions test/test_singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_bash_in_singularity():
''')


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(
not shutil.which('singularity') or sys.platform == 'win32' or
'TRAVIS' in os.environ or 'APPVEYOR' in os.environ,
Expand All @@ -47,7 +47,7 @@ def test_singularity_build_linux_image(self):
''')


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(
not shutil.which('singularity') or sys.platform == 'win32' or
'TRAVIS' in os.environ or 'APPVEYOR' in os.environ,
Expand All @@ -59,7 +59,7 @@ def test_singularity_build_from_shub(self):
''')


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(
not shutil.which('singularity') or sys.platform == 'win32',
reason='Skip test because docker is not installed.')
Expand Down
4 changes: 2 additions & 2 deletions test/test_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def test_temp_file():
""")


@pytest.mark.skip(reason="temporary skip")

def test_named_path():
"""Test the use of option name of path"""
execute_workflow(
Expand All @@ -707,7 +707,7 @@ def test_named_path():
)


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(
sys.platform == 'win32', reason='Graphviz not available under windows')
def test_to_named_path_path():
Expand Down
24 changes: 12 additions & 12 deletions test/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def test_max_mem():
)


@pytest.mark.skip(reason="temporary skip")

def test_local_runtime_max_walltime():
"""Test server max_walltime option"""
# gives warning, but do not kill
Expand Down Expand Up @@ -519,7 +519,7 @@ def test_max_cores():
)


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipIf(not has_docker, reason="Docker container not usable")
def test_override_max_cores():
"""Test use queue_args to override server restriction max_cores"""
Expand All @@ -540,7 +540,7 @@ def test_override_max_cores():
)


@pytest.mark.skip(reason="temporary skip")

def test_list_hosts():
"""test list hosts using sos status -q"""
for v in ["0", "1", "3", "4"]:
Expand Down Expand Up @@ -652,7 +652,7 @@ def test_task_no_signature(purge_tasks):
assert time.time() - st > 1


@pytest.mark.skip(reason="temporary skip")

def test_task_with_signature(purge_tasks, clear_now_and_after):
"""Test re-execution of tasks"""
# now with a real signature
Expand Down Expand Up @@ -714,7 +714,7 @@ def test_output_in_task():
options={"default_queue": "localhost"})


@pytest.mark.skip(reason="temporary skip")

def test_repeated_tasks():
"""Test statement before task #1142 """
for i in range(5):
Expand Down Expand Up @@ -801,7 +801,7 @@ def test_output_from_master_task():
options={"default_queue": "localhost"})


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipIf(not has_docker, reason="Docker container not usable")
def test_remote_input_target(clear_now_and_after):
"""Test the use of remote target"""
Expand All @@ -827,7 +827,7 @@ def test_remote_input_target(clear_now_and_after):
assert os.path.isfile("vars1.sh")


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_delayed_interpolation(clear_now_and_after):
"""Test delayed interpolation with expression involving remote objects"""
Expand Down Expand Up @@ -860,7 +860,7 @@ def test_delayed_interpolation(clear_now_and_after):
assert not os.path.isfile("test.py.bak")


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_remote_output_target(clear_now_and_after):
"""Test the use of remote target"""
Expand All @@ -886,7 +886,7 @@ def test_remote_output_target(clear_now_and_after):
assert not os.path.isfile("vars1.sh")


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_remote_output_target_with_trunksize(clear_now_and_after):
clear_now_and_after("vars.sh", "vars1.sh")
Expand All @@ -912,7 +912,7 @@ def test_remote_output_target_with_trunksize(clear_now_and_after):
assert not os.path.isfile("init-d-script")


@pytest.mark.skip(reason="temporary skip")

def test_runtime_max_walltime():
"""Test server max_walltime option"""
with pytest.raises(Exception):
Expand All @@ -931,7 +931,7 @@ def test_runtime_max_walltime():
)


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_sync_master_task(clear_now_and_after):
"""Test sync input and output with remote host with trunksize"""
Expand Down Expand Up @@ -1077,7 +1077,7 @@ def test_trunk_workers_option(clear_now_and_after, purge_tasks):
assert os.path.isfile(f"{i}.txt")


@pytest.mark.skip(reason="temporary skip")

@pytest.mark.skipif(not has_docker, reason="Docker container not usable")
def test_sync_input_output_and_rerun(clear_now_and_after, purge_tasks):
"""Test sync input and output with remote host"""
Expand Down

0 comments on commit 4c7a245

Please sign in to comment.