Skip to content

Commit

Permalink
Remove remains of Travis. (DataBiosphere#3976)
Browse files Browse the repository at this point in the history
  • Loading branch information
DailyDreaming authored Dec 22, 2021
1 parent f5630c7 commit cfa0635
Show file tree
Hide file tree
Showing 31 changed files with 40 additions and 216 deletions.
3 changes: 0 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ wdl_dependency_is_stand_alone:
- virtualenv -p ${MAIN_PYTHON_PKG} venv && . venv/bin/activate && make prepare && make develop extras=[wdl]
- make test tests=src/toil/test/wdl/toilwdlTest.py::ToilWdlIntegrationTest::testMD5sum

# Tests that used to be on Travis
# The Makefile sets "TRAVIS=true", which is now a misnomer, but we don't need
# to also do it here.
quick_test_offline:
stage: basic_tests
script:
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,21 @@ clean_sdist:
- rm -rf dist
- rm src/toil/version.py

# We always claim to be Travis, so that local test runs will not skip Travis tests.
# Setting SET_OWNER_TAG will tag cloud resources so that UCSC's cloud murder bot won't kill them.
test: check_venv check_build_reqs
TRAVIS=true TOIL_OWNER_TAG="shared" \
TOIL_OWNER_TAG="shared" \
python -m pytest --durations=0 --log-level DEBUG --log-cli-level INFO -r s $(cov) $(tests)


# This target will skip building docker and all docker based tests
# these are our travis tests; rename?
test_offline: check_venv check_build_reqs
@printf "$(cyan)All docker related tests will be skipped.$(normal)\n"
TOIL_SKIP_DOCKER=True \
TRAVIS=true \
python -m pytest -vv --timeout=600 --log-level DEBUG --log-cli-level INFO $(cov) $(tests)

ifdef TOIL_DOCKER_REGISTRY

docker_image:=$(TOIL_DOCKER_REGISTRY)/$(TOIL_DOCKER_NAME)

grafana_image:=$(TOIL_DOCKER_REGISTRY)/toil-grafana
prometheus_image:=$(TOIL_DOCKER_REGISTRY)/toil-prometheus
mtail_image:=$(TOIL_DOCKER_REGISTRY)/toil-mtail
Expand Down
1 change: 0 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export TOIL_AWS_NODE_DEBUG?=False # Don't shut down EC2 instances that fail so
export TOIL_TEST_INTEGRATIVE?=False # If ``True``, this allows the integration tests to run.
export TOIL_TEST_QUICK?=False # If ``True``, long running tests are skipped.
export TOIL_SKIP_DOCKER?=False # Skip docker dependent tests
export TRAVIS?=True # Run tests for travis (shorter unit tests)

export TOIL_AWS_KEYNAME?=id_rsa # SSH key to use for tests in AWS.
export TOIL_GOOGLE_KEYNAME?=id_rsa # SSH key to use for tests in google.
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ Pull Requests

.. _Draft Changelog: https://github.com/DataBiosphere/toil/wiki/Draft-Changelog

* Pull requests will not be merged unless Travis and Gitlab CI tests pass.
* Pull requests will not be merged unless CI tests pass.
Gitlab tests are only run on code in the main Toil repository on some branch,
so it is the responsibility of the approving reviewer to make sure that pull
requests from outside repositories are copied to branches in the main
Expand Down
7 changes: 0 additions & 7 deletions src/toil/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,6 @@ def needs_aws_ec2(test_item: MT) -> MT:
return test_item


def travis_test(test_item: MT) -> MT:
test_item = _mark_test('travis', test_item)
if os.environ.get('TRAVIS') != 'true':
return unittest.skip("Set TRAVIS='true' to include this test.")(test_item)
return test_item


def needs_google(test_item: MT) -> MT:
"""Use as a decorator before test classes or methods to run only if Google is usable."""
test_item = _mark_test('google', test_item)
Expand Down
5 changes: 1 addition & 4 deletions src/toil/test/batchSystems/batchSystemTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
needs_slurm,
needs_tes,
needs_torque,
slow,
travis_test)
slow)
from toil.test.batchSystems.parasolTestSupport import ParasolTestSupport

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -530,7 +529,6 @@ def write_temp_file(s: str, temp_dir: str) -> str:
os.close(fd)


