Skip to content

Commit

Permalink
squash! feat: check Actions and handle doc-only changes
Browse files Browse the repository at this point in the history
Add tests for Jenkins failure and pending
  • Loading branch information
mmarchini committed Aug 14, 2020
1 parent 0f15c61 commit 671b341
Show file tree
Hide file tree
Showing 5 changed files with 687 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/fixtures/comments_with_failed_ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"publishedAt": "2018-10-22T04:16:36.458Z",
"bodyText": "CI: https://ci.nodejs.org/job/node-test-pull-request/15442/"
}
]
6 changes: 6 additions & 0 deletions test/fixtures/comments_with_pending_ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"publishedAt": "2018-10-22T04:16:36.458Z",
"bodyText": "CI: https://ci.nodejs.org/job/node-test-pull-request/32777/"
}
]
16 changes: 16 additions & 0 deletions test/fixtures/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ const approvingReviews = readJSON('reviews_approved.json');
const requestingChangesReviews = readJSON('reviews_requesting_changes.json');

const commentsWithCI = readJSON('comments_with_ci.json');
const commentsWithFailedCI = readJSON('comments_with_failed_ci.json');
const commentsWithLGTM = readJSON('comments_with_lgtm.json');
const commentsWithPendingCI = readJSON('comments_with_pending_ci.json');

const oddCommits = readJSON('odd_commits.json');
const incorrectGitConfigCommits = readJSON('incorrect_git_config_commits.json');
Expand Down Expand Up @@ -99,6 +101,17 @@ for (const item of readdirSync(path('./github-ci'))) {
githubCI[basename(item, '.json')] = readJSON(`./github-ci/${item}`);
};

const jenkinsCI = {};

for (const subdir of readdirSync(path('./jenkins'))) {
for (const item of readdirSync(path(`./jenkins/${subdir}`))) {
if (!item.endsWith('.json')) {
continue;
}
jenkinsCI[`${subdir}/${basename(item, '.json')}`] = readJSON(`./jenkins/${subdir}/${item}`);
}
};

module.exports = {
approved,
requestedChanges,
Expand All @@ -109,8 +122,11 @@ module.exports = {
approvingReviews,
requestingChangesReviews,
commentsWithCI,
commentsWithFailedCI,
commentsWithLGTM,
commentsWithPendingCI,
oddCommits,
jenkinsCI,
githubCI,
incorrectGitConfigCommits,
simpleCommits,
Expand Down
Loading

0 comments on commit 671b341

Please sign in to comment.