jobflow_remote.testing package#
Submodules#
Module contents#
A series of toy workflows that can be used for testing.
- class jobflow_remote.testing.EnumMaker(e: jobflow_remote.testing.TestEnum = <TestEnum.A: 'A'>, name: str = 'enum maker')[source]#
Bases:
Maker
- class jobflow_remote.testing.MyShellIO(blocking=False, stdout_path='stdout', stderr_path='stderr', ps_username_strict=False, username_maxchars=None)[source]#
Bases:
ShellIOConstruct the ShellIO object.
Notes
On Linux, the ‘ps’ command truncates usernames to 7-8 characters, appending a “+” if truncated. To use the full username, set this variable to the desired maximum length. The ‘user’ field in the ps output will then be displayed as “user:NN”, where NN is this value. Previously, the default for the max number of characters for the username was 32. On macOS, usernames are not truncated and there is no option to fix the field width, so the default is now None.
- Parameters:
blocking (bool) – Whether the execution should be blocking.
stdout_path (str or Path) – Path to the standard output file.
stderr_path (str or Path) – Path to the standard error file.
ps_username_strict (bool) – If set to True, the parsing of the username will raise an error if the username is truncated.
username_maxchars (int or None) – Width of the username field for the ps command. Default is None (which is 7-8 characters on Linux). On MacOS, setting the field explicitly is not allowed but the username is never truncated.
- USERNAME_MAXCHARS = 1#
- jobflow_remote.testing.add(a, b)[source]#
Adds two numbers together and writes the answer to a file.
- jobflow_remote.testing.add_big(a: float, b: float)[source]#
Adds two numbers together and inflates the answer to a large list and tries to store that within the defined store.
- jobflow_remote.testing.add_big_undefined_store(a: float, b: float)[source]#
Adds two numbers together and writes the answer to an artificially large file which is attempted to be stored in a undefined store.
- jobflow_remote.testing.add_sleep(a, b)[source]#
Adds two numbers together and sleeps for “b” seconds.
- jobflow_remote.testing.arithmetic(a: float | list[float], b: float | list[float], op: Callable | None = None) float | None[source]#
- jobflow_remote.testing.create_detour(detour_job: Job)[source]#
Create a detour based on the passed Job.
- jobflow_remote.testing.ignore_input(a: int) int[source]#
Can receive an input, but ignores it.
Allows to test flows with failed parents
- jobflow_remote.testing.onmissing_none(args)[source]#
A job that can run even if references are missing