Skip to content

Commit

Permalink
e2e-tests: remove "dereference" option from the copy on linux (#4781)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidfirst authored Aug 21, 2021
1 parent 6bec27c commit c2b8b94
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion e2e/commands/export.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions src/e2e-helper/e2e-scope-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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}`);
Expand Down
13 changes: 12 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c2b8b94

Please sign in to comment.