|
17 | 17 | type: string |
18 | 18 |
|
19 | 19 | jobs: |
20 | | - test-extension: |
21 | | - name: Test VSCode Extension |
| 20 | + unit-test-extension: |
| 21 | + name: Run unit tests |
22 | 22 | runs-on: ${{ inputs.os }} |
23 | 23 | environment: |
24 | 24 | name: azure-prod-usr |
|
43 | 43 | node-version: ${{ inputs.node-version }} |
44 | 44 | cache: "yarn" |
45 | 45 |
|
46 | | - - name: Cache wdio |
47 | | - uses: actions/cache@v3 |
48 | | - with: |
49 | | - path: /tmp/wdio-vscode-service |
50 | | - key: ${{ inputs.cli_arch }}-${{ inputs.vscode-version }}-wdio |
51 | | - |
52 | 46 | - name: Cache VSCode unit test runner |
53 | 47 | uses: actions/cache@v3 |
54 | 48 | with: |
@@ -76,18 +70,143 @@ jobs: |
76 | 70 | run: yarn run test:cov |
77 | 71 | working-directory: packages/databricks-vscode |
78 | 72 |
|
79 | | - - name: Integration Tests |
80 | | - run: yarn run test:integ:prepare && yarn run test:integ:run |
| 73 | + list-integration-test-specs: |
| 74 | + name: Generate integration test matrix |
| 75 | + runs-on: ${{ inputs.os }} |
| 76 | + outputs: |
| 77 | + specs: ${{ steps.generate-matrix.outputs.specs }} |
| 78 | + defaults: |
| 79 | + run: |
| 80 | + shell: bash |
| 81 | + |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v3 |
| 84 | + |
| 85 | + - name: Use Node.js ${{ inputs.node-version }} |
| 86 | + uses: actions/setup-node@v3 |
| 87 | + with: |
| 88 | + node-version: ${{ inputs.node-version }} |
| 89 | + cache: "yarn" |
| 90 | + |
| 91 | + - run: yarn install --immutable |
| 92 | + |
| 93 | + - name: Generate matrix |
| 94 | + id: generate-matrix |
| 95 | + run: | |
| 96 | + echo "specs=$(yarn ts-node scripts/list_integration_tests.ts)" |
| 97 | + echo "specs=$(yarn ts-node scripts/list_integration_tests.ts)" >> $GITHUB_OUTPUT |
81 | 98 | working-directory: packages/databricks-vscode |
82 | 99 |
|
83 | | - - name: Integration Tests SDK wrappers |
84 | | - run: yarn run test:integ:sdk |
| 100 | + extension-integration-tests: |
| 101 | + name: Run extension e2e integration tests |
| 102 | + needs: [list-integration-test-specs] |
| 103 | + strategy: |
| 104 | + fail-fast: false |
| 105 | + matrix: |
| 106 | + spec: ${{fromJson(needs.list-integration-test-specs.outputs.specs)}} |
| 107 | + |
| 108 | + runs-on: ${{ inputs.os }} |
| 109 | + environment: |
| 110 | + name: azure-prod-usr |
| 111 | + |
| 112 | + env: |
| 113 | + VSCODE_TEST_VERSION: ${{ inputs.vscode-version }} |
| 114 | + DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} |
| 115 | + DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} |
| 116 | + TEST_DEFAULT_CLUSTER_ID: ${{ secrets.TEST_VSCODE_CLUSTER_ID }} |
| 117 | + CLI_ARCH: ${{ inputs.cli_arch }} |
| 118 | + |
| 119 | + defaults: |
| 120 | + run: |
| 121 | + shell: bash |
| 122 | + |
| 123 | + steps: |
| 124 | + - uses: actions/checkout@v3 |
| 125 | + |
| 126 | + - name: Use Node.js ${{ inputs.node-version }} |
| 127 | + uses: actions/setup-node@v3 |
| 128 | + with: |
| 129 | + node-version: ${{ inputs.node-version }} |
| 130 | + cache: "yarn" |
| 131 | + |
| 132 | + - name: Get vscode engine |
| 133 | + id: vscode-engine |
| 134 | + run: | |
| 135 | + echo "vscode=$(cat package.json | jq .engines.vscode | tr -d '^"')" |
| 136 | + echo "vscode=$(cat package.json | jq .engines.vscode | tr -d '^"')" >> $GITHUB_OUTPUT |
| 137 | + working-directory: packages/databricks-vscode |
| 138 | + |
| 139 | + - name: Cache wdio |
| 140 | + id: wdio-cache |
| 141 | + uses: actions/cache@v3 |
| 142 | + with: |
| 143 | + path: packages/databricks-vscode/tmp/wdio-vscode-service |
| 144 | + key: ${{ inputs.cli_arch }}-${{ steps.vscode-engine.outputs.vscode }}-wdio |
| 145 | + |
| 146 | + - name: mkdir packages/databricks-vscode/tmp/wdio-vscode-service |
| 147 | + run: mkdir -p packages/databricks-vscode/tmp/wdio-vscode-service |
| 148 | + if: steps.wdio-cache.outputs.cache-hit != 'true' |
| 149 | + |
| 150 | + - run: yarn install --immutable |
| 151 | + |
| 152 | + - name: Fetching Databricks CLI |
| 153 | + run: yarn run package:cli:fetch |
| 154 | + working-directory: packages/databricks-vscode |
| 155 | + env: |
| 156 | + GH_TOKEN: ${{ github.token }} |
| 157 | + |
| 158 | + - name: Building packages |
| 159 | + run: yarn run build |
| 160 | + |
| 161 | + - name: Integration Tests |
| 162 | + run: yarn run test:integ:extension --spec ${{ matrix.spec.path }} |
85 | 163 | working-directory: packages/databricks-vscode |
86 | 164 |
|
87 | 165 | - name: Upload test logs |
88 | 166 | if: always() |
89 | 167 | continue-on-error: true |
90 | 168 | uses: actions/upload-artifact@v3 |
91 | 169 | with: |
92 | | - name: test-logs ${{ join(inputs.*, ' - ') }} - ${{ github.event_name }} |
| 170 | + name: test-logs ${{ join(inputs.*, ' - ') }} - ${{ matrix.spec.baseName }} - ${{ github.event_name }} |
93 | 171 | path: packages/databricks-vscode/logs |
| 172 | + |
| 173 | + sdk-wrappers-integration-tests: |
| 174 | + name: Run integration tests for SDK wrappers |
| 175 | + runs-on: ${{ inputs.os }} |
| 176 | + environment: |
| 177 | + name: azure-prod-usr |
| 178 | + |
| 179 | + env: |
| 180 | + VSCODE_TEST_VERSION: ${{ inputs.vscode-version }} |
| 181 | + DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} |
| 182 | + DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} |
| 183 | + TEST_DEFAULT_CLUSTER_ID: ${{ secrets.TEST_VSCODE_CLUSTER_ID }} |
| 184 | + CLI_ARCH: ${{ inputs.cli_arch }} |
| 185 | + |
| 186 | + defaults: |
| 187 | + run: |
| 188 | + shell: bash |
| 189 | + |
| 190 | + steps: |
| 191 | + - uses: actions/checkout@v3 |
| 192 | + |
| 193 | + - name: Use Node.js ${{ inputs.node-version }} |
| 194 | + uses: actions/setup-node@v3 |
| 195 | + with: |
| 196 | + node-version: ${{ inputs.node-version }} |
| 197 | + cache: "yarn" |
| 198 | + |
| 199 | + - run: yarn install --immutable |
| 200 | + |
| 201 | + - name: Fetching Databricks CLI |
| 202 | + run: yarn run package:cli:fetch |
| 203 | + working-directory: packages/databricks-vscode |
| 204 | + env: |
| 205 | + GH_TOKEN: ${{ github.token }} |
| 206 | + |
| 207 | + - name: Building packages |
| 208 | + run: yarn run build |
| 209 | + |
| 210 | + - name: Integration Tests SDK wrappers |
| 211 | + run: yarn run test:integ:sdk |
| 212 | + working-directory: packages/databricks-vscode |
0 commit comments