@travis_test
class SingleMachineBatchSystemTest(hidden.AbstractBatchSystemTest):
"""
Tests against the single-machine batch system
Expand Down Expand Up @@ -989,7 +987,6 @@ def tearDown(self):
super().tearDown()


@travis_test
class SingleMachineBatchSystemJobTest(hidden.AbstractBatchSystemJobTest):
"""
Tests Toil workflow against the SingleMachine batch system
Expand Down
22 changes: 1 addition & 21 deletions src/toil/test/docs/scriptsTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa
sys.path.insert(0, pkg_root) # noqa

from toil.test import ToilTest, needs_cwl, needs_docker, travis_test
from toil.test import ToilTest, needs_cwl, needs_docker
from toil.version import python


Expand Down Expand Up @@ -69,100 +69,80 @@ def checkExpectedPattern(self, script, expectedPattern):
def testCwlexample(self):
self.checkExitCode("tutorial_cwlexample.py")

@travis_test
def testDiscoverfiles(self):
self.checkExitCode("tutorial_discoverfiles.py")

@travis_test
def testDynamic(self):
self.checkExitCode("tutorial_dynamic.py")

@travis_test
def testEncapsulation(self):
self.checkExitCode("tutorial_encapsulation.py")

@travis_test
def testEncapsulation2(self):
self.checkExitCode("tutorial_encapsulation2.py")

@travis_test
def testHelloworld(self):
self.checkExpectedOut("tutorial_helloworld.py", "Hello, world!, here's a message: You did it!\n")

@travis_test
def testInvokeworkflow(self):
self.checkExpectedOut("tutorial_invokeworkflow.py", "Hello, world!, here's a message: Woot\n")

@travis_test
def testInvokeworkflow2(self):
self.checkExpectedOut("tutorial_invokeworkflow2.py", "Hello, world!, I have a message: Woot!\n")

@travis_test
def testJobFunctions(self):
self.checkExpectedOut("tutorial_jobfunctions.py", "Hello world, I have a message: Woot!\n")

@travis_test
def testManaging(self):
self.checkExitCode("tutorial_managing.py")

@travis_test
def testManaging2(self):
self.checkExitCode("tutorial_managing2.py")

@travis_test
def testMultiplejobs(self):
self.checkExpectedPattern("tutorial_multiplejobs.py",
"Hello world, I have a message: first.*Hello world, I have a message: "
"second or third.*Hello world, I have a message: second or third.*Hello world,"
" I have a message: last")

@travis_test
def testMultiplejobs2(self):
self.checkExpectedPattern("tutorial_multiplejobs2.py",
"Hello world, I have a message: first.*Hello world, I have a message: "
"second or third.*Hello world, I have a message: second or third.*Hello world,"
" I have a message: last")

@travis_test
def testMultiplejobs3(self):
self.checkExpectedPattern("tutorial_multiplejobs3.py",
"Hello world, I have a message: first.*Hello world, I have a message: "
"second or third.*Hello world, I have a message: second or third.*Hello world,"
" I have a message: last")

@travis_test
def testPromises2(self):
self.checkExpectedOut("tutorial_promises2.py",
"['00000', '00001', '00010', '00011', '00100', '00101', '00110', '00111',"
" '01000', '01001', '01010', '01011', '01100', '01101', '01110', '01111',"
" '10000', '10001', '10010', '10011', '10100', '10101', '10110', '10111',"
" '11000', '11001', '11010', '11011', '11100', '11101', '11110', '11111']")

@travis_test
def testQuickstart(self):
self.checkExpectedOut("tutorial_quickstart.py", "Hello, world!, here's a message: Woot\n")

@travis_test
def testRequirements(self):
self.checkExitCode("tutorial_requirements.py")

@travis_test
def testArguments(self):
self.checkExpectedOut("tutorial_arguments.py", "Hello, world!, here's a message: Woot")

