TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

Run a subset of the DT tests on a change

Open orta opened this issue 4 years ago • 0 comments

This is how we do it on TypeScript:

git config --global core.longpaths true
git clone https://github.com/microsoft/DefinitelyTyped-tools $(Build.SourcesDirectory)/DefinitelyTyped-tools --depth 1
pushd $(Build.SourcesDirectory)/DefinitelyTyped-tools
npm i
pushd $(Build.SourcesDirectory)/DefinitelyTyped-tools/packages/dtslint-runner
npm i
npm i typescript@next
node ../../node_modules/typescript/lib/tsc.js

echo "Nightly run: Shard $SYSTEM_JOBPOSITIONINPHASE of $SYSTEM_TOTALJOBSINPHASE"
node ./dist/index.js --clone $DT_SHA --localTypeScriptPath $(Build.SourcesDirectory)/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/typescript/lib --selection all --expectOnly --shardId $SYSTEM_JOBPOSITIONINPHASE --shardCount $SYSTEM_TOTALJOBSINPHASE 2>nightlyErrors.txt

echo "Branch run: Shard $SYSTEM_JOBPOSITIONINPHASE of $SYSTEM_TOTALJOBSINPHASE"
node ./dist/index.js --clone $DT_SHA --localTypeScriptPath $(Build.SourcesDirectory)/built/local --selection all --expectOnly --shardId $SYSTEM_JOBPOSITIONINPHASE --shardCount $SYSTEM_TOTALJOBSINPHASE 2>branchErrors.txt
branchRunResult=$?

echo
echo "=== Errors only in nightly ==="
diff --changed-group-format='%<' --unchanged-group-format='' nightlyErrors.txt branchErrors.txt | egrep -v '^(===|[12]>)'

echo
echo "=== Errors only in branch ==="
diff --changed-group-format='%>' --unchanged-group-format='' nightlyErrors.txt branchErrors.txt  | egrep -v '^(===|[12]>)'

exit $branchRunResult

orta avatar Jun 22 '21 17:06 orta