MCPcopy Index your code
hub / github.com/devcontainers/cli / doRunAutoTest

Function doRunAutoTest

src/spec-node/featuresCLI/testCommandImpl.ts:299–320  ·  view source on GitHub ↗
(feature: string, workspaceFolder: string, featureTestFolder: string, args: FeaturesTestCommandInput, testResults: TestResult[] = [])

Source from the content-addressed store, hash-verified

297}
298
299async function doRunAutoTest(feature: string, workspaceFolder: string, featureTestFolder: string, args: FeaturesTestCommandInput, testResults: TestResult[] = []): Promise<TestResult[]> {
300 const { cliHost } = args;
301 const testScriptPath = path.join(featureTestFolder, 'test.sh');
302 if (!(await cliHost.isFile(testScriptPath))) {
303 fail(`Could not find test.sh script at ${testScriptPath}`);
304 }
305
306 // Move the entire test directory for the given Feature into the workspaceFolder
307 await cpDirectoryLocal(featureTestFolder, workspaceFolder);
308
309 // Move the test library script into the workspaceFolder test scripts folder.
310 await cliHost.writeFile(path.join(workspaceFolder, TEST_LIBRARY_SCRIPT_NAME), Buffer.from(testLibraryScript));
311
312 // Execute Test
313 const result = await execTest('test.sh', workspaceFolder, cliHost);
314 testResults.push({
315 testName: feature,
316 result,
317 });
318
319 return testResults;
320}
321
322async function doScenario(pathToTestDir: string, targetFeatureOrGlobal: string, args: FeaturesTestCommandInput, testResults: TestResult[] = []): Promise<TestResult[]> {
323 const { collectionFolder, cliHost, filter } = args;

Callers 1

runFeatureTestsFunction · 0.85

Calls 4

failFunction · 0.85
execTestFunction · 0.85
isFileMethod · 0.65
writeFileMethod · 0.65

Tested by

no test coverage detected