Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Jan 5, 2025
1 parent 1ea04de commit 3213d64
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
28 changes: 21 additions & 7 deletions src/test/datascience/notebook/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -975,26 +975,33 @@ export async function waitForExecutionCompletedSuccessfullyV2(
disposables: IDisposable[] | DisposableStore
) {
const checkCompletedSuccessfully = () => {
traceInfo(

Check failure on line 978 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Build VSIX

Cannot find name 'traceInfo'.

Check failure on line 978 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 978 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 978 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
`10.a Check execution summary: ${cell.index}: Success = ${cell.executionSummary?.success}, order = ${cell.executionSummary?.executionOrder}, End Time = ${cell.executionSummary?.timing?.endTime}`
);
return cell.executionSummary?.success &&
cell.executionSummary.executionOrder &&
cell.executionSummary.timing?.endTime
? true
: false;
};
traceInfo(`10. Check execution summary: Check ${cell.index}`);

Check failure on line 987 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 987 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 987 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
if (checkCompletedSuccessfully()) {
traceInfo(`11. Check execution summary: Success ${cell.index}`);

Check failure on line 989 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 989 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 989 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
return;
}
await new Promise((resolve) => {
traceInfo(`12. Check execution summary: Event Handler Added ${cell.index}`);

Check failure on line 993 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 993 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 993 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
const disposable = workspace.onDidChangeNotebookDocument((e) => {
if (e.notebook !== cell.notebook) {
traceInfo(`13. Check execution summary: Wrong Notebook ${cell.index}`);

Check failure on line 996 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 996 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 996 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
return;
}
e.cellChanges.forEach(() => {
if (checkCompletedSuccessfully()) {
disposable.dispose();
resolve;
}
});
traceInfo(`14. Check execution summary: Check ${cell.index}`);

Check failure on line 999 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 999 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 999 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
if (checkCompletedSuccessfully()) {
traceInfo(`14. Check execution summary: Resolve ${cell.index}`);

Check failure on line 1001 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 1001 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 1001 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
disposable.dispose();
resolve;
}
});
if (Array.isArray(disposables)) {
disposables.push(disposable);
Expand Down Expand Up @@ -1250,18 +1257,25 @@ export async function waitForTextOutputV2(
disposables: IDisposable[] | DisposableStore
) {
try {
traceInfo(`2. Check output in cell ${cell.index}`);

Check failure on line 1260 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 1260 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 1260 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
assertHasTextOutputInVSCode(cell, text, index, isExactMatch);
traceInfo(`3. Check output in cell: Success ${cell.index}`);

Check failure on line 1262 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 1262 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 1262 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
return;
} catch {
} catch (ex) {
traceInfo(`3.a Check output in cell: Fail ${cell.index}`, ex);

Check failure on line 1265 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (ubuntu-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 1265 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (macos-latest, 3.10)

Cannot find name 'traceInfo'.

Check failure on line 1265 in src/test/datascience/notebook/helper.ts

View workflow job for this annotation

GitHub Actions / Smoke tests (windows-latest, 3.10)

Cannot find name 'traceInfo'.
//
}
await new Promise<void>((resolve) => {
traceInfo(`4. Check output in cell: Added EventHandler ${cell.index}`);
const disposable = workspace.onDidChangeNotebookDocument((e) => {
if (e.notebook !== cell.notebook) {
traceInfo(`5. Check output in cell: Wrong Notebook ${cell.index}`);
return;
}
try {
traceInfo(`6. Check output in cell: Event Received ${cell.index}`);
assertHasTextOutputInVSCode(cell, text, index, isExactMatch);
traceInfo(`7. Check output in cell: Resolved ${cell.index}`);
resolve();
} catch {
//
Expand Down
2 changes: 1 addition & 1 deletion src/test/smoke/datascience.smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ suite('Smoke Tests', function () {
throw new Error(`Python environment not found ${PYTHON_PATH}`);
}
await jupyterExt.exports.openNotebook(notebook.uri, pythonEnv);

traceInfo(`1. Notebook Opened`);
await Promise.all([
vscode.commands.executeCommand<void>('notebook.execute'),
waitForTextOutputV2(notebook.cellAt(0), 'Hello World', 0, false, disposableStore),
Expand Down

0 comments on commit 3213d64

Please sign in to comment.