-
Notifications
You must be signed in to change notification settings - Fork 1.3k
cron-job-ui-screenshots #12423
cron-job-ui-screenshots #12423
Conversation
@@ -32,3 +32,9 @@ jobs: | |||
treeherder-symbol: bump-ac | |||
target-tasks-method: bump_android_components | |||
when: [{hour: 14, minute: 0}] | |||
- name: ui-test-screenshots-x86 | |||
job: | |||
type: decision-task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AaronMT not sure if this has to be the type...since there is no need for this task to appear in the decission tasks list for each PR/merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure (@rpappalax ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the right type for this use case. There is another supported value, for instance: https://searchfox.org/mozilla-central/rev/af5cff556a9482d7aa2267a82f2ccfaf18e797e9/.cron.yml#303. That said, I had to search deeply to make sure there was another type. I don't know the story behind it.
.cron.yml
Outdated
type: decision-task | ||
treeherder-symbol: ui-test-screenshots-x86-D | ||
target-tasks-method: ui-test-screenshots-x86 | ||
when: [{hour: 4, minute: 0}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is to run the task daily at that time, is it possible to set the run to once a week for example? I don't think is necessary to run them daily...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://fossies.org/linux/firefox/taskcluster/docs/cron.rst
e.g, Mondays and Thursdays at 10 AM
when:
- {weekday: 'Monday', hour: 10, minute: 0}
- {weekday: 'Thursday', hour: 10, minute: 0}
taskcluster/ci/ui-test/kind.yml
Outdated
- [wget, {artifact-reference: '<signing-android-test/public/build/noarch/geckoNightly/target.apk>'}, '-O', android-test.apk] | ||
- [automation/taskcluster/androidTest/ui-test.sh, x86-screenshots-tests, app-x86.apk, android-test.apk, '-1'] | ||
|
||
secrets: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could move part of this to the job-defaults...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'-1' (shard override) to the script not supported anymore on latest Flank -> 50 (?) or anything more than -1
fenix/taskcluster/ci/ui-test/kind.yml
Line 31 in 8b34f37
- [automation/taskcluster/androidTest/ui-test.sh, x86, app.apk, android-test.apk, '50'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could move part of this to the job-defaults...
I agree! As far as I can see, most of the job has common values with x86-debug
. Since these are the only 2 jobs, I think we can factorize every common bit into job-defaults
.
taskcluster/ci/ui-test/kind.yml
Outdated
@@ -52,3 +52,42 @@ jobs: | |||
path: /builds/worker/artifacts | |||
type: directory | |||
worker-type: b-android | |||
ui-test-screenshots-x86: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AaronMT @rpappalax so that this task does not run as a build task and so be a build blocker, should I create a new folder in taskcluster/ci/ui-test-screenshots/ and put there the kind.yml for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is great! We put job that have about the same values in the same kind. We're in this case here, so let's keep this ui-test-screenshots-x86
in this kind.yml
🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Rename ui-test-screenshots-x86
into screenshots-x86
. I just realized the name of the task looks odd otherwise: https://firefox-ci-tc.services.mozilla.com/tasks/Rbj7yALeQy--ZhDx6kMmcw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch is definitely headed in the right direction! 😃 There are a couple more things to make it work. Good news is: you can test your patch out. I left some explanations down below. That said, I know the documentation is partial so feel free to ask me if you have any questions!
I'm happy to review this patch later to make sure it lands safe and sound!
@@ -32,3 +32,9 @@ jobs: | |||
treeherder-symbol: bump-ac | |||
target-tasks-method: bump_android_components | |||
when: [{hour: 14, minute: 0}] | |||
- name: ui-test-screenshots-x86 | |||
job: | |||
type: decision-task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the right type for this use case. There is another supported value, for instance: https://searchfox.org/mozilla-central/rev/af5cff556a9482d7aa2267a82f2ccfaf18e797e9/.cron.yml#303. That said, I had to search deeply to make sure there was another type. I don't know the story behind it.
taskcluster/ci/ui-test/kind.yml
Outdated
- [wget, {artifact-reference: '<signing-android-test/public/build/noarch/geckoNightly/target.apk>'}, '-O', android-test.apk] | ||
- [automation/taskcluster/androidTest/ui-test.sh, x86-screenshots-tests, app-x86.apk, android-test.apk, '-1'] | ||
|
||
secrets: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could move part of this to the job-defaults...
I agree! As far as I can see, most of the job has common values with x86-debug
. Since these are the only 2 jobs, I think we can factorize every common bit into job-defaults
.
taskcluster/ci/ui-test/kind.yml
Outdated
@@ -52,3 +52,42 @@ jobs: | |||
path: /builds/worker/artifacts | |||
type: directory | |||
worker-type: b-android | |||
ui-test-screenshots-x86: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is great! We put job that have about the same values in the same kind. We're in this case here, so let's keep this ui-test-screenshots-x86
in this kind.yml
🙂
taskcluster/ci/ui-test/kind.yml
Outdated
signing-android-test: signing-android-test-debug | ||
description: Run UI screenshots tests to keep them up to date | ||
include-pull-request-number: true | ||
#run-on-tasks-for: [github-pull-request, github-push] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Let's be explicit that we don't run this job in regular graphs.
#run-on-tasks-for: [github-pull-request, github-push] | |
run-on-tasks-for: [] |
.cron.yml
Outdated
job: | ||
type: decision-task | ||
treeherder-symbol: ui-test-screenshots-x86-D | ||
target-tasks-method: ui-test-screenshots-x86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to a new entry in target_tasks.py
, just like this one:
fenix/taskcluster/fenix_taskgraph/target_tasks.py
Lines 68 to 75 in 4624bf5
@_target_task("bump_android_components") | |
def target_tasks_bump_android_components(full_task_graph, parameters, graph_config): | |
"""Select the set of tasks required to update android components.""" | |
def filter(task, parameters): | |
return task.attributes.get("bump-type", "") == "android-components" | |
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)] |
I recommend something like:
@_target_task("screenshots")
def target_tasks_screnshots(full_task_graph, parameters, graph_config):
"""Select the set of tasks required to generate screenshots on a real devive."""
def filter(task, parameters):
return task.attributes.get("screenshots", False)
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]
Speaking of which, I don't think this task needs to have a long name. We may for instance want to generate screenshots on another platform. In this case, everything can happen in the same graph, which means it gets scheduled by the same decision task. So I think we can name it screenshots
:
target-tasks-method: ui-test-screenshots-x86 | |
target-tasks-method: screenshots |
What do you think?
By the way, you can test this change, by applying https://github.com/mozilla-mobile/shared-docs/blob/master/android/taskcluster_guide.md#how-do-i-run-a-staging-nightlyrelease-on-prs. In this case, try_task_config.json
should look like:
{
"parameters": {
"optimize_target_tasks": true,
"target_tasks_method": "screenshots"
},
"version": 2
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah! I can rename it :) only here or that name has to be consistent also in the kind.yml file too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to change kind.yml
. target-task-method
just applies to target_tasks.py
taskcluster/ci/ui-test/kind.yml
Outdated
@@ -52,3 +52,42 @@ jobs: | |||
path: /builds/worker/artifacts | |||
type: directory | |||
worker-type: b-android | |||
ui-test-screenshots-x86: | |||
attributes: | |||
build-type: debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: add
screenshots: true
@JohanLorenzo I did the changes requested, how does it look like now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch looks great to me! I looked at the Taskcluster part and I just see a few nits. The job looks to be correctly executed, which is awesome!
I think we want to expose screenshots, which can easily be done by putting them in /builds/worker/artifacts/
. This has to be done in the shell script, which I don't know really much. I leave that part of the review to a QA person 🙂
taskcluster/ci/ui-test/kind.yml
Outdated
@@ -52,3 +52,42 @@ jobs: | |||
path: /builds/worker/artifacts | |||
type: directory | |||
worker-type: b-android | |||
ui-test-screenshots-x86: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Rename ui-test-screenshots-x86
into screenshots-x86
. I just realized the name of the task looks odd otherwise: https://firefox-ci-tc.services.mozilla.com/tasks/Rbj7yALeQy--ZhDx6kMmcw
taskcluster/ci/ui-test/kind.yml
Outdated
- [automation/taskcluster/androidTest/ui-test.sh, x86-screenshots-tests, app.apk, android-test.apk, '-1'] | ||
treeherder: | ||
kind: test | ||
platform: 'ui-test-screenshots-x86/opt' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Let's keep the same platform as the regular UI-tests. Per se, those tests do run on the same platform. We can easily know which one is the screenshot job thanks to the TH symbol.
taskcluster/ci/ui-test/kind.yml
Outdated
treeherder: | ||
kind: test | ||
platform: 'ui-test-screenshots-x86/opt' | ||
symbol: debug(ui-test-screenshots-x86) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Let's make this name simpler by just naming it screenshots-x86
. We might want to bake "x86: into the TH platform, but it can be done in a followup.
taskcluster/ci/ui-test/kind.yml
Outdated
kind: test | ||
platform: 'ui-test-screenshots-x86/opt' | ||
symbol: debug(ui-test-screenshots-x86) | ||
tier: 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This can be factorized in job-defaults
|
||
@_target_task("screenshots") | ||
def target_tasks_screnshots(full_task_graph, parameters, graph_config): | ||
"""Select the set of tasks required to generate screenshots on a real devive.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
"""Select the set of tasks required to generate screenshots on a real devive.""" | |
"""Select the set of tasks required to generate screenshots on a real device.""" |
@@ -80,6 +80,8 @@ elif [[ "${device_type}" == "x86-start-test" ]]; then | |||
flank_template="${PATH_TEST}/flank-x86-start-test.yml" | |||
elif [[ "${device_type}" == "arm-start-test" ]]; then | |||
flank_template="${PATH_TEST}/flank-armeabi-v7a-start-test.yml" | |||
elif [[ "${device_type}" == "x86-screenshots-tests" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/builds/worker/artifacts/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this task does not get the screenshots, it only runs the tests. What we could expose there is the test results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, then it seems we're all done, I see some test results publihsed https://firefox-ci-tc.services.mozilla.com/tasks/Rbj7yALeQy--ZhDx6kMmcw#artifacts 😃
@JohanLorenzo I think I did all the requested changes 😅 |
c23b614
to
6d42e3f
Compare
Codecov Report
@@ Coverage Diff @@
## master #12423 +/- ##
============================================
+ Coverage 24.95% 24.98% +0.03%
Complexity 836 836
============================================
Files 389 389
Lines 15657 15657
Branches 2022 2022
============================================
+ Hits 3907 3912 +5
+ Misses 11439 11432 -7
- Partials 311 313 +2
Continue to review full report at Codecov.
|
The force hook will be added in https://phabricator.services.mozilla.com/D83791. In the meantime, I made it available at https://firefox-ci-tc.services.mozilla.com/hooks/project-releng/cron-task-mozilla-mobile-fenix%2Fscreenshots, but this link may disappear next time |
The aim of this PR is to set a cron job so that the ui screenshots tests run daily/weekly to be sure they are not broken and so, ready to be run when needed to get the app screenshots requested.
Pull Request checklist
After merge
To download an APK when reviewing a PR: