mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-mxnet-ci] ChaiBapchya commented on a change in pull request #27: Serverless based Lambda function for Labelling PRs based on CI & PR Review status
Date Sun, 13 Sep 2020 05:05:44 GMT

ChaiBapchya commented on a change in pull request #27:
URL: https://github.com/apache/incubator-mxnet-ci/pull/27#discussion_r487467369



##########
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:
       Addressed in the script test: https://github.com/apache/incubator-mxnet-ci/blob/6131b9df5b1528661ec1991da90b3704c91f3c74/services/lambda-pr-status-labeler/pr_status_bot/test_mock.py#L64-L70




----------------------------------------------------------------
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:
users@infra.apache.org



Mime
View raw message