Skip to content

Commit

Permalink
Remove accidental junk from other branch
Browse files Browse the repository at this point in the history
  • Loading branch information
stxue1 committed Jul 12, 2023
1 parent 9775fee commit 684b982
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions src/toil/test/wdl/wdltoil_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import hashlib
import json
import os
import shutil
Expand All @@ -9,58 +8,12 @@
from urllib.request import urlretrieve

import pytest
import re

from toil.test import ToilTest, needs_docker, needs_docker_cuda, needs_java, needs_singularity, slow
from toil.version import exactPython
# Don't import the test case directly or pytest will test it again.
import toil.test.wdl.toilwdlTest


class ToilConformanceTests(toil.test.wdl.toilwdlTest.BaseToilWdlTest):
"""
New WDL conformance tests for Toil
"""
@classmethod
def setUpClass(cls) -> None:
os.system("git clone -b move-toil-tests https://github.com/DataBiosphere/wdl-conformance-tests.git")
assert os.path.exists("wdl-conformance-tests"), "Failed to git clone!"
os.chdir("wdl-conformance-tests")
cls.base_command = [exactPython, "run.py", "--runner", "toil-wdl-runner"]

def test_conformance_tests_v10(self):
tests_to_run = "0,1,5-7,9-15,17,22-24,26,28-30,32-40,53,57-59,62,67-69"
p = subprocess.Popen(self.base_command + ["-v", "1.0", "-n", tests_to_run], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
assert b": FAILED:" not in stdout, f"At least one conformance test failed!\n" \
f"Failed tests: {' '.join(self.find_failed_tests(stdout))}"

def test_conformance_tests_v11(self):
tests_to_run = "2-11,13-15,17-20,22-24,26,29,30,32-40,53,57-59,62,67-69"
p = subprocess.Popen(self.base_command + ["-v", "1.1", "-n", tests_to_run], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
assert b": FAILED:" not in stdout, f"At least one conformance test failed!\n" \
f"Failed tests: {' '.join(self.find_failed_tests(stdout))}"


def find_failed_tests(self, stream):
"""
Parse output and find all tests that failed
:return:
"""
pattern = rb"\d+: FAILED:"
matches = re.findall(pattern, stream)
failed_tests = [test[0:test.find(b":")].decode() for test in matches]
return failed_tests


@classmethod
def tearDownClass(cls) -> None:
upper_dir = os.path.dirname(os.getcwd())
os.chdir(upper_dir)
shutil.rmtree("wdl-conformance-tests")


class WdlToilTest(toil.test.wdl.toilwdlTest.ToilWdlTest):
"""
Version of the old Toil WDL tests that tests the new MiniWDL-based implementation.
Expand Down

0 comments on commit 684b982

Please sign in to comment.