From 67ea7f4b4da9726d66982258a64c001481b7cda5 Mon Sep 17 00:00:00 2001 From: Jaideep Bhoosreddy Date: Wed, 13 Nov 2019 11:31:29 -0500 Subject: [PATCH] Implement PR workflow for running test262 on babel PRs (#10579) * Implement PR workflow with test262 * revisions --- .circleci/config.yml | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 400c61909baa..0d1c725d3243 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,6 +40,9 @@ aliases: - &artifact_test262_xunit path: ~/test-results + - &artifact_test262_diff_tap + path: ~/diff.tap + executors: node-executor: docker: @@ -73,6 +76,14 @@ jobs: executor: node-executor steps: - checkout + - run: + name: Sync with latest master branch (only on PRs) + command: | + if [ -n "$CIRCLE_PULL_REQUEST" ] + then + git fetch origin refs/pull/$CIRCLE_PR_NUMBER/merge + git checkout -qf FETCH_HEAD + fi - restore_cache: *restore-yarn-cache - restore_cache: *restore-node-modules-cache - run: @@ -100,16 +111,34 @@ jobs: yarn link $(./jq -j ".name" $package) done node lib/download-node + - run: + name: Download master branch Test262 artifact + command: node lib/download-master-artifact ~/master.tap + <<: *test262_workdir - run: name: Run Test262 command: node lib/run-tests I_AM_SURE | tee ~/test262.tap <<: *test262_workdir - store_artifacts: *artifact_test262_tap - run: - name: Output test262 results + name: Output Test262 results command: | cat ~/test262.tap | $(npm bin)/tap-mocha-reporter spec || true <<: *test262_workdir + - run: + name: Compare previous master branch & current job results + command: | + mkdir -p ~/test-results/test262 + node lib/compare-results ~/master.tap ~/test262.tap | tee ~/diff.tap + <<: *test262_workdir + - store_artifacts: *artifact_test262_diff_tap + - run: + name: Output comparision results and report to CircleCI + command: | + mkdir -p ~/test-results/test262 + cat ~/diff.tap | $(npm bin)/tap-merge | $(npm bin)/tap-mocha-reporter xunit | tee ~/test-results/test262/results.xml + <<: *test262_workdir + - store_test_results: *artifact_test262_xunit publish-verdaccio: executor: node-executor @@ -136,15 +165,20 @@ workflows: test: jobs: - test - - master: + test262-master: jobs: - test262: filters: branches: only: - master - + test262: + jobs: + - approve-test262-run: + type: approval + - test262: + requires: + - approve-test262-run e2e: jobs: - publish-verdaccio