From 9230c7996c922062865e116d71203d5f943e30dd Mon Sep 17 00:00:00 2001 From: Tim Pavlik Date: Fri, 25 Aug 2023 14:49:01 -0700 Subject: [PATCH] Attempt acceptance test fix --- .github/workflows/package-acceptance-test.yaml | 2 ++ test/acceptance/spl2.test.ts | 15 ++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/package-acceptance-test.yaml b/.github/workflows/package-acceptance-test.yaml index 5bbfd2c..a31e356 100644 --- a/.github/workflows/package-acceptance-test.yaml +++ b/.github/workflows/package-acceptance-test.yaml @@ -4,6 +4,8 @@ on: push: tags: - '*' + pull_request: + types: [opened, reopened, synchronize] jobs: package: diff --git a/test/acceptance/spl2.test.ts b/test/acceptance/spl2.test.ts index f641212..777a31b 100644 --- a/test/acceptance/spl2.test.ts +++ b/test/acceptance/spl2.test.ts @@ -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 { return new Promise(resolve => {