Skip to content

Commit 169dfbf

Browse files
Install extension from vsix for integration tests (#377)
- Use bundled js in vsix instead of compiling it with ts-node when testing - Installing python extension is more stable now. - Also, the install is cached so it happens only 1 time - for the first suite, so integration tests are faster by about 30%. Co-authored-by: Fabian Jakobs <fabian.jakobs@databricks.com>
1 parent bbb4131 commit 169dfbf

File tree

15 files changed

+2805
-100
lines changed

15 files changed

+2805
-100
lines changed

packages/databricks-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@
527527
"fix": "eslint src --ext ts --fix && prettier . --write",
528528
"test:lint": "eslint src --ext ts && prettier . -c",
529529
"test:unit": "yarn run build && node ./out/test/runTest.js",
530-
"test:integ:prepare": "yarn run package && rm -rf extension && mkdir -p extension && unzip databricks*.vsix -d extension",
530+
"test:integ:prepare": "yarn run package",
531531
"test:integ:run": "wdio run src/test/e2e/wdio.conf.ts",
532532
"test:integ": "yarn run test:integ:prepare && yarn run test:integ:run",
533533
"test:cov": "nyc yarn run test:unit",

packages/databricks-vscode/src/test/e2e/configure.e2e.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import assert from "node:assert";
22
import path from "node:path";
33
import * as fs from "fs/promises";
4-
import {
5-
getViewSection,
6-
waitForPythonExtension,
7-
waitForTreeItems,
8-
} from "./utils";
4+
import {dismissNotifications, getViewSection, waitForTreeItems} from "./utils";
95
import {
106
CustomTreeSection,
117
InputBox,
@@ -41,11 +37,7 @@ describe("Configure Databricks Extension", async function () {
4137
host = process.env.DATABRICKS_HOST;
4238

4339
workbench = await browser.getWorkbench();
44-
});
45-
46-
it("should install vscode python extension", async function () {
47-
this.retries(1);
48-
await waitForPythonExtension();
40+
await dismissNotifications();
4941
});
5042

5143
it("should open VSCode", async function () {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"plugins": ["@typescript-eslint"],
9+
"rules": {
10+
"@typescript-eslint/naming-convention": "warn",
11+
"@typescript-eslint/semi": "warn",
12+
"curly": "warn",
13+
"eqeqeq": "warn",
14+
"no-throw-literal": "warn",
15+
"semi": "off"
16+
},
17+
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
18+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/.yarn/**
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--ignore-engines true
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# dummy-test README
2+
3+
This is the README for your extension "dummy-test". After writing up a brief description, we recommend including the following sections.
4+
5+
## Features
6+
7+
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
8+
9+
For example if there is an image subfolder under your extension project workspace:
10+
11+
\!\[feature X\]\(images/feature-x.png\)
12+
13+
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
14+
15+
## Requirements
16+
17+
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
18+
19+
## Extension Settings
20+
21+
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
22+
23+
For example:
24+
25+
This extension contributes the following settings:
26+
27+
- `myExtension.enable`: Enable/disable this extension.
28+
- `myExtension.thing`: Set to `blah` to do something.
29+
30+
## Known Issues
31+
32+
Calling out known issues can help limit users opening duplicate issues against your extension.
33+
34+
## Release Notes
35+
36+
Users appreciate release notes as you update your extension.
37+
38+
### 1.0.0
39+
40+
Initial release of ...
41+
42+
### 1.0.1
43+
44+
Fixed issue #.
45+
46+
### 1.1.0
47+
48+
Added features X, Y, and Z.
49+
50+
---
51+
52+
## Following extension guidelines
53+
54+
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
55+
56+
- [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)
57+
58+
## Working with Markdown
59+
60+
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
61+
62+
- Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
63+
- Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
64+
- Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.
65+
66+
## For more information
67+
68+
- [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
69+
- [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
70+
71+
**Enjoy!**
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "dummy-test",
3+
"displayName": "dummy-test",
4+
"description": "A dummy extension to run integration tests",
5+
"version": "0.0.1",
6+
"engines": {
7+
"vscode": "^1.74.0"
8+
},
9+
"categories": [
10+
"Other"
11+
],
12+
"main": "./out/extension.js",
13+
"scripts": {
14+
"vscode:prepublish": "yarn run compile",
15+
"compile": "tsc -p ./",
16+
"watch": "tsc -watch -p ./",
17+
"pretest": "yarn run compile && yarn run lint",
18+
"lint": "eslint src --ext ts"
19+
},
20+
"devDependencies": {
21+
"@types/glob": "^8.0.0",
22+
"@types/mocha": "^10.0.1",
23+
"@types/node": "16.x",
24+
"@types/vscode": "^1.74.0",
25+
"@typescript-eslint/eslint-plugin": "^5.45.0",
26+
"@typescript-eslint/parser": "^5.45.0",
27+
"@vscode/test-electron": "^2.2.0",
28+
"eslint": "^8.28.0",
29+
"glob": "^8.0.3",
30+
"mocha": "^10.1.0",
31+
"typescript": "^4.9.3"
32+
}
33+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// The module 'vscode' contains the VS Code extensibility API
2+
// Import the module and reference it with the alias vscode in your code below
3+
import * as vscode from "vscode";
4+
5+
// This method is called when your extension is activated
6+
// Your extension is activated the very first time the command is executed
7+
export function activate(context: vscode.ExtensionContext) {}
8+
9+
// This method is called when your extension is deactivated
10+
export function deactivate() {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "ES2020",
5+
"outDir": "out",
6+
"lib": ["ES2020"],
7+
"sourceMap": true,
8+
"rootDir": "src",
9+
"strict": true /* enable all strict type-checking options */
10+
/* Additional Checks */
11+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
12+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
13+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
14+
}
15+
}

0 commit comments

Comments
 (0)