marcoabreu commented on a change in pull request #27:
URL: https://github.com/apache/incubator-mxnet-ci/pull/27#discussion_r475180129
##########
File path: services/lambda-pr-status-labeler/pr_status_bot/test.py
##########
@@ -0,0 +1,92 @@
+import json
+import os
+from PRStatusBot import PRStatusBot
+
+
+def load_and_test(data):
+ payload_json = json.loads(data)
+ os.environ["AWS_PROFILE"] = "mxnet-ci"
Review comment:
Does this test against the real repo? I'm not that big of a fan of
hitting servers when executing unit tests. They should be self enclosed.
##########
File path: services/lambda-pr-status-labeler/pr_status_bot/test.py
##########
@@ -0,0 +1,92 @@
+import json
+import os
+from PRStatusBot import PRStatusBot
+
+
+def load_and_test(data):
+ payload_json = json.loads(data)
+ os.environ["AWS_PROFILE"] = "mxnet-ci"
+ # set secret_name [commented since it is to be redacted]
+ # os.environ["secret_name"]
+ os.environ["region_name"] = "us-west-2"
+ pr_status_bot = PRStatusBot("apache/incubator-mxnet", apply_secret=True)
+ pr_status_bot.parse_payload(payload_json)
+
+
+def prepare_input(pr_num, context, state, sha):
+ data = {
+ "target_url": "PR-" + str(pr_num),
+ "context": "ci/jenkins/mxnet-validation/" + context,
+ "state": state,
+ "commit": {
+ "sha": sha
+ }
+ }
+ # return serialized data dictionary
+ return json.dumps(data)
+
+
+def check_ci_failure():
+ data = prepare_input(18984, "website", "failed",
"6fbfa3c020e566c0d54825cbfb67abca1d70b4fa")
+ load_and_test(data)
Review comment:
You are just executing the bot, but you are not actually validating
anything besides if it throws an exception.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]