From 31c8c4ea5817167f91f2396f8d0efb563a8b23b1 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" <1330696+mr-c@users.noreply.github.com> Date: Thu, 21 Sep 2023 12:22:18 +0200 Subject: [PATCH] Tests: only request a single core (#4572) --- src/toil/test/docs/scripts/tutorial_arguments.py | 2 +- src/toil/test/docs/scripts/tutorial_invokeworkflow.py | 2 +- src/toil/test/docs/scripts/tutorial_invokeworkflow2.py | 2 +- src/toil/test/docs/scripts/tutorial_multiplejobs.py | 2 +- src/toil/test/docs/scripts/tutorial_multiplejobs2.py | 2 +- src/toil/test/docs/scripts/tutorial_multiplejobs3.py | 2 +- src/toil/test/docs/scripts/tutorial_quickstart.py | 2 +- src/toil/test/docs/scripts/tutorial_requirements.py | 4 ++-- src/toil/test/docs/scripts/tutorial_staging.py | 2 +- src/toil/test/src/helloWorldTest.py | 2 +- src/toil/test/src/realtimeLoggerTest.py | 2 +- src/toil/test/src/toilContextManagerTest.py | 4 ++-- src/toil/test/src/userDefinedJobArgTypeTest.py | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/toil/test/docs/scripts/tutorial_arguments.py b/src/toil/test/docs/scripts/tutorial_arguments.py index 45d117a860..211737209d 100644 --- a/src/toil/test/docs/scripts/tutorial_arguments.py +++ b/src/toil/test/docs/scripts/tutorial_arguments.py @@ -4,7 +4,7 @@ class HelloWorld(Job): def __init__(self, message): - Job.__init__(self, memory="2G", cores=2, disk="3G") + Job.__init__(self) self.message = message def run(self, fileStore): diff --git a/src/toil/test/docs/scripts/tutorial_invokeworkflow.py b/src/toil/test/docs/scripts/tutorial_invokeworkflow.py index eb93211985..c6866ac824 100644 --- a/src/toil/test/docs/scripts/tutorial_invokeworkflow.py +++ b/src/toil/test/docs/scripts/tutorial_invokeworkflow.py @@ -7,7 +7,7 @@ class HelloWorld(Job): def __init__(self, message): - Job.__init__(self, memory="2G", cores=2, disk="3G") + Job.__init__(self) self.message = message def run(self, fileStore): diff --git a/src/toil/test/docs/scripts/tutorial_invokeworkflow2.py b/src/toil/test/docs/scripts/tutorial_invokeworkflow2.py index d82a0858a3..639cc83f2f 100644 --- a/src/toil/test/docs/scripts/tutorial_invokeworkflow2.py +++ b/src/toil/test/docs/scripts/tutorial_invokeworkflow2.py @@ -6,7 +6,7 @@ class HelloWorld(Job): def __init__(self, message): - Job.__init__(self, memory="2G", cores=2, disk="3G") + Job.__init__(self) self.message = message def run(self, fileStore): diff --git a/src/toil/test/docs/scripts/tutorial_multiplejobs.py b/src/toil/test/docs/scripts/tutorial_multiplejobs.py index 50448bb9f8..b7068296f8 100644 --- a/src/toil/test/docs/scripts/tutorial_multiplejobs.py +++ b/src/toil/test/docs/scripts/tutorial_multiplejobs.py @@ -2,7 +2,7 @@ from toil.job import Job -def helloWorld(job, message, memory="2G", cores=2, disk="3G"): +def helloWorld(job, message): job.log(f"Hello world, I have a message: {message}") diff --git a/src/toil/test/docs/scripts/tutorial_multiplejobs2.py b/src/toil/test/docs/scripts/tutorial_multiplejobs2.py index 2f9be68fa0..3180dd2579 100644 --- a/src/toil/test/docs/scripts/tutorial_multiplejobs2.py +++ b/src/toil/test/docs/scripts/tutorial_multiplejobs2.py @@ -2,7 +2,7 @@ from toil.job import Job -def helloWorld(job, message, memory="2G", cores=2, disk="3G"): +def helloWorld(job, message): job.log(f"Hello world, I have a message: {message}") diff --git a/src/toil/test/docs/scripts/tutorial_multiplejobs3.py b/src/toil/test/docs/scripts/tutorial_multiplejobs3.py index 381dde9f00..38aa7e228e 100644 --- a/src/toil/test/docs/scripts/tutorial_multiplejobs3.py +++ b/src/toil/test/docs/scripts/tutorial_multiplejobs3.py @@ -2,7 +2,7 @@ from toil.job import Job -def helloWorld(job, message, memory="2G", cores=2, disk="3G"): +def helloWorld(job, message): job.log(f"Hello world, I have a message: {message}") diff --git a/src/toil/test/docs/scripts/tutorial_quickstart.py b/src/toil/test/docs/scripts/tutorial_quickstart.py index 46e7cbe5b9..a06f2e017f 100644 --- a/src/toil/test/docs/scripts/tutorial_quickstart.py +++ b/src/toil/test/docs/scripts/tutorial_quickstart.py @@ -5,7 +5,7 @@ from toil.job import Job -def helloWorld(message, memory="2G", cores=2, disk="3G"): +def helloWorld(message): return f"Hello, world!, here's a message: {message}" diff --git a/src/toil/test/docs/scripts/tutorial_requirements.py b/src/toil/test/docs/scripts/tutorial_requirements.py index b2be68dc7b..0e0ba9409a 100644 --- a/src/toil/test/docs/scripts/tutorial_requirements.py +++ b/src/toil/test/docs/scripts/tutorial_requirements.py @@ -15,12 +15,12 @@ def parentJob(job): job.addFollowOn(analysis) -def stageFn(job, url, cores=1): +def stageFn(job, url): importedFile = job.fileStore.import_file(url) return importedFile, importedFile.size -def analysisJob(job, fileStoreID, cores=2): +def analysisJob(job, fileStoreID): # now do some analysis on the file pass diff --git a/src/toil/test/docs/scripts/tutorial_staging.py b/src/toil/test/docs/scripts/tutorial_staging.py index 5436fb2e52..e5f6e27fc9 100644 --- a/src/toil/test/docs/scripts/tutorial_staging.py +++ b/src/toil/test/docs/scripts/tutorial_staging.py @@ -7,7 +7,7 @@ class HelloWorld(Job): def __init__(self, id): - Job.__init__(self, memory="2G", cores=2, disk="3G") + Job.__init__(self) self.inputFileID = id def run(self, fileStore): diff --git a/src/toil/test/src/helloWorldTest.py b/src/toil/test/src/helloWorldTest.py index a1545a53b9..27cfd96e45 100644 --- a/src/toil/test/src/helloWorldTest.py +++ b/src/toil/test/src/helloWorldTest.py @@ -24,7 +24,7 @@ def testHelloWorld(self): class HelloWorld(Job): def __init__(self): - Job.__init__(self, memory=100000, cores=2, disk="3G") + Job.__init__(self, memory=100000, cores=1, disk="3G") def run(self, fileStore): fileID = self.addChildJobFn(childFn, cores=1, memory="1M", disk="3G").rv() diff --git a/src/toil/test/src/realtimeLoggerTest.py b/src/toil/test/src/realtimeLoggerTest.py index efce03ffac..7caf67eba9 100644 --- a/src/toil/test/src/realtimeLoggerTest.py +++ b/src/toil/test/src/realtimeLoggerTest.py @@ -57,7 +57,7 @@ def emit(self, record): class LogTest(Job): def __init__(self): - Job.__init__(self, memory=100000, cores=2, disk='3G') + Job.__init__(self, memory=100000, cores=1, disk='3G') def run(self, fileStore): RealtimeLogger.info('This should be logged at info level') diff --git a/src/toil/test/src/toilContextManagerTest.py b/src/toil/test/src/toilContextManagerTest.py index e2eea096bf..4691303b19 100644 --- a/src/toil/test/src/toilContextManagerTest.py +++ b/src/toil/test/src/toilContextManagerTest.py @@ -61,10 +61,10 @@ def testExportAfterFailedExport(self): class HelloWorld(Job): def __init__(self): - Job.__init__(self, memory=100000, cores=2, disk='1M') + Job.__init__(self, memory=100000, disk='1M') def run(self, fileStore): - fileID = self.addChildJobFn(childFn, cores=1, memory='1M', disk='1M').rv() + fileID = self.addChildJobFn(childFn, memory='1M', disk='1M').rv() return self.addFollowOn(FollowOn(fileID)).rv() diff --git a/src/toil/test/src/userDefinedJobArgTypeTest.py b/src/toil/test/src/userDefinedJobArgTypeTest.py index 9678222a52..9c1183a72c 100644 --- a/src/toil/test/src/userDefinedJobArgTypeTest.py +++ b/src/toil/test/src/userDefinedJobArgTypeTest.py @@ -59,7 +59,7 @@ def _testFromMain(self): class JobClass(Job): def __init__(self, level, foo): - Job.__init__(self, memory=100000, cores=2, disk="300M") + Job.__init__(self, memory=100000, cores=1, disk="300M") self.level = level self.foo = foo