Skip to content

Commit 19c54bc

Browse files
authored
Tests - Use relativePath to determine if we've already added a folder (#1880)
Checking the VS Code workspaceFolder's name against a constructed name is unrelable, leading to the same folder being attempted to be created multiple times.
1 parent 35fc264 commit 19c54bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/integration-tests/utilities/testutilities.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,12 @@ export const folderInRootWorkspace = async (
508508
workspaceContext: WorkspaceContext
509509
): Promise<FolderContext> => {
510510
const workspaceFolder = getRootWorkspaceFolder();
511-
let folder = workspaceContext.folders.find(f => f.workspaceFolder.name === `test/${name}`);
511+
let folder = workspaceContext.folders.find(f => f.relativePath === name);
512512
if (!folder) {
513+
workspaceContext.logger.info(`${name} not found, adding folder ${name} to workspace`);
513514
folder = await workspaceContext.addPackageFolder(testAssetUri(name), workspaceFolder);
515+
} else {
516+
workspaceContext.logger.info(`${name} found, reusing existing folder`);
514517
}
515518

516519
// Folders that aren't packages (i.e. assets/tests/scripts) wont generate build tasks.

0 commit comments

Comments
 (0)