avocado.core.spawners package¶
Submodules¶
avocado.core.spawners.common module¶
-
class
avocado.core.spawners.common.
BaseSpawner
¶ Bases:
object
Defines an interface to be followed by all implementations.
-
METHODS
= []¶
-
bytes_from_file
(filename)¶ Read bytes from a files in binary mode.
This is a helpful method to read local files bytes efficiently.
If the spawner that you are implementing needs access to local file, feel free to use this method.
-
static
is_task_alive
(task)¶
-
spawn_task
(task)¶
-
stream_output
(job_id, task_id)¶ Returns output files streams in binary mode from a task.
This method will find for output files generated by a task and will return a generator with tuples, each one containing a filename and bytes.
You need to provide in your spawner a stream_output() method if this one is not suitable for your spawner. i.e: if the spawner is trying to access a remote output file.
-
-
class
avocado.core.spawners.common.
SpawnMethod
¶ Bases:
enum.Enum
The method employed to spawn a runnable or task.
-
ANY
= <object object>¶ Spawns with any method available, that is, it doesn’t declare or require a specific spawn method
-
PYTHON_CLASS
= <object object>¶ Spawns by running executing Python code, that is, having access to a runnable or task instance, it calls its run() method.
-
STANDALONE_EXECUTABLE
= <object object>¶ Spawns by running a command, that is having either a path to an executable or a list of arguments, it calls a function that will execute that command (such as with os.system())
-
avocado.core.spawners.exceptions module¶
avocado.core.spawners.mock module¶
-
class
avocado.core.spawners.mock.
MockRandomAliveSpawner
¶ Bases:
avocado.core.spawners.mock.MockSpawner
A mocking spawner that simulates randomness about tasks being alive.
-
is_task_alive
(task)¶
-
-
class
avocado.core.spawners.mock.
MockSpawner
¶ Bases:
avocado.core.spawners.common.BaseSpawner
A mocking spawner that performs no real operation.
Tasks asked to be spawned by this spawner will initially reported to be alive, and on the next check, will report not being alive.
-
METHODS
= [<SpawnMethod.PYTHON_CLASS: <object object>>, <SpawnMethod.STANDALONE_EXECUTABLE: <object object>>]¶
-
is_task_alive
(task)¶
-
spawn_task
(task)¶
-
avocado.core.spawners.podman module¶
avocado.core.spawners.process module¶
-
class
avocado.core.spawners.process.
ProcessSpawner
¶ Bases:
avocado.core.spawners.common.BaseSpawner
-
METHODS
= [<SpawnMethod.STANDALONE_EXECUTABLE: <object object>>]¶
-
static
is_task_alive
(task)¶
-
spawn_task
(task)¶
-