Skip to content

Commit

Permalink
fix(ci): fix notification format (#13740)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel authored Nov 30, 2023
1 parent d826ee1 commit 8a6ca47
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 10 additions & 16 deletions ci/scripts/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# I use `slack_username` since it is more readable, but not officially supported in the docs.
MAIN_CRON_TEST_MAP = {
"test-notify": ["noelkwan", "noelkwan"],
"test-notify-2": ["noelkwan", "noelkwan"],
"backfill-tests": ["noelkwan"],
"backwards-compat-tests": ["noelkwan"],
"fuzz-test": ["noelkwan"],
Expand Down Expand Up @@ -69,7 +70,7 @@ def generate_test_status_message(failed_test_map):
for test, users in failed_test_map.items():
users = " ".join(map(lambda user: f"<@{user}>", users))
messages.append(f"Test {test} failed {users}")
message = "\\n".join(messages)
message = "\n ".join(messages)
return message

def get_buildkite_test_status(test):
Expand All @@ -80,22 +81,14 @@ def get_buildkite_test_status(test):
def get_mock_test_status(test):
mock_test_map = {
"test-notify": "hard_failed",
"test-notify-2": "hard_failed",
"backfill-tests": "",
"backwards-compat-tests": "",
"fuzz-test": "",
"e2e-test-release": "",
"e2e-iceberg-sink-tests": "passed",
"e2e-java-binding-tests": "soft_failed",
"e2e-clickhouse-sink-tests": "",
"e2e-pulsar-sink-tests": "",
"s3-source-test-for-opendal-fs-engine": "",
"pulsar-source-tests": "",
"connector-node-integration-test": ""
}
return mock_test_map[test]

def get_mock_test_status_all_pass(test):
mock_test_map = {
"test-notify": "hard_failed",
"e2e-iceberg-sink-tests": "passed",
"e2e-java-binding-tests": "soft_failed",
"e2e-clickhouse-sink-tests": "",
"e2e-clickhouse-sink-tests": "hard_failed",
"e2e-pulsar-sink-tests": "",
"s3-source-test-for-opendal-fs-engine": "",
"pulsar-source-tests": "",
Expand All @@ -113,7 +106,8 @@ def format_cmd(messages):
- slack:
channels:
- "#notification-buildkite"
message: {messages}
message: |
{messages}
YAML
"""
return cmd
Expand Down
6 changes: 6 additions & 0 deletions ci/workflows/main-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,12 @@ steps:
command: |
bash -c 'echo test && exit -1'
# Notification test.
- key: "test-notify-2"
if: build.pull_request.labels includes "ci/main-cron/test-notify"
command: |
bash -c 'echo test && exit -1'
- wait: true
continue_on_failure: true
allow_dependency_failure: true
Expand Down

0 comments on commit 8a6ca47

Please sign in to comment.