MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / commentOn

Function commentOn

qa/pull-tester/pull-tester.py:60–97  ·  view source on GitHub ↗
(commentUrl, success, inMerge, needTests, linkUrl)

Source from the content-addressed store, hash-verified

58 return True
59
60def commentOn(commentUrl, success, inMerge, needTests, linkUrl):
61 common_message = """
62This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
63Contact BlueMatt on freenode if something looks broken."""
64
65 # Remove old BitcoinPullTester comments (I'm being lazy and not paginating here)
66 recentcomments = requests.get(commentUrl+"?sort=created&direction=desc",
67 auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"])).json
68 for comment in recentcomments:
69 if comment["user"]["login"] == os.environ["GITHUB_USER"] and common_message in comment["body"]:
70 requests.delete(comment["url"],
71 auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"]))
72
73 if success == True:
74 if needTests:
75 message = "Automatic sanity-testing: PLEASE ADD TEST-CASES, though technically passed. See " + linkUrl + " for binaries and test log."
76 else:
77 message = "Automatic sanity-testing: PASSED, see " + linkUrl + " for binaries and test log."
78
79 post_data = { "body" : message + common_message}
80 elif inMerge:
81 post_data = { "body" : "Automatic sanity-testing: FAILED MERGE, see " + linkUrl + " for test log." + """
82
83This pull does not merge cleanly onto current master""" + common_message}
84 else:
85 post_data = { "body" : "Automatic sanity-testing: FAILED BUILD/TEST, see " + linkUrl + " for binaries and test log." + """
86
87This could happen for one of several reasons:
881. It chanages changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in qa/pull-tester)
892. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
903. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
914. The test suite fails on either Linux i386 or Win32
925. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)
93
94If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here.
95""" + common_message}
96
97 resp = requests.post(commentUrl, json.dumps(post_data), auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"]))
98
99def testpull(number, comment_url, clone_url, commit):
100 print("Testing pull %d: %s : %s"%(number, clone_url,commit))

Callers 1

testpullFunction · 0.85

Calls 2

postMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected