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 54989d0aaf
commit d5288e7698
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
* example, the username if someone works their home directory (very likely).
* We need to get rid of this user-and-machine-dependent data for the global
* cache, otherwise nobody would share the same cache keys.
* The transform options contain absolute paths. This can contain, for example,
* the username if someone works their home directory (very likely). We get rid
* of this local data for the global cache, otherwise nobody would share the
* 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(
options: TransformOptions,
@ -115,9 +116,7 @@ function globalizeTransformOptions(
...options,
transform: {
...transform,
projectRoots: transform.projectRoots.map(p => {
return path.relative(path.join(__dirname, '../../../../..'), p);
}),
projectRoots: [],
},
};
}

View File

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

View File

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