mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 05:28:48 +00:00
validate:launcher: Do not dump to big log files
Avoiding ' The script exceeded the maximum execution time set for the job' in GitLab
This commit is contained in:
parent
1d52eb0260
commit
7161b21334
2 changed files with 11 additions and 0 deletions
validate/launcher
|
@ -175,6 +175,15 @@ class Test(Loggable):
|
||||||
self.kill_subprocess()
|
self.kill_subprocess()
|
||||||
self.process = None
|
self.process = None
|
||||||
|
|
||||||
|
def should_dump_on_failure(self):
|
||||||
|
if not self.options.dump_on_failure:
|
||||||
|
return False
|
||||||
|
|
||||||
|
try:
|
||||||
|
return os.path.getsize(self.logfile) < self.options.max_dump_size * 1024 * 1024
|
||||||
|
except FileNotFoundError:
|
||||||
|
return False
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
string = self.classname
|
string = self.classname
|
||||||
if self.result != Result.NOT_RUN:
|
if self.result != Result.NOT_RUN:
|
||||||
|
|
|
@ -464,6 +464,8 @@ class LauncherConfig(Loggable):
|
||||||
action="store_true", default=False,
|
action="store_true", default=False,
|
||||||
help="Dump logs to stdout when a test fails."
|
help="Dump logs to stdout when a test fails."
|
||||||
" Note that mdv is used to enhance output if avalaible, install with `pip install mdv`.")
|
" Note that mdv is used to enhance output if avalaible, install with `pip install mdv`.")
|
||||||
|
parser.add_argument("--max-dump-size", dest="max_dump_size", type=float,
|
||||||
|
default=0.5, help="Maximum size of logs to dump on stdout in MB.")
|
||||||
parser.add_argument("-c", "--config", dest="config",
|
parser.add_argument("-c", "--config", dest="config",
|
||||||
help="This is DEPRECATED, prefer using the testsuite format"
|
help="This is DEPRECATED, prefer using the testsuite format"
|
||||||
" to configure testsuites")
|
" to configure testsuites")
|
||||||
|
|
Loading…
Reference in a new issue