From 85b8ebe18a680d337ebaed9a2789c1075beb26bc Mon Sep 17 00:00:00 2001 From: Valerie Young Date: Fri, 9 Oct 2020 09:04:50 -0700 Subject: [PATCH 1/4] Switch the regression report to use markdown --- .github/workflows/coverage-report.yml | 2 +- test/util/report.js | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/coverage-report.yml b/.github/workflows/coverage-report.yml index 35955505f5..be405bc093 100644 --- a/.github/workflows/coverage-report.yml +++ b/.github/workflows/coverage-report.yml @@ -29,7 +29,7 @@ jobs: github-token: ${{secrets.GITHUB_TOKEN}} script: | const fs = require('fs'); - const commentBody = '```' + fs.readFileSync('coverage.log', 'utf8') + '```'; + const commentBody = fs.readFileSync('coverage.log', 'utf8'); if (commentBody.length === 0) { return diff --git a/test/util/report.js b/test/util/report.js index 9971f96f64..ed5b92cbac 100644 --- a/test/util/report.js +++ b/test/util/report.js @@ -215,14 +215,14 @@ for (let example in exampleCoverage) { let exampleName = example; if (existingTestIds === missingTests) { - examplesWithNoTestsReport += exampleName + '\n'; + examplesWithNoTestsReport += '- ' + exampleName + '\n'; examplesWithNoTests++; } else if (missingTests) { - examplesMissingSomeTestsReport += exampleName + ':\n'; + examplesMissingSomeTestsReport += '- ' + exampleName + ':\n'; for (let testId of exampleCoverage[example].missingTests) { - examplesMissingSomeTestsReport += ' ' + testId + '\n'; + examplesMissingSomeTestsReport += ' - ' + testId + '\n'; } examplesMissingSomeTests += 1; @@ -230,18 +230,18 @@ for (let example in exampleCoverage) { } if (missingKeys || missingAttrs) { - missingTestIdsReport += exampleName + '\n'; + missingTestIdsReport += '- ' + exampleName + '\n'; if (missingKeys) { - missingTestIdsReport += ' "Keyboard Support" table(s):\n'; + missingTestIdsReport += ' - "Keyboard Support" table(s):\n'; for (let row of exampleCoverage[example].missingKeys) { - missingTestIdsReport += ' ' + row + '\n'; + missingTestIdsReport += ' - ' + row + '\n'; } } if (missingAttrs) { - missingTestIdsReport += ' "Attributes" table(s):\n'; + missingTestIdsReport += ' - "Attributes" table(s):\n'; for (let row of exampleCoverage[example].missingAttrs) { - missingTestIdsReport += ' ' + row + '\n'; + missingTestIdsReport += ' - ' + row + '\n'; } } } @@ -260,14 +260,15 @@ fs.readdirSync(testsPath).forEach(function (testFile) { } }); -console.log('\nExamples without any regression tests:\n'); +console.log('\n## Regression test coverage:\n'); +console.log('\n### Examples without any regression tests:\n'); console.log(examplesWithNoTestsReport || 'None found.\n'); -console.log('\nExamples missing some regression tests:\n'); +console.log('\n### Examples missing some regression tests:\n'); console.log(examplesMissingSomeTestsReport || 'None found.\n'); -console.log('\nExamples documentation table rows without data-test-ids:\n'); +console.log('\n### Examples documentation table rows without data-test-ids:\n'); console.log(missingTestIdsReport || 'None found.\n'); -console.log('SUMMARTY:\n'); +console.log('### SUMMARTY:\n'); console.log(' ' + exampleFiles.length + ' example pages found.'); console.log(' ' + examplesWithNoTests + ' example pages have no regression tests.'); console.log(' ' + examplesMissingSomeTests + ' example pages are missing approximately ' + From 9874e14d3119449c820daae8b30a86d92225aad9 Mon Sep 17 00:00:00 2001 From: Valerie Young Date: Thu, 22 Oct 2020 13:41:03 -0700 Subject: [PATCH 2/4] Change headings for clarify --- test/util/report.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/util/report.js b/test/util/report.js index ed5b92cbac..dd952e9c8f 100644 --- a/test/util/report.js +++ b/test/util/report.js @@ -260,15 +260,15 @@ fs.readdirSync(testsPath).forEach(function (testFile) { } }); -console.log('\n## Regression test coverage:\n'); -console.log('\n### Examples without any regression tests:\n'); +console.log('\n#### Regression test coverage:\n'); +console.log('\n#### Examples without any regression tests:\n'); console.log(examplesWithNoTestsReport || 'None found.\n'); -console.log('\n### Examples missing some regression tests:\n'); +console.log('\n#### Examples missing some regression tests:\n'); console.log(examplesMissingSomeTestsReport || 'None found.\n'); -console.log('\n### Examples documentation table rows without data-test-ids:\n'); +console.log('\n#### Examples pages Keyboard or Attribute table rows that do not have data-test-ids:\n'); console.log(missingTestIdsReport || 'None found.\n'); -console.log('### SUMMARTY:\n'); +console.log('#### SUMMARY:\n'); console.log(' ' + exampleFiles.length + ' example pages found.'); console.log(' ' + examplesWithNoTests + ' example pages have no regression tests.'); console.log(' ' + examplesMissingSomeTests + ' example pages are missing approximately ' + From 6c65e251185466c0bd92ff940dda5af6800a3719 Mon Sep 17 00:00:00 2001 From: Valerie Young Date: Thu, 22 Oct 2020 14:12:23 -0700 Subject: [PATCH 3/4] Fix grammar --- test/util/report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/util/report.js b/test/util/report.js index 4fbed21a54..9f8b6c6bd6 100644 --- a/test/util/report.js +++ b/test/util/report.js @@ -283,7 +283,7 @@ console.log(examplesWithNoTestsReport || 'None found.\n'); console.log('\n#### Examples missing some regression tests:\n'); console.log(examplesMissingSomeTestsReport || 'None found.\n'); console.log( - '\n#### Examples pages Keyboard or Attribute table rows that do not have data-test-ids:\n' + '\n#### Examples pages with Keyboard or Attribute table rows that do not have data-test-ids:\n' ); console.log(missingTestIdsReport || 'None found.\n'); From ef6e15f629b16c131ff72f7cdccc25b745466844 Mon Sep 17 00:00:00 2001 From: Valerie Young Date: Thu, 22 Oct 2020 16:01:34 -0700 Subject: [PATCH 4/4] Grammar --- test/util/report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/util/report.js b/test/util/report.js index 9f8b6c6bd6..6a74fe8318 100644 --- a/test/util/report.js +++ b/test/util/report.js @@ -283,7 +283,7 @@ console.log(examplesWithNoTestsReport || 'None found.\n'); console.log('\n#### Examples missing some regression tests:\n'); console.log(examplesMissingSomeTestsReport || 'None found.\n'); console.log( - '\n#### Examples pages with Keyboard or Attribute table rows that do not have data-test-ids:\n' + '\n#### Example pages with Keyboard or Attribute table rows that do not have data-test-ids:\n' ); console.log(missingTestIdsReport || 'None found.\n');