From c2b8b94de7dd1f9c36141bff861c1096a99ed1c6 Mon Sep 17 00:00:00 2001 From: David First Date: Fri, 20 Aug 2021 20:14:01 -0400 Subject: [PATCH] e2e-tests: remove "dereference" option from the copy on linux (#4781) Also, upgrade fs-extra from 9.x to 10.x to fix coping dirs with broken symlinks. This makes the copy scopes during tests much faster and less error prone. --- e2e/commands/export.e2e.1.ts | 2 +- package.json | 2 +- src/e2e-helper/e2e-scope-helper.ts | 3 +-- yarn.lock | 13 ++++++++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/e2e/commands/export.e2e.1.ts b/e2e/commands/export.e2e.1.ts index 1f203caab11..4265335ef7d 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; diff --git a/package.json b/package.json index fb2dc568342..b306b0de766 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 4c6a38943dc..8b6363e5dea 100644 --- a/src/e2e-helper/e2e-scope-helper.ts +++ b/src/e2e-helper/e2e-scope-helper.ts @@ -2,7 +2,6 @@ import fs from 'fs-extra'; import * as path from 'path'; - import { InteractiveInputs } from '../interactive/utils/run-interactive-cmd'; import { generateRandomStr } from '../utils'; import createSymlinkOrCopy from '../utils/fs/create-symlink-or-copy'; @@ -212,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 = true) { + 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 d0671e00b60..ddaa164b961 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"