test/integration/goTest: log suspicious tests
I don't know why but Kokoro CI often gets stuck while running tests
in this file. I think it's probably a red herring and the culprit
is somewhere else (GitHub CI seems ok with this test). Let's log
to find where Kokoro CI gets stuck.
Change-Id: Ia35c8c5ea9e586d31a089800abde25e4069e9da1
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/358545
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
diff --git a/test/integration/goTest.run.test.ts b/test/integration/goTest.run.test.ts
index 56dc52c..76f3d84 100644
--- a/test/integration/goTest.run.test.ts
+++ b/test/integration/goTest.run.test.ts
@@ -76,10 +76,13 @@
const tests = Array.from(testExplorer.resolver.allItems).filter((x) => GoTest.parseId(x.id).name);
assert(tests, 'No tests found');
+ console.log(`running ${tests.length} tests`);
+
assert(
await testExplorer.runner.run({ include: tests }, null, { kind: 'cpu' }),
'Failed to execute `go test`'
);
+ console.log('verify we got expected calls');
const calls = await stub.getCalls();
assert.strictEqual(calls.length, tests.length, 'expected one call to goTest per test');
calls.forEach((call, i) =>
@@ -114,6 +117,7 @@
});
test('discover and run', async () => {
+ console.log('discover and run');
// Locate TestMain and TestOther
const tests = testExplorer.resolver.find(uri).filter((x) => GoTest.parseId(x.id).kind === 'test');
tests.sort((a, b) => a.label.localeCompare(b.label));
@@ -124,33 +128,40 @@
const [tMain, tOther] = tests;
// Run TestMain
+ console.log('Run TestMain');
assert(await testExplorer.runner.run({ include: [tMain] }), 'Failed to execute `go test`');
assert.strictEqual(spy.callCount, 1, 'expected one call to goTest');
// Verify TestMain was run
+ console.log('Verify TestMain was run');
let call = spy.lastCall.args[0];
assert.strictEqual(call.dir, subTestDir);
assert.deepStrictEqual(call.functions, ['TestMain']);
spy.resetHistory();
// Locate subtest
+ console.log('Locate subtest');
const tSub = tMain.children.get(GoTest.id(uri, 'test', 'TestMain/Sub'));
assert(tSub, 'Subtest was not created');
// Run subtest by itself
+ console.log('Run subtest by itself');
assert(await testExplorer.runner.run({ include: [tSub] }), 'Failed to execute `go test`');
assert.strictEqual(spy.callCount, 1, 'expected one call to goTest');
// Verify TestMain/Sub was run
+ console.log('Verify TestMain/Sub was run');
call = spy.lastCall.args[0];
assert.strictEqual(call.dir, subTestDir);
assert.deepStrictEqual(call.functions, ['TestMain/Sub']);
spy.resetHistory();
// Ensure the subtest hasn't been disposed
+ console.log('Ensure the subtest has not been disposed');
assert(tSub.parent, 'Subtest was disposed');
// Attempt to run subtest and other test - should not work
+ console.log('Attempt to run subtest and other test');
assert(await testExplorer.runner.run({ include: [tSub, tOther] }), 'Failed to execute `go test`');
assert.strictEqual(spy.callCount, 0, 'expected no calls to goTest');
});