@needs_docker
def testDocker(self):
self.checkExitCode("tutorial_docker.py")

@travis_test
def testPromises(self):
self.checkExpectedPattern("tutorial_promises.py", "i is: 1.*i is: 2.*i is: 3")

@travis_test
def testServices(self):
self.checkExitCode("tutorial_services.py")

@travis_test
def testStaging(self):
self.checkExitCode("tutorial_staging.py")

Expand Down
25 changes: 1 addition & 24 deletions src/toil/test/jobStores/jobStoreTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
needs_aws_s3,
needs_encryption,
needs_google,
slow,
travis_test)
slow)

# noinspection PyPackageRequirements
# (installed by `make prepare`)
Expand Down Expand Up @@ -142,13 +141,11 @@ def tearDown(self):
self.jobstore_resumed_noconfig.destroy()
super(AbstractJobStoreTest.Test, self).tearDown()

@travis_test
def testInitialState(self):
"""Ensure proper handling of nonexistant files."""
self.assertFalse(self.jobstore_initialized.job_exists('nonexistantFile'))
self.assertRaises(NoSuchJobException, self.jobstore_initialized.load_job, 'nonexistantFile')

@travis_test
def testJobCreation(self):
"""
Test creation of a job.
Expand Down Expand Up @@ -179,7 +176,6 @@ def testJobCreation(self):
self.assertEqual(job.jobName, 'test1')
self.assertEqual(job.unitName, 'onParent')

@travis_test
def testConfigEquality(self):
"""
Ensure that the command line configurations are successfully loaded and stored.
Expand All @@ -193,7 +189,6 @@ def testConfigEquality(self):
self.assertEqual(newJobStore.config, self.config)
self.assertIsNot(newJobStore.config, self.config)

@travis_test
def testJobLoadEquality(self):
"""Tests that a job created via one JobStore instance can be loaded from another."""

Expand All @@ -209,7 +204,6 @@ def testJobLoadEquality(self):

self.assertEqual(jobDesc1.command, jobDesc2.command)

