Skip to content

Commit 7b97f0a

Browse files
kmarstellerkmarsteller
authored andcommitted
Integrate test results into Slack.
1 parent e5fb4af commit 7b97f0a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

openmdao_testapp/post_receive.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,15 @@ def process_results(commit_id, returncode, results_dir, output):
384384
returncode = -1
385385
docout = str(err)
386386

387+
#Integrate test results to POST into a slack channel.
388+
import requests
389+
url = "https://openmdao.slack.com/services/hooks/incoming-webhook?token=hDJ2XPGqNj69P47il5rpekUV"
390+
status = 'TESTS SUCCEEDED: ' if returncode == 0 else 'TESTS FAILED: '
391+
slack_msg = status+msg
392+
payload = {"text":slack_msg}
393+
r = requests.post(url, data=json.dumps(payload))
394+
395+
#Still send mail, may remove this later, and just use Slack
387396
send_mail(commit_id, returncode, output+docout+msg)
388397

389398
def start_server():

0 commit comments

Comments
 (0)