Skip to content

Commit 171e8fc

Browse files
committed
Alternative fix for yarn crashing e2e tests on windows machines
1 parent 8928aa5 commit 171e8fc

File tree

3 files changed

+42
-12
lines changed

3 files changed

+42
-12
lines changed

tasks/e2e-installs.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,20 @@ root_path=$PWD
8686
# Clear cache to avoid issues with incorrect packages being used
8787
if hash yarnpkg 2>/dev/null
8888
then
89-
# AppVeyor uses old version on yarn.
90-
# Once updated to 0.24.3 or above install can be removed.
91-
npm install -g yarn@latest
92-
yarnpkg cache clean
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
93103
fi
94104

95105
if hash npm 2>/dev/null

tasks/e2e-kitchensink.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,20 @@ root_path=$PWD
6969
# Clear cache to avoid issues with incorrect packages being used
7070
if hash yarnpkg 2>/dev/null
7171
then
72-
# AppVeyor uses old version on yarn.
73-
# Once updated to 0.24.3 or above install can be removed.
74-
npm install -g yarn@latest
75-
yarnpkg cache clean
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
7686
fi
7787

7888
if hash npm 2>/dev/null

tasks/e2e-simple.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,20 @@ root_path=$PWD
6868
# Clear cache to avoid issues with incorrect packages being used
6969
if hash yarnpkg 2>/dev/null
7070
then
71-
# AppVeyor uses old version on yarn.
72-
# Once updated to 0.24.3 or above install can be removed.
73-
npm install -g yarn@latest
74-
yarnpkg cache clean
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
7585
fi
7686

7787
if hash npm 2>/dev/null

0 commit comments

Comments
 (0)