@travis_test
def testChildLoadingEquality(self):
"""Test that loading a child job operates as expected."""
job = JobDescription(command='parent1',
Expand All @@ -228,7 +222,6 @@ def testChildLoadingEquality(self):

self.assertEqual(self.jobstore_initialized.load_job(list(job.allSuccessors())[0]).command, childJob.command)

@travis_test
def testPersistantFilesToDelete(self):
"""
Make sure that updating a job carries over filesToDelete.
Expand All @@ -249,7 +242,6 @@ def testPersistantFilesToDelete(self):
self.jobstore_initialized.update_job(job)
self.assertEqual(self.jobstore_initialized.load_job(job.jobStoreID).filesToDelete, ['1', '2'])

@travis_test
def testUpdateBehavior(self):
"""Tests the proper behavior during updating jobs."""
jobstore1 = self.jobstore_initialized
Expand Down Expand Up @@ -297,7 +289,6 @@ def testUpdateBehavior(self):
self.assertNotEqual(jobstore1.load_job(childJob1.jobStoreID), childJob1)
self.assertNotEqual(jobstore1.load_job(childJob2.jobStoreID), childJob2)

@travis_test
def testJobDeletions(self):
"""Tests the consequences of deleting jobs."""
# A local jobstore object for testing.
Expand Down Expand Up @@ -361,7 +352,6 @@ def testJobDeletions(self):
except NoSuchFileException:
pass

@travis_test
def testSharedFiles(self):
"""Tests the sharing of files."""
jobstore1 = self.jobstore_initialized
Expand Down Expand Up @@ -421,7 +411,6 @@ def testReadWriteFileStreamTextMode(self):
with jobstore.read_file_stream(fileID, encoding='utf-8') as f:
self.assertEqual(bar, f.read())

@travis_test
def testPerJobFiles(self):
"""Tests the behavior of files on jobs."""
jobstore1 = self.jobstore_initialized
Expand Down Expand Up @@ -495,7 +484,6 @@ def testPerJobFiles(self):
except NoSuchFileException:
pass

@travis_test
def testStatsAndLogging(self):
"""Tests behavior of reading and writting stats and logging."""
jobstore1 = self.jobstore_initialized
Expand Down Expand Up @@ -550,7 +538,6 @@ def callback(f2):
self.assertFalse(jobstore1.job_exists(jobOnJobStore1.jobStoreID))
# TODO: Who deletes the shared files?

@travis_test
def testWriteLogFiles(self):
"""Test writing log files."""
jobNames = ['testStatsAndLogging_writeLogFiles']
Expand All @@ -565,7 +552,6 @@ def testWriteLogFiles(self):
self.assertEqual(f.read(), 'string\nbytes\n\nnewline\n')
os.remove(jobLogFile)

@travis_test
def testBatchCreate(self):
"""Test creation of many jobs."""
jobstore = self.jobstore_initialized
Expand All @@ -582,7 +568,6 @@ def testBatchCreate(self):
for job in jobs:
self.assertTrue(jobstore.job_exists(job.jobStoreID))

@travis_test
def testGrowingAndShrinkingJob(self):
"""Make sure jobs update correctly if they grow/shrink."""
# Make some very large data, large enough to trigger
Expand Down Expand Up @@ -750,7 +735,6 @@ def testImportSharedFile(self, otherCls):
cls,
otherCls=activeTestClassesByName)

@travis_test
def testImportHttpFile(self):
'''Test importing a file over HTTP.'''
http = socketserver.TCPServer(('', 0), StubHttpRequestHandler)
Expand All @@ -775,7 +759,6 @@ def testImportHttpFile(self):
finally:
http.server_close()

@travis_test
def testImportFtpFile(self):
'''Test importing a file over FTP'''
ftpfile = {'name': 'foo', 'content': 'foo bar baz qux'}
Expand Down Expand Up @@ -896,7 +879,6 @@ def checksumThreadFn():
self.assertEqual(before, after)
self.jobstore_initialized.delete_job(job.jobStoreID)

@travis_test
def testZeroLengthFiles(self):
'''Test reading and writing of empty files.'''
job = self.arbitraryJob()
Expand Down Expand Up @@ -1003,7 +985,6 @@ def testCleanCache(self):
# NB: the 'thread' method seems to be needed here to actually
# ensure the timeout is raised, probably because the only
# "live" thread doesn't hold the GIL.
@travis_test
@pytest.mark.timeout(45, method='thread')
def testPartialReadFromStream(self):
"""Test whether readFileStream will deadlock on a partial read."""
Expand Down Expand Up @@ -1038,7 +1019,6 @@ def testDestructionOfCorruptedJobStore(self):
jobstore.destroy()
# Note that self.jobstore_initialized.destroy() is done as part of shutdown

@travis_test
def testDestructionIdempotence(self):
# Jobstore is fully initialized
self.jobstore_initialized.destroy()
Expand All @@ -1051,7 +1031,6 @@ def testDestructionIdempotence(self):
cleaner = self._createJobStore()
cleaner.destroy()

@travis_test
def testEmptyFileStoreIDIsReadable(self):
"""Simply creates an empty fileStoreID and attempts to read from it."""
id = self.jobstore_initialized.get_empty_file_store_id()
Expand Down Expand Up @@ -1157,7 +1136,6 @@ def _createExternalStore(self):
def _cleanUpExternalStore(self, dirPath):
shutil.rmtree(dirPath)

@travis_test
def testPreserveFileName(self):
"""Check that the fileID ends with the given file name."""
fh, path = tempfile.mkstemp()
Expand Down Expand Up @@ -1187,7 +1165,6 @@ def test_jobstore_init_preserves_symlink_path(self):
if original_filestore and os.path.exists(original_filestore):
shutil.rmtree(original_filestore)

@travis_test
def test_jobstore_does_not_leak_symlinks(self):
"""Test that if we link imports into the FileJobStore, we can't get hardlinks to symlinks."""

Expand Down
Loading

0 comments on commit cfa0635

Please sign in to comment.