Skip to content

Commit 6e76280

Browse files
cortinicokelset
authored andcommitted
Updating Yarn Cache path to fix broken CI (facebook#32834)
Summary: The CI is currently failing with: ``` Error extracting tarball /tmp/cache1419328940 : tar: root/.cache/yarn: Cannot mkdir: Permission denied tar: root/.cache/yarn/v6 ``` The problem is that we're sharing the Yarn cache between two jobs (`test_js` and `test_ios_unit_jsc`) which are executed on two difference executors (a Machine vs a Docker container). I've update the cache key to be `v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}-{{ arch }}-{{ checksum "yarn.lock" }}` so the job name is accounted when computing the Cache Key. Moreover the `test_js` test was also failing on `flow check` as one of the library we depend on (`resolve`) added a test with a malformed JSON. I'm fixing this failure as well so the CI is back green. ## Changelog [Internal] - Updating Yarn Cache path to fix broken CI Pull Request resolved: facebook#32834 Test Plan: Verified that the external CI is green: facebook#32834 Reviewed By: lunaleaps Differential Revision: D33453702 Pulled By: cortinico fbshipit-source-id: 52bf42db583eaf6aa913f1bb164566f8c3563d36
1 parent e0d2ed7 commit 6e76280

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.circleci/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ commands:
7777
steps:
7878
- restore_cache:
7979
keys:
80-
- v5-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
80+
- v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}-{{ arch }}-{{ checksum "yarn.lock" }}
81+
- v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}-{{ arch }}
82+
- v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
8183
- run:
8284
name: "Yarn: Install Dependencies"
8385
command: |
@@ -89,7 +91,7 @@ commands:
8991
- save_cache:
9092
paths:
9193
- ~/.cache/yarn
92-
key: v5-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
94+
key: v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}-{{ arch }}-{{ checksum "yarn.lock" }}
9395

9496
install_buck_tooling:
9597
steps:

scripts/run-ci-e2e-tests.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* --retries [num] - how many times to retry possible flaky commands: yarn add and running tests, default 1
2020
*/
2121

22-
const {cd, cp, echo, exec, exit, mv} = require('shelljs');
22+
const {cd, cp, echo, exec, exit, mv, rm} = require('shelljs');
2323
const spawn = require('child_process').spawn;
2424
const argv = require('yargs').argv;
2525
const path = require('path');
@@ -268,6 +268,9 @@ try {
268268
throw Error(exitCode);
269269
}
270270
describe('Test: Flow check');
271+
// The resolve package included a test for a malformed package.json (see https://github.com/browserify/resolve/issues/89)
272+
// that is failing the flow check. We're removing it.
273+
rm('-rf', './node_modules/resolve/test/resolver/malformed_package_json');
271274
if (exec(`${ROOT}/node_modules/.bin/flow check`).code) {
272275
echo('Flow check failed.');
273276
exitCode = 1;

0 commit comments

Comments
 (0)