Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 57095b4

Browse files
ro-savagewmonk
authored andcommitted
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
1 parent e447c79 commit 57095b4

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

tasks/e2e-installs.sh

+24
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,30 @@ set -x
8383
cd ..
8484
root_path=$PWD
8585

86+
# Clear cache to avoid issues with incorrect packages being used
87+
if hash yarnpkg 2>/dev/null
88+
then
89+
# AppVeyor uses an old version of yarn.
90+
# Once updated to 0.24.3 or above, the workaround can be removed
91+
# and replaced with `yarnpkg cache clean`
92+
# Issues:
93+
# https://github.com/yarnpkg/yarn/issues/2591
94+
# https://github.com/appveyor/ci/issues/1576
95+
# https://github.com/facebookincubator/create-react-app/pull/2400
96+
# When removing workaround, you may run into
97+
# https://github.com/facebookincubator/create-react-app/issues/2030
98+
case "$(uname -s)" in
99+
*CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;;
100+
*) yarn=yarnpkg;;
101+
esac
102+
$yarn cache clean
103+
fi
104+
105+
if hash npm 2>/dev/null
106+
then
107+
npm cache clean
108+
fi
109+
86110
# Prevent lerna bootstrap, we only want top-level dependencies
87111
cp package.json package.json.bak
88112
grep -v "lerna bootstrap" package.json > temp && mv temp package.json

tasks/e2e-kitchensink.sh

+24
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,30 @@ set -x
6666
cd ..
6767
root_path=$PWD
6868

69+
# Clear cache to avoid issues with incorrect packages being used
70+
if hash yarnpkg 2>/dev/null
71+
then
72+
# AppVeyor uses an old version of yarn.
73+
# Once updated to 0.24.3 or above, the workaround can be removed
74+
# and replaced with `yarnpkg cache clean`
75+
# Issues:
76+
# https://github.com/yarnpkg/yarn/issues/2591
77+
# https://github.com/appveyor/ci/issues/1576
78+
# https://github.com/facebookincubator/create-react-app/pull/2400
79+
# When removing workaround, you may run into
80+
# https://github.com/facebookincubator/create-react-app/issues/2030
81+
case "$(uname -s)" in
82+
*CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;;
83+
*) yarn=yarnpkg;;
84+
esac
85+
$yarn cache clean
86+
fi
87+
88+
if hash npm 2>/dev/null
89+
then
90+
npm cache clean
91+
fi
92+
6993
# Prevent lerna bootstrap, we only want top-level dependencies
7094
cp package.json package.json.bak
7195
grep -v "lerna bootstrap" package.json > temp && mv temp package.json

tasks/e2e-simple.sh

+24
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,30 @@ set -x
6565
cd ..
6666
root_path=$PWD
6767

68+
# Clear cache to avoid issues with incorrect packages being used
69+
if hash yarnpkg 2>/dev/null
70+
then
71+
# AppVeyor uses an old version of yarn.
72+
# Once updated to 0.24.3 or above, the workaround can be removed
73+
# and replaced with `yarnpkg cache clean`
74+
# Issues:
75+
# https://github.com/yarnpkg/yarn/issues/2591
76+
# https://github.com/appveyor/ci/issues/1576
77+
# https://github.com/facebookincubator/create-react-app/pull/2400
78+
# When removing workaround, you may run into
79+
# https://github.com/facebookincubator/create-react-app/issues/2030
80+
case "$(uname -s)" in
81+
*CYGWIN*|MSYS*|MINGW*) yarn=yarn.cmd;;
82+
*) yarn=yarnpkg;;
83+
esac
84+
$yarn cache clean
85+
fi
86+
87+
if hash npm 2>/dev/null
88+
then
89+
npm cache clean
90+
fi
91+
6892
# Prevent lerna bootstrap, we only want top-level dependencies
6993
cp package.json package.json.bak
7094
grep -v "lerna bootstrap" package.json > temp && mv temp package.json

0 commit comments

Comments
 (0)