Skip to content

Commit b8f4a80

Browse files
committed
Merge branch 'main' of github.com:mongodb-js/vscode into gagik/fix-tests
2 parents 4b54f5c + f45a4c7 commit b8f4a80

21 files changed

+225
-124
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ updates:
66
directory: /
77
schedule:
88
interval: daily
9+
cooldown:
10+
default-days: 7
11+
include:
12+
- "*"
913
allow:
1014
- dependency-name: mongodb
1115
- dependency-name: bson

.github/workflows/actions/test-and-build/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ runs:
6868
- name: Run Tests
6969
env:
7070
NODE_OPTIONS: "--max_old_space_size=4096"
71+
MDB_IS_TEST: "true"
7172
run: |
7273
npm run test
7374
shell: bash
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Dependabot PR
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
branches:
7+
- main
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
enable-auto-merge-on-dependabot-pr:
14+
name: Enable auto-merge for Dependabot PRs
15+
if: github.event.pull_request.user.login == 'dependabot[bot]'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Enable auto-merge for Dependabot PRs
19+
run: gh pr merge --auto --squash "$PR_URL"
20+
env:
21+
PR_URL: ${{github.event.pull_request.html_url}}
22+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/draft-release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
GARASIGN_USERNAME: ${{ secrets.GARASIGN_USERNAME }}
9797
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
9898
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
99+
MDB_IS_TEST: "true"
99100

100101
- name: Create Draft Release
101102
run: |
Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
name: Test and Build (from fork)
22
on:
3-
pull_request_target:
3+
pull_request:
44
branches:
55
- main
66
permissions:
7-
contents: write
8-
pull-requests: write
7+
contents: read
98

109
jobs:
1110
test-and-build:
@@ -22,10 +21,6 @@ jobs:
2221
steps:
2322
- name: Checkout
2423
uses: actions/checkout@v4
25-
with:
26-
fetch-depth: 0
27-
ref: ${{github.event.pull_request.head.ref}}
28-
repository: ${{github.event.pull_request.head.repo.full_name}}
2924

3025
- name: Setup Node.js Environment
3126
uses: actions/setup-node@v4
@@ -44,18 +39,6 @@ jobs:
4439
- name: Run Tests
4540
env:
4641
NODE_OPTIONS: "--max_old_space_size=4096"
47-
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY_DEV }}
42+
SEGMENT_KEY: "test-segment-key"
43+
MDB_IS_TEST: "true"
4844
run: npm run test
49-
50-
merge-dependabot-pr:
51-
name: Merge Dependabot PR
52-
runs-on: ubuntu-latest
53-
needs:
54-
- test-and-build
55-
if: github.event.pull_request.user.login == 'dependabot[bot]'
56-
steps:
57-
- name: Enable auto-merge for Dependabot PRs
58-
run: gh pr merge --auto --squash "$PR_URL"
59-
env:
60-
PR_URL: ${{github.event.pull_request.html_url}}
61-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test-and-build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ jobs:
5656
GARASIGN_USERNAME: ${{ secrets.GARASIGN_USERNAME }}
5757
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
5858
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
59+
MDB_IS_TEST: "true"

.vscode/launch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@
5353
"--extensionTestsPath=${workspaceFolder}/out/test/suite"
5454
],
5555
"env": {
56-
"MOCHA_GREP": "${input:mochaGrep}"
56+
"MOCHA_GREP": "${input:mochaGrep}",
57+
"MDB_IS_TEST": "true"
5758
},
5859
"outFiles": ["${workspaceFolder}/out/**/*.js"],
59-
"preLaunchTask": "npm: compile:extension",
60+
"preLaunchTask": "npm: compile:extension"
6061
}
6162
],
6263
"inputs": [

package-lock.json

Lines changed: 20 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
"watch:extension-bundles": "webpack --mode development --watch",
5353
"pretest": "npm run compile",
5454
"test": "npm run test-webview && npm run test-extension",
55-
"test-extension": "cross-env NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js",
56-
"test-webview": "cross-env NODE_OPTIONS='--no-experimental-strip-types' mocha -r ts-node/register --grep=\"${MOCHA_GREP}\" --file ./src/test/setup-webview.ts src/test/suite/views/webview-app/**/*.test.tsx",
57-
"ai-accuracy-tests": "cross-env NODE_OPTIONS='--no-experimental-strip-types' mocha -r ts-node/register --grep=\"${MOCHA_GREP}\" --file ./src/test/ai-accuracy-tests/test-setup.ts ./src/test/ai-accuracy-tests/ai-accuracy-tests.ts",
55+
"test-extension": "cross-env MDB_IS_TEST=true NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js",
56+
"test-webview": "mocha -r ts-node/register --grep=\"${MOCHA_GREP}\" --file ./src/test/setup-webview.ts src/test/suite/views/webview-app/**/*.test.tsx",
57+
"ai-accuracy-tests": "env TS_NODE_FILES=true mocha -r ts-node/register --grep=\"${MOCHA_GREP}\" --file ./src/test/ai-accuracy-tests/test-setup.ts ./src/test/ai-accuracy-tests/ai-accuracy-tests.ts",
5858
"analyze-bundle": "webpack --mode production --analyze",
5959
"vscode:prepublish": "npm run clean && npm run compile:constants && npm run compile:resources && webpack --mode production",
6060
"check": "npm run lint && npm run depcheck",

src/connectionController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@ export default class ConnectionController {
738738

739739
if (!this._activeDataService) {
740740
log.error('Unable to disconnect: no active connection');
741+
this._disconnecting = false;
741742
return false;
742743
}
743744

0 commit comments

Comments
 (0)