Skip to content

Commit

Permalink
Attempt acceptance test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fantavlik committed Aug 25, 2023
1 parent d566f07 commit 9230c79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/package-acceptance-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- '*'
pull_request:
types: [opened, reopened, synchronize]

jobs:
package:
Expand Down
15 changes: 6 additions & 9 deletions test/acceptance/spl2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,23 @@ const blankDocUri = vscode.Uri.file(path.join(docsDir, 'blank.spl2nb'));
suite('SPL2 Language Server acceptance', async () => {
vscode.window.showInformationMessage('Start all tests.');

test.skip('Language detected in .spl2nb should be SPL2', async () => {
await sleep(1000);
test('Language detected in .spl2nb should be SPL2', async () => {
const splunkExt = vscode.extensions.getExtension('Splunk.splunk');
const context = splunkExt?.activate();
console.log(`[DEBUG] opening ${blankDocUri} ...`);
// TODO: both these approaches result in Error: NO provider registered for view type: 'spl2-notebook'
// const cell = new vscode.NotebookCellData(vscode.NotebookCellKind.Code, '$q = from [{}]', 'splunk_spl2');
// const doc = await vscode.workspace.openNotebookDocument('spl2-notebook', new vscode.NotebookData([cell]));
const doc = await vscode.workspace.openNotebookDocument(blankDocUri);
await sleep(1000);
console.log(`[DEBUG] showing ${blankDocUri} ...`);
const editor = await vscode.window.showNotebookDocument(doc);
assert.ok(editor, 'Loading editor with blank example .spl2nb doc failed');
console.log(`[DEBUG] showing ${blankDocUri} ...`);
await sleep(1000);
await sleep(500);
console.log(`[DEBUG] accessing editor.notebook = ${editor.notebook} ...`);
const nb = editor.notebook;
assert.ok(nb, 'Loading editor.notebook with blank example .spl2nb doc failed');
assert.strictEqual(nb.notebookType, 'spl2-notebook');
assert.strictEqual(nb.cellAt(0).document.languageId, 'splunk_spl2');
}).timeout(2*60*1000); // 2 min
}).timeout(10*60*1000); // 10 min
}).timeout(1*60*1000); // 1 min
}).timeout(10*60*1000); // 5 min

function sleep(ms: number): Promise<void> {
return new Promise(resolve => {
Expand Down

0 comments on commit 9230c79

Please sign in to comment.