Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Sep 11, 2023
1 parent 93e94e6 commit 1ba5b82
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/test/testing/common/testingAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,28 @@ suite('End to End Tests: test adapters', () => {

await discoveryAdapter.discoverTests(workspaceUri).finally(() => {
// verification after discovery is complete
resultResolver.verify(
(x) => x.resolveDiscovery(typeMoq.It.isAny(), typeMoq.It.isAny()),
typeMoq.Times.once(),
);
// resultResolver.verify(
// (x) => x.resolveDiscovery(typeMoq.It.isAny(), typeMoq.It.isAny()),
// typeMoq.Times.once(),
// );

// 1. Check the status is "success"
assert.strictEqual(actualData.status, 'success', "Expected status to be 'success'");
// 2. Confirm no errors
assert.strictEqual(actualData.error, undefined, "Expected no errors in 'error' field");
// 3. Confirm tests are found
assert.ok(actualData.tests, 'Expected tests to be present');
});

await discoveryAdapter.discoverTests(Uri.parse(rootPathErrorWorkspace)).finally(() => {
// verification after discovery is complete

// 1. Check the status is "success"
assert.strictEqual(actualData.status, 'success', "Expected status to be 'success'");
// 2. Confirm no errors
assert.strictEqual(actualData.error, undefined, "Expected no errors in 'error' field");
// 3. Confirm tests are found
console.log(actualData.tests);
assert.ok(actualData.tests, 'Expected tests to be present');
});
});
Expand Down Expand Up @@ -269,7 +281,7 @@ suite('End to End Tests: test adapters', () => {
(x) => x.resolveExecution(typeMoq.It.isAny(), typeMoq.It.isAny()),
typeMoq.Times.once(),
);

console.log('for testing, data result', JSON.stringify(actualData));
// 1. Check the status is "success"
assert.strictEqual(actualData.status, 'success', "Expected status to be 'success'");
// 2. Confirm tests are found
Expand Down Expand Up @@ -372,7 +384,7 @@ suite('End to End Tests: test adapters', () => {
(x) => x.resolveExecution(typeMoq.It.isAny(), typeMoq.It.isAny()),
typeMoq.Times.once(),
);

console.log('for testing, data result', JSON.stringify(actualData));
// 1. Check the status is "success"
assert.strictEqual(actualData.status, 'success', "Expected status to be 'success'");
// 2. Confirm no errors
Expand Down Expand Up @@ -431,7 +443,6 @@ suite('End to End Tests: test adapters', () => {
});
});
test('unittest execution adapter seg fault error handling', async () => {
// generate list of test_ids
const testId = `test_seg_fault.TestSegmentationFault.test_segfault`;
const testIds: string[] = [testId];
let foundId = '';
Expand All @@ -447,6 +458,7 @@ suite('End to End Tests: test adapters', () => {
// 3. Confirm tests are found
assert.ok(data.result, 'Expected results to be present');
[foundId] = Object.keys(data.result);
console.log('for testing, data result', JSON.stringify(data));
return Promise.resolve();
});

Expand All @@ -470,7 +482,6 @@ suite('End to End Tests: test adapters', () => {
} as any),
);
await executionAdapter.runTests(workspaceUri, testIds, false, testRun.object).finally(() => {
// resolve execution should be called 200 times since there are 200 tests run.
resultResolver.verify(
(x) => x.resolveExecution(typeMoq.It.isAny(), typeMoq.It.isAny()),
typeMoq.Times.exactly(1),
Expand All @@ -483,7 +494,6 @@ suite('End to End Tests: test adapters', () => {
});
});
test('pytest execution adapter seg fault error handling', async () => {
// generate list of test_ids
const testId = `${rootPathErrorWorkspace}/test_seg_fault.py::TestSegmentationFault::test_segfault`;
const testIds: string[] = [testId];
let foundId = '';
Expand Down Expand Up @@ -522,7 +532,6 @@ suite('End to End Tests: test adapters', () => {
} as any),
);
await executionAdapter.runTests(workspaceUri, testIds, false, testRun.object, pythonExecFactory).finally(() => {
// resolve execution should be called 200 times since there are 200 tests run.
resultResolver.verify(
(x) => x.resolveExecution(typeMoq.It.isAny(), typeMoq.It.isAny()),
typeMoq.Times.exactly(1),
Expand Down

0 comments on commit 1ba5b82

Please sign in to comment.