Skip to content
This repository was archived by the owner on Jan 22, 2022. It is now read-only.

Commit 0fb3e7b

Browse files
committed
Clean up test file and remove console logs
1 parent cbd388b commit 0fb3e7b

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

src/verify-disable-test-issue.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,51 +88,51 @@ export function formValidationComment(
8888
);
8989

9090
let body =
91-
'<details>Hello there! From the DISABLED prefix in this issue title, ';
91+
'<body>Hello there! From the DISABLED prefix in this issue title, ';
9292
body += 'it looks like you are attempting to disable a test in PyTorch CI. ';
93-
body += 'The information I have parsed is below:\n';
94-
body += `<b>Test name<b>: ${testName}\n`;
95-
body += `<b>Platforms for which to skip the test<b>: ${platformMsg}\n\n`;
93+
body += 'The information I have parsed is below:\n\n';
94+
body += `\* Test name: \`${testName}\`\n`;
95+
body += `\* Platforms for which to skip the test: ${platformMsg}\n\n`;
9696

9797
if (invalidPlatforms.length > 0) {
9898
body +=
99-
'<b>WARNING!<b> In the parsing process, I received these invalid inputs as platforms for ';
99+
'<b>WARNING!</b> In the parsing process, I received these invalid inputs as platforms for ';
100100
body += `which the test will be disabled: ${invalidPlatforms.join(
101101
', '
102102
)}. These could `;
103103
body +=
104104
'be typos or platforms we do not yet support test disabling. Please ';
105105
body +=
106-
'verify the platform list above and modify your issue body if needed.\n';
106+
'verify the platform list above and modify your issue body if needed.\n\n';
107107
}
108108

109109
if (!testNameIsExpected(testName)) {
110110
body +=
111-
'<b>ERROR!<b> As you can see above, I could not properly parse the test ';
111+
'<b>ERROR!</b> As you can see above, I could not properly parse the test ';
112112
body +=
113113
'information and determine which test to disable. Please modify the ';
114114
body +=
115115
'title to be of the format: DISABLED test_case_name (test.ClassName), ';
116-
body += 'for example, test_cuda_assert_async (__main__.TestCuda).\n';
116+
body += 'for example, \`test_cuda_assert_async (\_\_main\_\_.TestCuda)\`.\n\n';
117117
} else {
118118
body += `Within ~15 minutes, ${testName} will be disabled in PyTorch CI for `;
119119
body +=
120120
platformsToSkip.length === 0
121121
? 'all platforms'
122122
: `these platforms: ${platformsToSkip.join(', ')}`;
123123
body +=
124-
'. Please verify that your test name looks correct, e.g., test_cuda_assert_async (__main__.TestCuda).\n';
124+
'. Please verify that your test name looks correct, e.g., \`test_cuda_assert_async (\_\_main\_\_.TestCuda)\`.\n\n';
125125
}
126126

127127
body +=
128128
'To modify the platforms list, please include a line in the issue body, like below. The default ';
129129
body +=
130-
'action will disable the test for all platforms if no platforms list is specified. \n\n';
130+
'action will disable the test for all platforms if no platforms list is specified. \n';
131131
body +=
132-
'Platforms: case-insensitive, list, of, platforms\n\nWe currently support the following platforms: ';
132+
'\`\`\`\nPlatforms: case-insensitive, list, of, platforms\n\`\`\`\nWe currently support the following platforms: ';
133133
body += `${Array.from(supportedPlatforms)
134134
.sort((a, b) => a.localeCompare(b))
135-
.join(', ')}.</details>`;
135+
.join(', ')}.</body>`;
136136

137137
return validationCommentStart + body + validationCommentEnd;
138138
}

test/verify-disable-test-issue.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import nock from 'nock';
21
import {Probot} from 'probot';
32
import * as utils from './utils';
43
import myProbotApp from '../src/verify-disable-test-issue';
54
import * as botUtils from '../src/verify-disable-test-issue';
65

7-
nock.disableNetConnect();
8-
96
describe('verify-disable-test-issue', () => {
107
let probot: Probot;
118

@@ -41,7 +38,6 @@ describe('verify-disable-test-issue', () => {
4138
expect(testName).toEqual('testMethodName (testClass.TestSuite)');
4239

4340
const comment = botUtils.formValidationComment(testName, platforms);
44-
4541
expect(comment.includes('<!-- validation-comment-start -->')).toBeTruthy();
4642
expect(comment.includes('~15 minutes, testMethodName (testClass.TestSuite) will be disabled')).toBeTruthy();
4743
expect(comment.includes('these platforms: asan, rocm, windows.')).toBeTruthy();
@@ -76,7 +72,6 @@ describe('verify-disable-test-issue', () => {
7672
expect(testName).toEqual('testMethodName (testClass.TestSuite)');
7773

7874
const comment = botUtils.formValidationComment(testName, platforms);
79-
8075
expect(comment.includes('<!-- validation-comment-start -->')).toBeTruthy();
8176
expect(comment.includes('~15 minutes, testMethodName (testClass.TestSuite) will be disabled')).toBeTruthy();
8277
expect(comment.includes('all platforms.')).toBeTruthy();
@@ -111,8 +106,6 @@ describe('verify-disable-test-issue', () => {
111106
expect(testName).toEqual('testMethodName cuz it borked');
112107

113108
const comment = botUtils.formValidationComment(testName, platforms);
114-
console.log(comment)
115-
116109
expect(comment.includes('<!-- validation-comment-start -->')).toBeTruthy();
117110
expect(comment.includes('~15 minutes')).toBeFalsy();
118111
expect(comment.includes('ERROR')).toBeTruthy();

0 commit comments

Comments
 (0)