From 9e58ffc2b96f0b8039adcea6bbd7006d37c37f1a Mon Sep 17 00:00:00 2001 From: Matthias Linhuber Date: Thu, 27 Aug 2026 17:19:01 +0200 Subject: [PATCH] chore(renovate): adopt shared config and re-enable the test step Add a renovate.json extending the org-wide preset in EduIDE/.github so this repo only carries what is specific to it: pnpmDedupe, since we are on pnpm. Drop .whitesource, left over from an abandoned Mend Bolt trial. The test step in build.yml was commented out with "Tests are not implemented yet", which was not true - src/test/extension.test.ts exists and runs. Wire it back in. vscode-test launches a real VS Code instance, so it needs a display on Linux and runs under xvfb-run. No continue-on-error: a step that cannot fail is not a gate. Re-enabling it surfaced that the test build emitted nothing at all. The main tsconfig.json sets noEmit, and a --outDir on the command line does not override that, so `tsc -p . --outDir out` exited 0 having written no files and .vscode-test.mjs matched zero tests. Compile tests with a dedicated tsconfig.test.json instead, which turns emit on and produces CommonJS with relative .ts imports rewritten to .js. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01QLGHEpzx7D9NYHx4fCmHa9 --- .github/workflows/build.yml | 7 +++---- .vscodeignore | 1 + .whitesource | 14 -------------- README.md | 18 ++++++++++++++++++ package.json | 4 ++-- renovate.json | 5 +++++ tsconfig.test.json | 16 ++++++++++++++++ 7 files changed, 45 insertions(+), 20 deletions(-) delete mode 100644 .whitesource create mode 100644 renovate.json create mode 100644 tsconfig.test.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8df07ee..2ac686c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,8 +36,7 @@ jobs: - name: Build run: pnpm run build -# Tests are not implemented yet - # - name: Test - # run: pnpm run test - # continue-on-error: true + # vscode-test launches a real VS Code instance, which needs a display on Linux. + - name: Test + run: xvfb-run -a pnpm run test diff --git a/.vscodeignore b/.vscodeignore index c6b00f0..1d69387 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -14,6 +14,7 @@ test-data/** .yarnrc vsc-extension-quickstart.md tsconfig.json +tsconfig.test.json esbuild.js eslint.config.mjs pnpm-lock.yaml diff --git a/.whitesource b/.whitesource deleted file mode 100644 index 9c7ae90..0000000 --- a/.whitesource +++ /dev/null @@ -1,14 +0,0 @@ -{ - "scanSettings": { - "baseBranches": [] - }, - "checkRunSettings": { - "vulnerableCheckRunConclusionLevel": "failure", - "displayMode": "diff", - "useMendCheckNames": true - }, - "issueSettings": { - "minSeverityLevel": "LOW", - "issueType": "DEPENDENCY" - } -} \ No newline at end of file diff --git a/README.md b/README.md index 851ed9e..f352e67 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,21 @@ Set the log level in VS Code settings: - Use `logger.warn()` for recoverable issues (e.g., 404s, validation warnings) - Use `logger.error()` for failures (e.g., server errors, exceptions) - Never use `showInformationMessage()` for routine operations—reserve for critical user notifications only + +### Testing + +```bash +pnpm run test +``` + +`vscode-test` downloads and launches a real VS Code instance, so the tests need a display. On a +headless machine (including CI) run them under `xvfb-run -a pnpm run test`. + +The `pretest` hook compiles the sources with `tsconfig.test.json`, which is the only place emit is +configured: the main `tsconfig.json` is type-check only, so the test build overrides it to emit +CommonJS into `out/`. `.vscode-test.mjs` then picks up `out/test/**/*.test.js`. + +### Dependency updates + +Renovate keeps dependencies current. `renovate.json` extends the org-wide preset in +[`EduIDE/.github`](https://github.com/EduIDE/.github), so repo-local config stays minimal. diff --git a/package.json b/package.json index 7006224..0c2f8c8 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,8 @@ "watch:esbuild": "node esbuild.js --watch", "build": "pnpm run ts:check && pnpm run lint && node esbuild.js --production", "package": "vsce package --no-dependencies", - "compile-tests": "tsc -p . --outDir out", - "watch-tests": "tsc -p . -w --outDir out", + "compile-tests": "tsc -p ./tsconfig.test.json", + "watch-tests": "tsc -p ./tsconfig.test.json -w", "pretest": "pnpm run compile-tests && pnpm run compile && pnpm run lint", "ts:check": "tsc --noEmit", "ts:watch": "tsc --noEmit --watch --project tsconfig.json", diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..b54e28f --- /dev/null +++ b/renovate.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["local>EduIDE/.github:renovate-config"], + "postUpdateOptions": ["pnpmDedupe"] +} diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 0000000..88dbb83 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,16 @@ +{ + /* The main tsconfig is type-check only (noEmit) and keeps the source module + syntax as authored. vscode-test needs real CommonJS files on disk under + out/, so the test build overrides just enough to emit them. */ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "outDir": "out", + "module": "commonjs", + "moduleResolution": "node10", + "verbatimModuleSyntax": false, + /* Source files import each other with explicit .ts extensions; rewrite + those to .js so the emitted requires resolve. */ + "rewriteRelativeImportExtensions": true + } +}