Skip to content

Commit

Permalink
🏗Java Validator testing changes (#27788)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha committed Apr 16, 2020
1 parent cdbb496 commit 15258f6
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 24 deletions.
3 changes: 1 addition & 2 deletions build-system/pr-check/build-targets.js
Expand Up @@ -189,8 +189,7 @@ const targetMatchers = {
}
return (
file.startsWith('validator/java/') ||
file === 'build-system/tasks/validator.js' ||
isValidatorFile(file)
file === 'build-system/tasks/validator.js'
);
},
'VALIDATOR_WEBUI': (file) => {
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/build.js
Expand Up @@ -36,8 +36,7 @@ const {runYarnChecks} = require('./yarn-checks');

const FILENAME = 'build.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/checks.js
Expand Up @@ -35,8 +35,7 @@ const {reportAllExpectedTests} = require('../tasks/report-test-status');
const {runYarnChecks} = require('./yarn-checks');

const FILENAME = 'checks.js';
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

async function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/dist-bundle-size.js
Expand Up @@ -39,8 +39,7 @@ const {signalDistUpload} = require('../tasks/pr-deploy-bot-utils');

const FILENAME = 'dist-bundle-size.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

async function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/e2e-tests.js
Expand Up @@ -34,8 +34,7 @@ const {isTravisPullRequestBuild} = require('../common/travis');

const FILENAME = 'e2e-tests.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

async function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/experiment-tests.js
Expand Up @@ -31,8 +31,7 @@ const {
const {experiment} = require('minimist')(process.argv.slice(2));
const FILENAME = `${experiment}-tests.js`;
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

function getConfig_() {
const config = experimentsConfig[experiment];
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/local-tests.js
Expand Up @@ -34,8 +34,7 @@ const {isTravisPullRequestBuild} = require('../common/travis');

const FILENAME = 'local-tests.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/module-dist-bundle-size.js
Expand Up @@ -36,8 +36,7 @@ const {runYarnChecks} = require('./yarn-checks');

const FILENAME = 'module-dist-bundle-size.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/single-pass-tests.js
Expand Up @@ -33,8 +33,7 @@ const {isTravisPullRequestBuild} = require('../common/travis');

const FILENAME = 'single-pass-tests.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand Down
12 changes: 8 additions & 4 deletions build-system/pr-check/validator-tests.js
Expand Up @@ -27,6 +27,7 @@ const {
startTimer,
stopTimer,
stopTimedJob,
timedExec: timedExecBase,
timedExecOrDie: timedExecOrDieBase,
} = require('./utils');
const {determineBuildTargets} = require('./build-targets');
Expand All @@ -35,8 +36,8 @@ const {runYarnChecks} = require('./yarn-checks');

const FILENAME = 'validator-tests.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);
const timedExec = (cmd) => timedExecBase(cmd, FILENAME);

function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand All @@ -47,7 +48,8 @@ function main() {

if (!isTravisPullRequestBuild()) {
timedExecOrDie('gulp validator');
timedExecOrDie('gulp validator-java');
// #27786: Java validator is not guaranteed to be in sync with AMP code.
timedExec('gulp validator-java');
timedExecOrDie('gulp validator-webui');
} else {
printChangeSummary(FILENAME);
Expand All @@ -72,8 +74,10 @@ function main() {
timedExecOrDie('gulp validator');
}

if (buildTargets.has('RUNTIME') || buildTargets.has('VALIDATOR_JAVA')) {
if (buildTargets.has('VALIDATOR_JAVA')) {
timedExecOrDie('gulp validator-java');
} else if (buildTargets.has('RUNTIME')) {
timedExec('gulp validator-java');
}

if (buildTargets.has('VALIDATOR_WEBUI')) {
Expand Down
3 changes: 1 addition & 2 deletions build-system/pr-check/visual-diff-tests.js
Expand Up @@ -35,8 +35,7 @@ const {isTravisPullRequestBuild} = require('../common/travis');

const FILENAME = 'visual-diff-tests.js';
const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`));
const timedExecOrDie = (cmd, unusedFileName) =>
timedExecOrDieBase(cmd, FILENAME);
const timedExecOrDie = (cmd) => timedExecOrDieBase(cmd, FILENAME);

function main() {
const startTime = startTimer(FILENAME, FILENAME);
Expand Down
4 changes: 4 additions & 0 deletions build-system/tasks/pr-check.js
Expand Up @@ -114,6 +114,10 @@ async function prCheck(cb) {
runCheck('gulp validator');
}

if (buildTargets.has('VALIDATOR_JAVA')) {
runCheck('gulp validator-java');
}

if (buildTargets.has('VALIDATOR_WEBUI')) {
runCheck('gulp validator-webui');
}
Expand Down

0 comments on commit 15258f6

Please sign in to comment.