Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Slack notification for UI/Unit test failures #20793

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/cache-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.15.1
- automattic/a8c-ci-toolkit#2.17.0
- automattic/git-s3-cache#1.1.4:
bucket: "a8c-repo-mirrors"
repo: "automattic/wordpress-ios/"
Expand Down
7 changes: 6 additions & 1 deletion .buildkite/commands/run-ui-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ else
echo "The UI Tests, ran during the '🔬 Testing' step above, have failed."
echo "For more details about the failed tests, check the Buildkite annotation, the logs under the '🔬 Testing' section and the \`.xcresult\` and test reports in Buildkite artifacts."
fi
annotate_test_failures "build/results/JetpackUITests.xml"

if [[ $BUILDKITE_BRANCH == trunk ]] || [[ $BUILDKITE_BRANCH == release/* ]]; then
annotate_test_failures "build/results/JetpackUITests.xml" --slack "build-and-ship"
else
annotate_test_failures "build/results/JetpackUITests.xml"
fi

exit $TESTS_EXIT_STATUS
7 changes: 6 additions & 1 deletion .buildkite/commands/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ else
echo "The Unit Tests, ran during the '🔬 Testing' step above, have failed."
echo "For more details about the failed tests, check the Buildkite annotation, the logs under the '🔬 Testing' section and the \`.xcresult\` and test reports in Buildkite artifacts."
fi
annotate_test_failures "build/results/WordPress.xml"

if [[ $BUILDKITE_BRANCH == trunk ]] || [[ $BUILDKITE_BRANCH == release/* ]]; then
annotate_test_failures "build/results/WordPress.xml" --slack "build-and-ship"
else
annotate_test_failures "build/results/WordPress.xml"
fi

exit $TESTS_EXIT_STATUS
14 changes: 1 addition & 13 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.15.1
- automattic/a8c-ci-toolkit#2.17.0
- automattic/git-s3-cache#1.1.4:
bucket: "a8c-repo-mirrors"
repo: "automattic/wordpress-ios/"
Expand Down Expand Up @@ -73,10 +73,6 @@ steps:
notify:
- github_commit_status:
context: "Unit Tests"
- slack:
channels:
- "#mobile-apps-tests-notif"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking that it was intentional (and not a copy/paste typo) that you changed the channel used in the call to annotate_test_failures and now send the notification to #build-and-ship… while previously it was sent to this other channel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for checking! yup this is intentional. speaking with @pachlava and @tiagomar, we decided to post this on #build-and-ship since that's the channel we're monitoring now - better to have it in one channel rather than multiple. with this, we would immediately know if a build is failing because of tests or other steps from this notification

if: build.state == "failed" && build.branch == "trunk"

#################
# UI Tests
Expand All @@ -94,10 +90,6 @@ steps:
notify:
- github_commit_status:
context: "UI Tests (iPhone)"
- slack:
channels:
- "#mobile-apps-tests-notif"
if: build.state == "failed" && build.branch == "trunk"

- label: "🔬 :jetpack: UI Tests (iPad)"
command: .buildkite/commands/run-ui-tests.sh 'iPad Air (5th generation)'
Expand All @@ -110,10 +102,6 @@ steps:
notify:
- github_commit_status:
context: "UI Tests (iPad)"
- slack:
channels:
- "#mobile-apps-tests-notif"
if: build.state == "failed" && build.branch == "trunk"

#################
# Linters
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.15.1
- automattic/a8c-ci-toolkit#2.17.0
- automattic/git-s3-cache#1.1.4:
bucket: "a8c-repo-mirrors"
repo: "automattic/wordpress-ios/"
Expand Down