Skip to content

Commit

Permalink
Make slack notification a parameter for connected tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelmcr committed Apr 1, 2020
1 parent 7ada74d commit 513824f
Showing 1 changed file with 15 additions and 32 deletions.
47 changes: 15 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ jobs:
path: Artifacts
destination: Artifacts
Connected Tests:
parameters:
post-to-slack:
description: Post to Slack when tests fail. SLACK_WEBHOOK ENV variable must be set.
type: boolean
default: false
executor:
name: android/default
api-version: "28"
Expand All @@ -119,37 +124,14 @@ jobs:
num-flaky-test-attempts: 2
results-history-name: CircleCI WordPress Connected Tests
- android/save-gradle-cache
- slack/status:
fail_only: true
include_job_number_field: false
include_project_field: false
failure_message: ':red_circle: WordPress Android connected tests failed on \`${CIRCLE_BRANCH}\` branch after merge by ${CIRCLE_USERNAME}. See <https://console.firebase.google.com/u/0/project/api-project-108380595987/testlab/histories/bh.e0c3a59bd9ed670|Firebase console test results> for details.\n\nPlease reach out in #platform9 if you think this failure is not caused by your changes, so we can investigate.'
Optional Connected Tests:
executor:
name: android/default
api-version: "28"
steps:
- git/shallow-checkout
- android/restore-gradle-cache
- copy-gradle-properties
- run:
name: Build
command: ./gradlew WordPress:assembleVanillaDebug WordPress:assembleVanillaDebugAndroidTest --stacktrace
- run:
name: Decrypt credentials
command: openssl aes-256-cbc -md sha256 -d -in .circleci/.firebase.secrets.json.enc -out .circleci/.firebase.secrets.json -k "${FIREBASE_SECRETS_ENCRYPTION_KEY}"
- android/firebase-test:
key-file: .circleci/.firebase.secrets.json
type: instrumentation
apk-path: WordPress/build/outputs/apk/vanilla/debug/org.wordpress.android-vanilla-debug.apk
test-apk-path: WordPress/build/outputs/apk/androidTest/vanilla/debug/org.wordpress.android-vanilla-debug-androidTest.apk
test-targets: notPackage org.wordpress.android.ui.screenshots
device: model=Nexus5X,version=26,locale=en,orientation=portrait
project: api-project-108380595987
timeout: 10m
num-flaky-test-attempts: 2
results-history-name: CircleCI WordPress Connected Tests
- android/save-gradle-cache
- when:
condition: << parameters.post-to-slack >>
steps:
- slack/status:
fail_only: true
include_job_number_field: false
include_project_field: false
failure_message: ':red_circle: WordPress Android connected tests failed on \`${CIRCLE_BRANCH}\` branch after merge by ${CIRCLE_USERNAME}. See <https://console.firebase.google.com/u/0/project/api-project-108380595987/testlab/histories/bh.e0c3a59bd9ed670|Firebase console test results> for details.\n\nPlease reach out in #platform9 if you think this failure is not caused by your changes, so we can investigate.'
WordPressUtils Connected Tests:
executor:
name: android/default
Expand Down Expand Up @@ -203,6 +185,7 @@ workflows:
branches:
ignore: /pull\/[0-9]+/
- Connected Tests:
post-to-slack: true
# Always run connected tests on develop and release branches
filters:
branches:
Expand All @@ -220,5 +203,5 @@ workflows:
- develop
- /^release.*/
- /pull\/[0-9]+/
- Optional Connected Tests:
- Connected Tests:
requires: [Hold]

0 comments on commit 513824f

Please sign in to comment.