Skip to content

Commit

Permalink
Track fiber tests (facebook#7812)
Browse files Browse the repository at this point in the history
Use the newly added tracking system to track the number of fiber tests that are passing/failing.

I first tried to modify the grunt lint rule for it and send the output in stdout but unfortunately grunt displays the rule + done messages there. I had like 30 lines of js already and I figured I could just write 3 lines of bash and it would work the same. Let me know if you want me to use another approach for it.

Test Plan:
Run the commands that have been introduced in this commit but the facts-tracker one
Run `echo $FIBER_TESTS` and make sure it prints `666/1434`
  • Loading branch information
vjeux authored Sep 26, 2016
1 parent fb1e707 commit 84f8df1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,27 @@ script:
set -e
./node_modules/.bin/grunt jest:coverage
cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
echo 'Testing in server-render (HTML generation) mode...'
printf '\nmodule.exports.useCreateElement = false;\n' \
>> src/renderers/dom/shared/ReactDOMFeatureFlags.js
./node_modules/.bin/grunt jest:normal
git checkout -- src/renderers/dom/shared/ReactDOMFeatureFlags.js
echo 'Testing in fiber mode...'
printf '\nmodule.exports.useFiber = true;\n' \
>> src/renderers/dom/shared/ReactDOMFeatureFlags.js
FIBER_TESTS=`\
NODE_ENV=test node node_modules/jest/bin/jest --json | \
node -e "\
var data = JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf8')); \
console.log(data.numPassedTests + '/' + data.numTotalTests)\
"\
`
git checkout -- src/renderers/dom/shared/ReactDOMFeatureFlags.js
node scripts/facts-tracker/index.js \
"fiber-tests" "$FIBER_TESTS"
./node_modules/.bin/gulp react:extract-errors
elif [ "$TEST_TYPE" = flow ]; then
set -e
Expand Down

0 comments on commit 84f8df1

Please sign in to comment.