Skip to content

Commit dec7873

Browse files
committed
feat: new-succeeded.json
1 parent aeb3f79 commit dec7873

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
path: |
6363
./tasks/test262/failed.txt
6464
./tasks/test262/stat.txt
65+
./tasks/test262/new-succeeded.json
6566
# Comment stat.txt to the commit or PR
6667
- name: Send comment
6768
uses: actions/github-script@v7

‎tasks/test262/output.cjs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ process.stdin.on('end', () => {
2727
.filter(Boolean);
2828

2929
const failedTests = {}
30+
const failedIgnored = new Set();
3031
let expectedFailedNum = 0;
3132
for (let i = 0; i < lines.length; i+=2) {
3233
let name = lines[i].slice('test262/test/'.length);
3334
if (ignored.includes(name) || v8Failed.includes(name) || engine262Skip.includes(name) || treeShakeSkipped.includes(name)) {
3435
expectedFailedNum++;
36+
if (ignored.includes(name)) {
37+
failedIgnored.add(name);
38+
}
3539
} else {
3640
failedTests[name] = lines[i+1]?.replaceAll("`", "'") || '<NO OUTPUT>';
3741
}
@@ -42,6 +46,10 @@ process.stdin.on('end', () => {
4246
}).join('\n');
4347
fs.writeFileSync(path.join(__dirname, 'failed.txt'), failedList);
4448

49+
// Find tests that are in ignored.json but didn't fail (meaning they now pass)
50+
const newSucceeded = ignored.filter(name => !name.startsWith('//') && !failedIgnored.has(name));
51+
fs.writeFileSync(path.join(__dirname, 'new-succeeded.json'), JSON.stringify(newSucceeded, null, 2));
52+
4553
const stat = input.match(/^Ran \d+ tests[\s\S]+/m)[0];
4654
const total = +stat.match(/^Ran (\d+) tests$/m)[1];
4755
const passedNum = +stat.match(/^(\d+) passed$/m)[1];
@@ -53,6 +61,7 @@ process.stdin.on('end', () => {
5361
- Total: ${total}
5462
- Passed: ${passedNum}
5563
- Ignored: ${expectedFailedNum}
64+
- New Succeeded (in ignored.json but now pass): ${newSucceeded.length}
5665
${restMessage.split('\n').filter(Boolean).map(s => `- ${s.trim()}`).join('\n')}
5766
5867
${failedNum ? `

0 commit comments

Comments
 (0)