| 58 | return True |
| 59 | |
| 60 | def commentOn(commentUrl, success, inMerge, needTests, linkUrl): |
| 61 | common_message = """ |
| 62 | This 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/ |
| 63 | Contact 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 | |
| 83 | This 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 | |
| 87 | This could happen for one of several reasons: |
| 88 | 1. 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) |
| 89 | 2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time |
| 90 | 3. It does not build on either Linux i386 or Win32 (via MinGW cross compile) |
| 91 | 4. The test suite fails on either Linux i386 or Win32 |
| 92 | 5. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java) |
| 93 | |
| 94 | If 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 | |
| 99 | def testpull(number, comment_url, clone_url, commit): |
| 100 | print("Testing pull %d: %s : %s"%(number, clone_url,commit)) |