Skip to content

Commit

Permalink
๐Ÿ— ๐Ÿšฎ Remove test-status bot reporting (#35249)
Browse files Browse the repository at this point in the history
* remove test-status bot reporting
  • Loading branch information
rileyajones committed Jul 19, 2021
1 parent ea44183 commit 21a9024
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 278 deletions.
9 changes: 0 additions & 9 deletions build-system/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ function getExperimentConfig(experiment) {
return valid ? config : null;
}

/**
* Returns the names of all valid experiments.
* @return {!Array<string>}
*/
function getValidExperiments() {
return Object.keys(experimentsConfig).filter(getExperimentConfig);
}

/**
* Gets the list of files changed on the current branch that match the given
* array of glob patterns using the given options.
Expand Down Expand Up @@ -182,7 +174,6 @@ function usesFilesOrLocalChanges(taskName) {
module.exports = {
buildRuntime,
getExperimentConfig,
getValidExperiments,
getFilesFromArgv,
getFilesToCheck,
usesFilesOrLocalChanges,
Expand Down
6 changes: 1 addition & 5 deletions build-system/pr-check/checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* @fileoverview Script that runs various checks during CI.
*/

const {reportAllExpectedTests} = require('../tasks/report-test-status');
const {runCiJob} = require('./ci-job');
const {Targets, buildTargetsInclude} = require('./build-targets');
const {timedExecOrDie} = require('./utils');
Expand Down Expand Up @@ -56,11 +55,8 @@ function pushBuildWorkflow() {

/**
* Steps to run during PR builds.
* @return {Promise<void>}
*/
async function prBuildWorkflow() {
await reportAllExpectedTests();

function prBuildWorkflow() {
if (buildTargetsInclude(Targets.PRESUBMIT)) {
timedExecOrDie('amp presubmit');
}
Expand Down
7 changes: 1 addition & 6 deletions build-system/pr-check/cross-browser-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

const {cyan, red} = require('../common/colors');
const {log} = require('../common/logging');
const {reportAllExpectedTests} = require('../tasks/report-test-status');
const {runCiJob} = require('./ci-job');
const {skipDependentJobs, timedExecOrDie} = require('./utils');
const {Targets, buildTargetsInclude} = require('./build-targets');
Expand Down Expand Up @@ -109,12 +108,8 @@ function pushBuildWorkflow() {

/**
* Steps to run during PR builds.
* @return {Promise<void>}
*/
async function prBuildWorkflow() {
if (process.platform == 'linux') {
await reportAllExpectedTests(); // Only once is sufficient.
}
function prBuildWorkflow() {
if (
!buildTargetsInclude(
Targets.RUNTIME,
Expand Down
5 changes: 1 addition & 4 deletions build-system/tasks/e2e/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const {HOST, PORT, startServer, stopServer} = require('../serve');
const {isCiBuild, isCircleciBuild} = require('../../common/ci');
const {log} = require('../../common/logging');
const {maybePrintCoverageMessage} = require('../helpers');
const {reportTestStarted} = require('../report-test-status');
const {watch} = require('chokidar');

const SLOW_TEST_THRESHOLD_MS = 2500;
Expand Down Expand Up @@ -159,7 +158,7 @@ async function fetchCoverage_(outDir) {
* Runs e2e tests on all files under test.
* @return {!Promise<void>}
*/
async function runTests_() {
function runTests_() {
const mocha = createMocha_();
const addFile = addMochaFile_.bind(null, mocha);

Expand All @@ -172,8 +171,6 @@ async function runTests_() {
});
}

await reportTestStarted();

// return promise to amp that resolves when there's an error.
return new Promise((resolve) => {
mocha.run(async (failures) => {
Expand Down
2 changes: 0 additions & 2 deletions build-system/tasks/e2e/mocha-dots-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const {Base} = Mocha.reporters;
const {green, red, yellow} = require('../../common/colors');
const {icon, nbDotsPerLine} =
require('../../test-configs/karma.conf').superDotsReporter;
const {reportTestFinished} = require('../report-test-status');

/**
* Custom Mocha reporter for CI builds.
Expand Down Expand Up @@ -72,7 +71,6 @@ class MochaDotsReporter extends Base {
`(Skipped ${pending})`,
failures == 0 ? green('SUCCESS') : red(`${failures} FAILED`)
);
reportTestFinished(passes, failures);
});
}
}
Expand Down
236 changes: 0 additions & 236 deletions build-system/tasks/report-test-status.js

This file was deleted.

8 changes: 2 additions & 6 deletions build-system/tasks/runtime-test/helpers-unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const {extensions, maybeInitializeExtensions} = require('../extension-helpers');
const {gitDiffNameOnlyMain} = require('../../common/git');
const {isCiBuild} = require('../../common/ci');
const {log, logLocalDev} = require('../../common/logging');
const {reportTestSkipped} = require('../report-test-status');

const LARGE_REFACTOR_THRESHOLD = 50;
const TEST_FILE_COUNT_THRESHOLD = 20;
Expand Down Expand Up @@ -135,17 +134,16 @@ function getJsFilesFor(cssFile, cssJsFileMap) {

/**
* Computes the list of unit tests to run under difference scenarios
* @return {Promise<Array<string>|void>}
* @return {Array<string>|void}
*/
async function getUnitTestsToRun() {
function getUnitTestsToRun() {
log(green('INFO:'), 'Determining which unit tests to run...');

if (isLargeRefactor()) {
log(
green('INFO:'),
'Skipping tests on local changes because this is a large refactor.'
);
await reportTestSkipped();
return;
}

Expand All @@ -155,15 +153,13 @@ async function getUnitTestsToRun() {
green('INFO:'),
'No unit tests were directly affected by local changes.'
);
await reportTestSkipped();
return;
}
if (isCiBuild() && tests.length > TEST_FILE_COUNT_THRESHOLD) {
log(
green('INFO:'),
'Several tests were affected by local changes. Running all tests below.'
);
await reportTestSkipped();
return;
}

Expand Down
Loading

0 comments on commit 21a9024

Please sign in to comment.