From 2118dff694ee5c0b642a1ae8d5b623242adedd0c Mon Sep 17 00:00:00 2001 From: Kien Ha Date: Tue, 5 Jul 2016 21:12:43 -0400 Subject: [PATCH] Update TestFairy plugin - Update documentation - Add valid options to max-duration, screenshot-interval, and video-quality - Test max-duration, screenshot-interval, and video-quality options Change-Id: If010e7bc79e269b766107a5b2e57b9916ca8637d Signed-off-by: Kien Ha --- jenkins_jobs/modules/helpers.py | 9 ++++++--- jenkins_jobs/modules/publishers.py | 19 +++++++++++++++++-- .../fixtures/test-fairy-android002.xml | 6 +++--- .../fixtures/test-fairy-android002.yaml | 3 +++ .../publishers/fixtures/test-fairy-ios002.xml | 8 ++++---- .../fixtures/test-fairy-ios002.yaml | 3 +++ 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/jenkins_jobs/modules/helpers.py b/jenkins_jobs/modules/helpers.py index 51ad2a109..a5b565209 100644 --- a/jenkins_jobs/modules/helpers.py +++ b/jenkins_jobs/modules/helpers.py @@ -448,6 +448,9 @@ def append_git_revision_config(parent, config_def): def test_fairy_common(xml_element, data): xml_element.set('plugin', 'TestFairy') + valid_max_duration = ['10m', '60m', '300m', '1440m'] + valid_interval = [1, 2, 5] + valid_video_quality = ['high', 'medium', 'low'] mappings = [ # General @@ -457,13 +460,13 @@ def test_fairy_common(xml_element, data): ('notify-testers', 'notifyTesters', True), ('autoupdate', 'autoUpdate', True), # Session - ('max-duration', 'maxDuration', '10m'), + ('max-duration', 'maxDuration', '10m', valid_max_duration), ('record-on-background', 'recordOnBackground', False), ('data-only-wifi', 'dataOnlyWifi', False), # Video ('video-enabled', 'isVideoEnabled', True), - ('screenshot-interval', 'screenshotInterval', '1'), - ('video-quality', 'videoQuality', 'high'), + ('screenshot-interval', 'screenshotInterval', 1, valid_interval), + ('video-quality', 'videoQuality', 'high', valid_video_quality), # Metrics ('cpu', 'cpu', True), ('memory', 'memory', True), diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 1a583bfa2..04f9e15e2 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -2881,14 +2881,29 @@ def test_fairy(parser, xml_parent, data): :arg bool notify-testers: Send email with changelogs to testers (default false) :arg bool autoupdate: Automatic update (default false) - :arg str max-duration: Duration of the session (default 10m) + + :max-duration values: + * **10m** + * **60m** + * **300m** + * **1440m** :arg bool record-on-background: Record on background (default false) :arg bool data-only-wifi: Record data only in wifi (default false) :arg bool video-enabled: Record video (default true) - :arg str screenshot-interval: Time interval between screenshots + :arg int screenshot-interval: Time interval between screenshots (default 1) + + :screenshot-interval values: + * **1** + * **2** + * **5** :arg str video-quality: Video quality (default high) + + :video-quality values: + * **high** + * **medium** + * **low** :arg bool cpu: Enable CPU metrics (default true) :arg bool memory: Enable memory metrics (default true) :arg bool logs: Enable logs metrics (default true) diff --git a/tests/publishers/fixtures/test-fairy-android002.xml b/tests/publishers/fixtures/test-fairy-android002.xml index 964f10751..23d53b2e0 100644 --- a/tests/publishers/fixtures/test-fairy-android002.xml +++ b/tests/publishers/fixtures/test-fairy-android002.xml @@ -7,12 +7,12 @@ false false - 10m + 300m false false true - 1 - high + 2 + low false false false diff --git a/tests/publishers/fixtures/test-fairy-android002.yaml b/tests/publishers/fixtures/test-fairy-android002.yaml index 7186dc549..823054e36 100644 --- a/tests/publishers/fixtures/test-fairy-android002.yaml +++ b/tests/publishers/fixtures/test-fairy-android002.yaml @@ -6,6 +6,9 @@ publishers: keystorepath: /tmp/keystorefile notify-testers: false autoupdate: false + max-duration: 300m + screenshot-interval: 2 + video-quality: low cpu: false memory: false logs: false diff --git a/tests/publishers/fixtures/test-fairy-ios002.xml b/tests/publishers/fixtures/test-fairy-ios002.xml index d8e07e2b9..e6f92ea0d 100644 --- a/tests/publishers/fixtures/test-fairy-ios002.xml +++ b/tests/publishers/fixtures/test-fairy-ios002.xml @@ -7,12 +7,12 @@ false false - 10m + 1440m false false true - 1 - high + 5 + medium false false false @@ -26,4 +26,4 @@ - \ No newline at end of file + diff --git a/tests/publishers/fixtures/test-fairy-ios002.yaml b/tests/publishers/fixtures/test-fairy-ios002.yaml index 55eac3662..7e81f1e1a 100644 --- a/tests/publishers/fixtures/test-fairy-ios002.yaml +++ b/tests/publishers/fixtures/test-fairy-ios002.yaml @@ -5,6 +5,9 @@ publishers: appfile: /tmp/appfile.ipa notify-testers: false autoupdate: false + max-duration: 1440m + screenshot-interval: 5 + video-quality: medium cpu: false memory: false logs: false