-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
168 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dummy body of the summary PR comment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
This should be called via nodejs from the repo root folder. | ||
node .github/scripts/pr_comment.test.js | ||
This is just a poor man's testing code for the script. | ||
Since the project is mostly python, is not easy to add nodeenv and a full | ||
testing suite like jest. | ||
*/ | ||
const process = require('process'); | ||
|
||
process.env.GITHUB_WORKSPACE = process.cwd() | ||
process.env.COMMENT_BODY = '.github/scripts/pr_comment.test.body.txt' | ||
process.env.REPORT_JSON = '.github/scripts/pr_comment.test.report.json' | ||
process.env.COMMENT_MARKER = '<!--- comment-marker -->' | ||
|
||
const script = require(process.cwd() + '/.github/scripts/pr_comment.js') | ||
const retry_delay = 0.1 | ||
|
||
var github = { | ||
issues: { | ||
listComments: (options) => { | ||
console.log('Retrieving comments...') | ||
console.log(options) | ||
return {data: [ | ||
{'id': 980, 'body': 'some-other-comment'}, | ||
// Comment the line below to trigger creating a new comment. | ||
{'id': 456, 'body': 'comment marker\n<!--- comment-marker -->'}, | ||
{'body': 'another-other-comment'}, | ||
|
||
]} | ||
}, | ||
updateComment: (options) => { | ||
console.log('Updating existing comment...') | ||
console.log(options) | ||
}, | ||
createComment: (options) => { | ||
console.log('Creating new comment...') | ||
console.log(options) | ||
}, | ||
}, | ||
pulls: { | ||
listReviews: (options) => { | ||
console.log('Listing existing revies...') | ||
console.log(options) | ||
return {data: [ | ||
{'id': 120, 'body': 'some-other-pr-review'}, | ||
// Comment the line below to trigger creating a new comment. | ||
{'id': 156, 'body': 'review marker\n<!--- comment-marker -->'}, | ||
]} | ||
}, | ||
createReview: (options) => { | ||
console.log('Creating new review...') | ||
console.log(options) | ||
}, | ||
}, | ||
} | ||
|
||
var context = { | ||
eventName: 'pull_request', | ||
repo: { | ||
owner: 'dummy-org', | ||
repo: 'dummy-repo', | ||
}, | ||
payload: { | ||
number: 123, | ||
after: '123abc567', | ||
} | ||
} | ||
|
||
|
||
script({github, context, process, retry_delay}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"report_name": "File generate by diff-cover --json-report out.json", "diff_name": "trunk...HEAD, staged and unstaged changes", "src_stats": {"src/towncrier/build.py": {"percent_covered": 22.222222222222214, "violation_lines": [123, 125, 126, 138, 140, 141, 142], "violations": [[123, null], [125, null], [126, null], [138, null], [140, null], [141, null], [142, null]]}}, "total_num_lines": 9, "total_num_violations": 7, "total_percent_covered": 22, "num_changed_lines": 185} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.