Run fiber tests just once on Travis (#8221)

Consolidate facts tracking with the other script.
This commit is contained in:
Ben Alpert
2016-11-07 11:43:29 -08:00
committed by GitHub
parent c4b9330f2a
commit 75ff12e984
4 changed files with 909 additions and 19 deletions
+26 -2
View File
@@ -2,6 +2,7 @@
'use strict';
const child_process = require('child_process');
const crypto = require('crypto');
const fs = require('fs');
const os = require('os');
@@ -84,7 +85,7 @@ function formatResults(runResults, predicate) {
return formatted.join('\n\n');
}
function recordTests() {
function recordTests(trackFacts) {
process.env.REACT_DOM_JEST_USE_FIBER = true;
runJest()
.then((runResults) => {
@@ -104,11 +105,34 @@ function recordTests() {
path.join(__dirname, 'tests-failing.txt'),
failing + '\n'
);
if (trackFacts) {
const fact = runResults.numPassedTests + '/' + runResults.numTotalTests;
// TODO: Shelling out here is silly.
child_process.spawnSync(
process.execPath,
[
path.join(__dirname, '../facts-tracker/index.js'),
'fiber-tests',
fact,
],
{
stdio: 'inherit',
}
);
}
});
}
if (require.main === module) {
recordTests();
const argv = require('yargs')
.demand(0, 0)
.boolean('track-facts')
.describe('track-facts', 'Use facts-tracker to record passing tests.')
.strict()
.help()
.argv;
recordTests(argv.trackFacts);
}
module.exports = {