From 5f62b01372d8a4a600af497c67f7abf242a5a98d Mon Sep 17 00:00:00 2001 From: David First Date: Fri, 20 Aug 2021 10:41:59 -0400 Subject: [PATCH 1/3] e2e-tests: remove "dereference" option from the copy on linux --- src/e2e-helper/e2e-scope-helper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/e2e-helper/e2e-scope-helper.ts b/src/e2e-helper/e2e-scope-helper.ts index 4c6a38943dc6..ede947d456a5 100644 --- a/src/e2e-helper/e2e-scope-helper.ts +++ b/src/e2e-helper/e2e-scope-helper.ts @@ -2,6 +2,7 @@ import fs from 'fs-extra'; import * as path from 'path'; +import { IS_WINDOWS } from '../constants'; import { InteractiveInputs } from '../interactive/utils/run-interactive-cmd'; import { generateRandomStr } from '../utils'; @@ -212,7 +213,7 @@ export default class ScopeHelper { * To make it faster, use this method before all tests, and then use getClonedLocalScope method to restore from the * cloned scope. */ - cloneLocalScope(dereferenceSymlinks = true) { + cloneLocalScope(dereferenceSymlinks = IS_WINDOWS) { const clonedScope = `${generateRandomStr()}-clone`; const clonedScopePath = path.join(this.scopes.e2eDir, clonedScope); if (this.debugMode) console.log(`cloning a scope from ${this.scopes.localPath} to ${clonedScopePath}`); From e993ac7f0593b80e4305eb9c798550bae04a641b Mon Sep 17 00:00:00 2001 From: David First Date: Fri, 20 Aug 2021 13:24:57 -0400 Subject: [PATCH 2/3] upgrade fs-extra from 9.x to 10.x to fix coping dirs with broken symlinks --- package.json | 2 +- src/e2e-helper/e2e-scope-helper.ts | 4 +--- yarn.lock | 13 ++++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fb2dc5683424..b306b0de7669 100644 --- a/package.json +++ b/package.json @@ -152,7 +152,7 @@ "execa": "2.1.0", "find-up": "5.0.0", "firstline": "2.0.2", - "fs-extra": "9.1.0", + "fs-extra": "10.0.0", "gitconfig": "2.0.8", "glob": "7.1.6", "globby": "11.0.1", diff --git a/src/e2e-helper/e2e-scope-helper.ts b/src/e2e-helper/e2e-scope-helper.ts index ede947d456a5..8b6363e5dead 100644 --- a/src/e2e-helper/e2e-scope-helper.ts +++ b/src/e2e-helper/e2e-scope-helper.ts @@ -2,8 +2,6 @@ import fs from 'fs-extra'; import * as path from 'path'; -import { IS_WINDOWS } from '../constants'; - import { InteractiveInputs } from '../interactive/utils/run-interactive-cmd'; import { generateRandomStr } from '../utils'; import createSymlinkOrCopy from '../utils/fs/create-symlink-or-copy'; @@ -213,7 +211,7 @@ export default class ScopeHelper { * To make it faster, use this method before all tests, and then use getClonedLocalScope method to restore from the * cloned scope. */ - cloneLocalScope(dereferenceSymlinks = IS_WINDOWS) { + cloneLocalScope(dereferenceSymlinks = false) { const clonedScope = `${generateRandomStr()}-clone`; const clonedScopePath = path.join(this.scopes.e2eDir, clonedScope); if (this.debugMode) console.log(`cloning a scope from ${this.scopes.localPath} to ${clonedScopePath}`); diff --git a/yarn.lock b/yarn.lock index d0671e00b60e..ddaa164b9614 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7133,7 +7133,7 @@ __metadata: find-up: 5.0.0 firstline: 2.0.2 flatted: 3.1.0 - fs-extra: 9.1.0 + fs-extra: 10.0.0 fuse.js: 6.4.6 get-port: 5.1.1 gh-release: 3.5.0 @@ -18366,6 +18366,17 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:10.0.0": + version: 10.0.0 + resolution: "fs-extra@npm:10.0.0" + dependencies: + graceful-fs: ^4.2.0 + jsonfile: ^6.0.1 + universalify: ^2.0.0 + checksum: 5285a3d8f34b917cf2b66af8c231a40c1623626e9d701a20051d3337be16c6d7cac94441c8b3732d47a92a2a027886ca93c69b6a4ae6aee3c89650d2a8880c0a + languageName: node + linkType: hard + "fs-extra@npm:9.1.0, fs-extra@npm:^9.0.1": version: 9.1.0 resolution: "fs-extra@npm:9.1.0" From d829f1b0e24bba9c1ac035952ef9f760c76571c0 Mon Sep 17 00:00:00 2001 From: David First Date: Fri, 20 Aug 2021 15:27:32 -0400 Subject: [PATCH 3/3] fix tests --- e2e/commands/export.e2e.1.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/commands/export.e2e.1.ts b/e2e/commands/export.e2e.1.ts index 1f203caab11a..4265335ef7d0 100644 --- a/e2e/commands/export.e2e.1.ts +++ b/e2e/commands/export.e2e.1.ts @@ -858,7 +858,7 @@ describe('bit export command', function () { forkScope = scopeName; forkScopePath = scopePath; helper.scopeHelper.addRemoteScope(forkScopePath); - localScope = helper.scopeHelper.cloneLocalScope(); + localScope = helper.scopeHelper.cloneLocalScope(true); }); describe('with id and --include-dependencies flag', () => { let forkScopeIds;