From 32f82c03cb5b811337616a7bf959a544e5ba836d Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Tue, 30 May 2017 06:00:43 +1200 Subject: [PATCH] Added cache clear to e2e scripts (#2400) * Added cache clear to e2e scripts * Install latest yarn on AppVeyor to avoid windows crashing bug in yarn * Alternative fix for yarn crashing e2e tests on windows machines --- tasks/e2e-installs.sh | 24 ++++++++++++++++++++++++ tasks/e2e-kitchensink.sh | 24 ++++++++++++++++++++++++ tasks/e2e-simple.sh | 24 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/tasks/e2e-installs.sh b/tasks/e2e-installs.sh index b27b1239eda..8f4789ff0c7 100755 --- a/tasks/e2e-installs.sh +++ b/tasks/e2e-installs.sh @@ -83,6 +83,30 @@ set -x cd .. root_path=$PWD +# Clear cache to avoid issues with incorrect packages being used +if hash yarnpkg 2>/dev/null +then + # AppVeyor uses an old version of yarn. + # Once updated to 0.24.3 or above, the workaround can be removed + # and replaced with `yarnpkg cache clean` + # Issues: + # https://github.com/yarnpkg/yarn/issues/2591 + # https://github.com/appveyor/ci/issues/1576 + # https://github.com/facebookincubator/create-react-app/pull/2400 + # When removing workaround, you may run into + # https://github.com/facebookincubator/create-react-app/issues/2030 + case "$(uname -s)" in + *CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;; + *) yarn=yarnpkg;; + esac + $yarn cache clean +fi + +if hash npm 2>/dev/null +then + npm cache clean +fi + # Prevent lerna bootstrap, we only want top-level dependencies cp package.json package.json.bak grep -v "lerna bootstrap" package.json > temp && mv temp package.json diff --git a/tasks/e2e-kitchensink.sh b/tasks/e2e-kitchensink.sh index 1a19f4ae67f..fcd687e4b0d 100755 --- a/tasks/e2e-kitchensink.sh +++ b/tasks/e2e-kitchensink.sh @@ -66,6 +66,30 @@ set -x cd .. root_path=$PWD +# Clear cache to avoid issues with incorrect packages being used +if hash yarnpkg 2>/dev/null +then + # AppVeyor uses an old version of yarn. + # Once updated to 0.24.3 or above, the workaround can be removed + # and replaced with `yarnpkg cache clean` + # Issues: + # https://github.com/yarnpkg/yarn/issues/2591 + # https://github.com/appveyor/ci/issues/1576 + # https://github.com/facebookincubator/create-react-app/pull/2400 + # When removing workaround, you may run into + # https://github.com/facebookincubator/create-react-app/issues/2030 + case "$(uname -s)" in + *CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;; + *) yarn=yarnpkg;; + esac + $yarn cache clean +fi + +if hash npm 2>/dev/null +then + npm cache clean +fi + # Prevent lerna bootstrap, we only want top-level dependencies cp package.json package.json.bak grep -v "lerna bootstrap" package.json > temp && mv temp package.json diff --git a/tasks/e2e-simple.sh b/tasks/e2e-simple.sh index 4795d09a8b2..163bec0818a 100755 --- a/tasks/e2e-simple.sh +++ b/tasks/e2e-simple.sh @@ -65,6 +65,30 @@ set -x cd .. root_path=$PWD +# Clear cache to avoid issues with incorrect packages being used +if hash yarnpkg 2>/dev/null +then + # AppVeyor uses an old version of yarn. + # Once updated to 0.24.3 or above, the workaround can be removed + # and replaced with `yarnpkg cache clean` + # Issues: + # https://github.com/yarnpkg/yarn/issues/2591 + # https://github.com/appveyor/ci/issues/1576 + # https://github.com/facebookincubator/create-react-app/pull/2400 + # When removing workaround, you may run into + # https://github.com/facebookincubator/create-react-app/issues/2030 + case "$(uname -s)" in + *CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;; + *) yarn=yarnpkg;; + esac + $yarn cache clean +fi + +if hash npm 2>/dev/null +then + npm cache clean +fi + # Prevent lerna bootstrap, we only want top-level dependencies cp package.json package.json.bak grep -v "lerna bootstrap" package.json > temp && mv temp package.json