Skip to content

Commit

Permalink
Assert lsp and java paths exist
Browse files Browse the repository at this point in the history
  • Loading branch information
fantavlik committed Aug 24, 2023
1 parent 0a4354d commit d48b7c8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions test/functional/spl2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import * as vscode from 'vscode';
import { Spl2NotebookSerializer } from '../../out/notebooks/spl2/serializer';
import {
configKeyAcceptedTerms,
configKeyJavaPath,
configKeyLspVersion,
getLatestSpl2Release,
getLspFilename,
getLocalLspDir,
installMissingSpl2Requirements,
TermsAcceptanceStatus } from '../../out/notebooks/spl2/installer';
// import { startSpl2ClientAndServer } from '../../out/notebooks/spl2/initializer';
Expand Down Expand Up @@ -87,10 +91,18 @@ suite('SPL2 Language Server functional', async () => {
// Before running tests, let's accept the terms of use since the UI can't be used to do this
// Record preference so user is not asked again
await vscode.workspace.getConfiguration().update(configKeyAcceptedTerms, TermsAcceptanceStatus.Accepted, true);
const tempDir = path.join(__dirname, '..', '..', '..', '.vscode-test', 'user-data', 'User', 'globalStorage', 'spl2-tests');
fs.mkdirSync(tempDir);
const storagePath = path.join(__dirname, '..', '..', '..', '.vscode-test', 'user-data', 'User', 'globalStorage', 'spl2-tests');
fs.mkdirSync(storagePath);
const installedLatestLsp = await installMissingSpl2Requirements(tempDir, progressBar);

Check failure on line 96 in test/functional/spl2.test.ts

View workflow job for this annotation

GitHub Actions / functional-test (macos-latest)

Cannot find name 'tempDir'.

Check failure on line 96 in test/functional/spl2.test.ts

View workflow job for this annotation

GitHub Actions / functional-test (ubuntu-latest)

Cannot find name 'tempDir'.

Check failure on line 96 in test/functional/spl2.test.ts

View workflow job for this annotation

GitHub Actions / functional-test (windows-latest)

Cannot find name 'tempDir'.

Check failure on line 96 in test/functional/spl2.test.ts

View workflow job for this annotation

GitHub Actions / acceptance-test (macos-latest)

Cannot find name 'tempDir'.

Check failure on line 96 in test/functional/spl2.test.ts

View workflow job for this annotation

GitHub Actions / acceptance-test (ubuntu-latest)

Cannot find name 'tempDir'.

Check failure on line 96 in test/functional/spl2.test.ts

View workflow job for this annotation

GitHub Actions / acceptance-test (windows-latest)

Cannot find name 'tempDir'.
assert.strictEqual(installMissingSpl2Requirements, true);
// TODO: assert that files exist in tempDir
assert.strictEqual(installedLatestLsp, true);
// Check for installed java and lsp
const javaPath: string = vscode.workspace.getConfiguration().get(configKeyJavaPath) || "";
assert.ok(javaPath);
assert.strictEqual(fs.existsSync(javaPath), true);
const lspVersion: string = vscode.workspace.getConfiguration().get(configKeyLspVersion) || "";
assert.ok(lspVersion);
const lspPath = path.join(getLocalLspDir(storagePath), getLspFilename(lspVersion));
assert.ok(lspPath);
assert.strictEqual(fs.existsSync(lspPath), true);
}).timeout(10*60*1000); // 10 minutes
}).timeout(15*60*1000); // 15 minutes

0 comments on commit d48b7c8

Please sign in to comment.