-
Notifications
You must be signed in to change notification settings - Fork 11
/
blocks.py
54 lines (51 loc) · 1.45 KB
/
blocks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import os
def return_slack_blocks(report_file: str):
task_text = f"*Task*: {os.getenv('GITHUB_REF_NAME')}"
owner_text = f"*Owner*: {os.getenv('GITHUB_ACTOR')}"
commit_text = f"*Commit*: https://github.com/mozilla/fx-desktop-qa-automation/commit/{os.getenv('GITHUB_SHA')}"
test_summary_text = f"*Test Summary*: {report_file} :debug:"
return [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "firefox-desktop :firefox: Smoke Tests Mac & Windows\n",
},
},
{"type": "divider"},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": task_text,
},
},
{
"type": "section",
"text": {"type": "mrkdwn", "text": owner_text},
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": commit_text,
},
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": test_summary_text,
},
},
{"type": "divider"},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": ":testops-notify: created by Desktop QA Test Engineering",
}
],
},
]