From ab2c578f98950f3bae6eb671d539ffdafa0c0aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 13 Jan 2022 12:38:45 -0500 Subject: [PATCH] test: add prettier e2e test (#14058) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicolò Ribaudo --- .circleci/config.yml | 11 ++++++ .github/workflows/ci.yml | 1 + scripts/integration-tests/e2e-prettier.sh | 45 +++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100755 scripts/integration-tests/e2e-prettier.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ac6d6791d..6d230d78eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -166,6 +166,14 @@ jobs: at: /tmp/verdaccio-workspace - run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-jest.sh + e2e-breaking-prettier: + executor: node-executor + steps: + - checkout + - attach_workspace: + at: /tmp/verdaccio-workspace + - run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-prettier.sh + workflows: version: 2 build-standalone: @@ -245,3 +253,6 @@ workflows: - e2e-breaking-jest: requires: - publish-verdaccio-babel-8-breaking + - e2e-breaking-prettier: + requires: + - publish-verdaccio-babel-8-breaking diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03782d03a3..fe43b2a3dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -446,6 +446,7 @@ jobs: - vue-cli - jest - react-native + - prettier steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/scripts/integration-tests/e2e-prettier.sh b/scripts/integration-tests/e2e-prettier.sh new file mode 100755 index 0000000000..6d90b1fd86 --- /dev/null +++ b/scripts/integration-tests/e2e-prettier.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +#==============================================================================# +# SETUP # +#==============================================================================# + +# Start in scripts/integration-tests/ even if run from root directory +cd "$(dirname "$0")" || exit +root="$PWD" + +source utils/local-registry.sh +source utils/cleanup.sh + +# Echo every command being executed +set -x + +# Clone prettier +git clone --depth=1 https://github.com/prettier/prettier tmp/prettier +cd tmp/prettier || exit + +# Update @babel/* dependencies +bump_deps="$root/utils/bump-babel-dependencies.js" +node "$bump_deps" + +#==============================================================================# +# ENVIRONMENT # +#==============================================================================# +node -v +yarn --version + +#==============================================================================# +# TEST # +#==============================================================================# + +# Don't use Yarn 2 +export YARN_IGNORE_PATH=1 + +startLocalRegistry "$root"/verdaccio-config.yml +yarn install + +# Only run js,jsx,misc format tests +# Without --runInBand CircleCI hangs. +yarn test "tests/format/(jsx?|misc)/" --update-snapshot --runInBand + +cleanup