packager: GlobalTransformCache-test: disable non-deterministic test

Reviewed By: davidaurelio

Differential Revision: D4751434

fbshipit-source-id: 1be748387abe9ca0ce030bd2423827dfe5c2a146
This commit is contained in:
Jean Lauliac 2017-03-22 06:07:10 -07:00 committed by Facebook Github Bot
parent e3daf33ed8
commit fc95a312b9
3 changed files with 9 additions and 10 deletions

View File

@ -99,10 +99,11 @@ class KeyResultStore {
} }
/** /**
* The transform options contain absolute paths. This can contain, for * The transform options contain absolute paths. This can contain, for example,
* example, the username if someone works their home directory (very likely). * the username if someone works their home directory (very likely). We get rid
* We need to get rid of this user-and-machine-dependent data for the global * of this local data for the global cache, otherwise nobody would share the
* cache, otherwise nobody would share the same cache keys. * same cache keys. The project roots should not be needed as part of the cache
* key as they should not affect the transformation of a single particular file.
*/ */
function globalizeTransformOptions( function globalizeTransformOptions(
options: TransformOptions, options: TransformOptions,
@ -115,9 +116,7 @@ function globalizeTransformOptions(
...options, ...options,
transform: { transform: {
...transform, ...transform,
projectRoots: transform.projectRoots.map(p => { projectRoots: [],
return path.relative(path.join(__dirname, '../../../../..'), p);
}),
}, },
}; };
} }

View File

@ -40,7 +40,7 @@ describe('GlobalTransformCache', () => {
dev: true, dev: true,
minify: false, minify: false,
platform: 'ios', platform: 'ios',
transform: {projectRoots: [__dirname]}, transform: {},
}; };
const result = await Promise.all([cache.fetch({ const result = await Promise.all([cache.fetch({
filePath: 'foo.js', filePath: 'foo.js',

View File

@ -19,12 +19,12 @@ Object {
exports[`GlobalTransformCache fetches results 1`] = ` exports[`GlobalTransformCache fetches results 1`] = `
Array [ Array [
Object { Object {
"code": "/* code from http://globalcache.com/2ad175cb80ae79fd33b914bfb392fb6742982d2a-foo.js */", "code": "/* code from http://globalcache.com/17ce731dadd36402f15abb768843cb5e8ecf9ca7-foo.js */",
"dependencies": Array [], "dependencies": Array [],
"dependencyOffsets": Array [], "dependencyOffsets": Array [],
}, },
Object { Object {
"code": "/* code from http://globalcache.com/d6c0a1a4199d572ab68b36c07d0d68607eebb131-bar.js */", "code": "/* code from http://globalcache.com/d78572916bd877b6ac0e819e99be9fc2954f0e00-bar.js */",
"dependencies": Array [], "dependencies": Array [],
"dependencyOffsets": Array [], "dependencyOffsets": Array [],
}, },