Skip to content

Commit 60dcf80

Browse files
Command cleanup, integration test fixes and code coverage (#445)
- Cleanup command visibility. Only show commands like attach cluster after login. - Enable codecov - Fix integration tests
1 parent 11dda7e commit 60dcf80

File tree

19 files changed

+246
-225
lines changed

19 files changed

+246
-225
lines changed

.github/workflows/tests.yml

Lines changed: 138 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,143 @@
11
name: VSCode extension Tests
22

33
on:
4-
workflow_call:
5-
inputs:
6-
os:
7-
required: true
8-
type: string
9-
node-version:
10-
required: true
11-
type: string
12-
vscode-version:
13-
required: true
14-
type: string
15-
bricks_arch:
16-
required: true
17-
type: string
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
node-version:
10+
required: true
11+
type: string
12+
vscode-version:
13+
required: true
14+
type: string
15+
bricks_arch:
16+
required: true
17+
type: string
1818

1919
jobs:
20-
test-sdk:
21-
name: Test Databricks SDK
22-
runs-on: ${{ inputs.os }}
23-
environment:
24-
name: azure-prod-usr
25-
26-
defaults:
27-
run:
28-
shell: bash
29-
working-directory: packages/databricks-sdk-js
30-
env:
31-
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
32-
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
33-
TEST_DEFAULT_CLUSTER_ID: ${{ secrets.TEST_JS_SDK_CLUSTER_ID }}
34-
35-
steps:
36-
- uses: actions/checkout@v3
37-
38-
- name: Use Node.js ${{ inputs.node-version }}
39-
uses: actions/setup-node@v3
40-
with:
41-
node-version: ${{ inputs.node-version }}
42-
cache: "yarn"
43-
44-
- run: yarn install --immutable
45-
46-
- name: Building packages
47-
run: yarn run build
48-
49-
- name: Prettier and Linting
50-
run: yarn run test:lint
51-
52-
- name: Unit Tests With Code Cov
53-
run: yarn test:cov
54-
55-
- name: Integration Tests
56-
run: yarn run test:integ:cov
57-
58-
- run: |
59-
cd coverage
60-
mkdir -p all && mkdir -p final
61-
mv integration/coverage-final.json all/integration.json
62-
mv unit/coverage-final.json all/unit.json
63-
yarn nyc merge all final/final.json
64-
yarn nyc report --reporter text -t ./coverage/final >> $GITHUB_STEP_SUMMARY
65-
66-
test-extension:
67-
name: Test VSCode Extension
68-
runs-on: ${{ inputs.os }}
69-
environment:
70-
name: azure-prod-usr
71-
72-
env:
73-
VSCODE_TEST_VERSION: ${{ inputs.vscode-version }}
74-
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
75-
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
76-
TEST_DEFAULT_CLUSTER_ID: ${{ secrets.TEST_VSCODE_CLUSTER_ID }}
77-
BRICKS_ARCH: ${{ inputs.bricks_arch }}
78-
79-
defaults:
80-
run:
81-
shell: bash
82-
83-
steps:
84-
- uses: actions/checkout@v3
85-
86-
- name: Use Node.js ${{ inputs.node-version }}
87-
uses: actions/setup-node@v3
88-
with:
89-
node-version: ${{ inputs.node-version }}
90-
cache: "yarn"
91-
92-
- name: Cache wdio
93-
uses: actions/cache@v3
94-
with:
95-
path: /tmp/wdio-vscode-service
96-
key: ${{ inputs.bricks_arch }}-${{ inputs.vscode-version }}-wdio
97-
98-
- name: Cache VSCode unit test runner
99-
uses: actions/cache@v3
100-
with:
101-
path: /tmp/vscode-test-databricks
102-
key: ${{ inputs.bricks_arch }}-${{ inputs.vscode-version }}-vscode-test
103-
104-
- run: yarn install --immutable
105-
106-
- name: Prettier and Linting
107-
run: yarn run test:lint
108-
working-directory: packages/databricks-vscode
109-
110-
- name: Fetching Bricks CLI
111-
run: yarn run package:cli:fetch
112-
working-directory: packages/databricks-vscode
113-
114-
- name: Building packages
115-
run: yarn run build
116-
117-
- name: Unit Tests with Coverage (OSX)
118-
uses: GabrielBB/xvfb-action@v1
119-
if: inputs.os != 'windows-latest'
120-
with:
121-
run: yarn run test:cov
122-
working-directory: packages/databricks-vscode
123-
124-
- name: Unit Tests with Coverage (Windows)
125-
if: inputs.os == 'windows-latest'
126-
run: yarn run test:cov
127-
working-directory: packages/databricks-vscode
128-
129-
- name: Show coverage test result
130-
continue-on-error: true
131-
run: yarn nyc report --reporter text -t ./coverage >> $GITHUB_STEP_SUMMARY
132-
working-directory: packages/databricks-vscode
133-
134-
- name: Integration Tests
135-
run: yarn run test:integ
136-
working-directory: packages/databricks-vscode
137-
138-
- name: Upload test logs
139-
if: always()
140-
continue-on-error: true
141-
uses: actions/upload-artifact@v3
142-
with:
143-
name: test-logs ${{ join(inputs.*, ' - ') }} - ${{ github.event_name }}
144-
path: packages/databricks-vscode/logs
20+
test-sdk:
21+
name: Test Databricks SDK
22+
runs-on: ${{ inputs.os }}
23+
environment:
24+
name: azure-prod-usr
25+
26+
defaults:
27+
run:
28+
shell: bash
29+
working-directory: packages/databricks-sdk-js
30+
env:
31+
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
32+
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
33+
TEST_DEFAULT_CLUSTER_ID: ${{ secrets.TEST_JS_SDK_CLUSTER_ID }}
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
38+
- name: Use Node.js ${{ inputs.node-version }}
39+
uses: actions/setup-node@v3
40+
with:
41+
node-version: ${{ inputs.node-version }}
42+
cache: "yarn"
43+
44+
- run: yarn install --immutable
45+
46+
- name: Building packages
47+
run: yarn run build
48+
49+
- name: Prettier and Linting
50+
run: yarn run test:lint
51+
52+
- name: Unit Tests With Code Cov
53+
run: yarn test:cov
54+
55+
- name: Integration Tests
56+
run: yarn run test:integ:cov
57+
58+
- name: Upload coverage reports to Codecov
59+
uses: codecov/codecov-action@v3
60+
with:
61+
directory: ./coverage
62+
working-directory: packages/databricks-sdk-js
63+
64+
test-extension:
65+
name: Test VSCode Extension
66+
runs-on: ${{ inputs.os }}
67+
environment:
68+
name: azure-prod-usr
69+
70+
env:
71+
VSCODE_TEST_VERSION: ${{ inputs.vscode-version }}
72+
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
73+
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
74+
TEST_DEFAULT_CLUSTER_ID: ${{ secrets.TEST_VSCODE_CLUSTER_ID }}
75+
BRICKS_ARCH: ${{ inputs.bricks_arch }}
76+
77+
defaults:
78+
run:
79+
shell: bash
80+
81+
steps:
82+
- uses: actions/checkout@v3
83+
84+
- name: Use Node.js ${{ inputs.node-version }}
85+
uses: actions/setup-node@v3
86+
with:
87+
node-version: ${{ inputs.node-version }}
88+
cache: "yarn"
89+
90+
- name: Cache wdio
91+
uses: actions/cache@v3
92+
with:
93+
path: /tmp/wdio-vscode-service
94+
key: ${{ inputs.bricks_arch }}-${{ inputs.vscode-version }}-wdio
95+
96+
- name: Cache VSCode unit test runner
97+
uses: actions/cache@v3
98+
with:
99+
path: /tmp/vscode-test-databricks
100+
key: ${{ inputs.bricks_arch }}-${{ inputs.vscode-version }}-vscode-test
101+
102+
- run: yarn install --immutable
103+
104+
- name: Prettier and Linting
105+
run: yarn run test:lint
106+
working-directory: packages/databricks-vscode
107+
108+
- name: Fetching Bricks CLI
109+
run: yarn run package:cli:fetch
110+
working-directory: packages/databricks-vscode
111+
112+
- name: Building packages
113+
run: yarn run build
114+
115+
- name: Unit Tests with Coverage (OSX)
116+
uses: GabrielBB/xvfb-action@v1
117+
if: inputs.os != 'windows-latest'
118+
with:
119+
run: yarn run test:cov
120+
working-directory: packages/databricks-vscode
121+
122+
- name: Unit Tests with Coverage (Windows)
123+
if: inputs.os == 'windows-latest'
124+
run: yarn run test:cov
125+
working-directory: packages/databricks-vscode
126+
127+
- name: Upload coverage reports to Codecov
128+
uses: codecov/codecov-action@v3
129+
with:
130+
directory: ./coverage
131+
working-directory: packages/databricks-vscode
132+
133+
- name: Integration Tests
134+
run: yarn run test:integ
135+
working-directory: packages/databricks-vscode
136+
137+
- name: Upload test logs
138+
if: always()
139+
continue-on-error: true
140+
uses: actions/upload-artifact@v3
141+
with:
142+
name: test-logs ${{ join(inputs.*, ' - ') }} - ${{ github.event_name }}
143+
path: packages/databricks-vscode/logs

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Databricks extension for VSCode
22

3-
| System | Status |
4-
| ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5-
| Build ([main branch](https://github.com/databricks/databricks-vscode/commits/main)) | [![GitHub CI Status](https://github.com/databricks/databricks-vscode/actions/workflows/push.yml/badge.svg?branch=main)](https://github.com/databricks/databricks-vscode/actions/workflows/push.yml) |
6-
| [Marketplace](https://marketplace.visualstudio.com/items?itemName=databricks.databricks) | [![Marketplace Version](https://img.shields.io/vscode-marketplace/v/databricks.databricks.svg) ![Marketplace Downloads](https://img.shields.io/vscode-marketplace/d/databricks.databricks.svg)](https://marketplace.visualstudio.com/items?itemName=databricks.databricks) |
3+
| System | Status |
4+
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5+
| Build ([main branch](https://github.com/databricks/databricks-vscode/commits/main)) | [![GitHub CI Status](https://github.com/databricks/databricks-vscode/actions/workflows/push.yml/badge.svg?branch=main)](https://github.com/databricks/databricks-vscode/actions/workflows/push.yml) [![codecov](https://codecov.io/gh/databricks/databricks-vscode/branch/main/graph/badge.svg?token=PUN77X0W3Z)](https://codecov.io/gh/databricks/databricks-vscode) |
6+
| [Marketplace](https://marketplace.visualstudio.com/items?itemName=databricks.databricks) | [![Marketplace Version](https://img.shields.io/vscode-marketplace/v/databricks.databricks.svg) ![Marketplace Downloads](https://img.shields.io/vscode-marketplace/d/databricks.databricks.svg)](https://marketplace.visualstudio.com/items?itemName=databricks.databricks) |
77

88
## Introduction
99

0 commit comments

Comments
 (0)