Skip to content

Commit

Permalink
Adding a screenshot task to fail early
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Oct 2, 2024
1 parent 1bbe117 commit 74b9917
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .evergreen/buildvariants-and-tasks.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ tasks:
- func: install
- func: bootstrap
- func: check

- name: test
tags:
- required-for-publish
Expand Down Expand Up @@ -456,6 +455,7 @@ tasks:
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
commands:
- func: screencapture
- func: prepare
- func: install
- func: bootstrap
Expand Down
3 changes: 3 additions & 0 deletions .evergreen/buildvariants-and-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1509,6 +1509,7 @@ tasks:
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
commands:
- func: screencapture
- func: prepare
- func: install
- func: bootstrap
Expand All @@ -1534,6 +1535,7 @@ tasks:
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
commands:
- func: screencapture
- func: prepare
- func: install
- func: bootstrap
Expand All @@ -1559,6 +1561,7 @@ tasks:
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
commands:
- func: screencapture
- func: prepare
- func: install
- func: bootstrap
Expand Down
27 changes: 27 additions & 0 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,33 @@ functions:
echo "Run static analysis..."
npm run check-ci
# For the time being this is a MacOS-only task
# If this fails, it's likely the Mac is not logged into a graphical shell.
screencapture:
- command: shell.exec
params:
shell: bash
script: |
set -e
die() {
echo $1 >&2
exit 1
}
if [[ $(uname) == Darwin ]]; then
screencapture ./screencapture.png || die "Screen capturing failed and it's likely that the host is not logged into a graphical shell. Post this in #ask-devprod-evergreen or create a 'Runtime Environments' DEVPROD ticket on Jira."
else
echo "Screen capturing is skipped on non-MacOS hosts"
fi
- command: s3.put
params:
<<: *save-artifact-params-private
local_file: screencapture.png
optional: true # Fails on non-MacOS hosts
remote_file: ${project}/${revision}_${revision_order_id}/screencapture.png
content_type: image/png

test:
- command: shell.exec
# Fail the task if it's idle for 10 mins
Expand Down

0 comments on commit 74b9917

Please sign in to comment.