Commit graph

97 commits

Author SHA1 Message Date
Benjamin Pasero 332b89f198
esm - remove AMD build scripts, tests and variables 2024-09-27 08:04:01 +02:00
Connor Peet f9877b1978
eng: re-add coverage support post-ESM (#227459)
Fixes #227432
2024-09-03 20:33:56 +02:00
Benjamin Pasero d60295dc0e
ESM: revisit need for _VSCODE_NODE_MODULES (fix #226453) (#227427) 2024-09-03 15:18:08 +02:00
Benjamin Pasero ca42f649a7
Allow to build an AMD version of VS Code (#227240) 2024-09-02 09:36:19 +02:00
Benjamin Pasero f0417069c6
esm - restore lost changes in tests from migration (#227225) 2024-08-30 09:12:48 -07:00
Benjamin Pasero 6b924c5152
ESM merge to main (#227184)
Co-authored-by: Johannes Rieken <jrieken@microsoft.com>
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
2024-08-30 10:31:46 +02:00
Benjamin Pasero 9f04aaf6f4
tests - depend on a test preload.js (#226588) 2024-08-26 10:14:27 +02:00
Benjamin Pasero 02fcc994ac
esm - port over unit test changes (#225711) 2024-08-15 19:58:52 +02:00
Connor Peet 7dde0a7943
eng: fix --run path in electron tests not working (#225422)
I assume this broke with some of the ESM work, but I have no idea how it was working before. This should be a better fix.
2024-08-12 18:58:54 +02:00
Benjamin Pasero 4c1b0e9ff1
esm - reduce diff (#224919)
* esm - reduce diff

* .

* .

* .

* .

* .
2024-08-06 17:32:43 +03:00
Benjamin Pasero f6f90e0163
Implement NLS without AMD loader (#214588) 2024-06-28 11:55:48 +02:00
Johannes Rieken 88d860624c
Inline chat UI overhaul (#215927)
* don't dimiss inline chat content widget when already having typed something

https://github.com/microsoft/vscode-copilot/issues/6067

* extract `TextOnlyMenuEntryActionViewItem` for reuse

* remove unused variables

* * show chat input below request/response pairs
* setting for text-only buttons
* more dynamic buttons
* always show the first request, don't repopulate input with last message
* keep progress bar hidden, rely on "Generating..."
* no more special background color

* add `minimal` renderer style for chat renderings

* tweak font-size for details when render mode is minimal

* stable scroll position for inline chat, don't push down the lines chat is editing but push the inline chat upwards

* more buttons more compact, tweak labels

* * add missing service dependency
* repopulate input for some unit test

* allow output from `InteractiveChatController` suite
2024-06-17 11:26:21 +02:00
Johannes 09981a84af
configure esModuleInterop: true, change some star-imports 2024-06-03 16:50:28 +02:00
Johannes Rieken 2d97803568
add ListenerRefusalError and ListenerLeakError which get logged when listener thresholds are exceeded. (#212900)
* add `ListenerRefusalError` and `ListenerLeakError` which get logged when listener thresholds are exceeded.

The `stack` property of these errors will point towards the most frequent listener and how often it is used. If that's a high number there is a leak (same listener is added over and over again), if that's a low number there might be a conceptual flaw that an emitter is simply too prominent.

* rightfully don't use Error.captureStackTrace (v8/nodejs only)
2024-05-16 08:29:17 -07:00
Connor Peet 358a3a65d3
fix incomplete coverage reports on macos (#212639)
* eng: fix incomplete coverage reports on macos

Wait for stdout to drain before exiting

* better fix
2024-05-13 15:27:00 -07:00
Connor Peet 2aa1079dbb
just use v8-to-istanbul 2024-05-08 15:42:43 -07:00
Johannes Rieken 880eee6a96
print warning about reused action ids, fix view action duplication (#202000)
* print warning about reused action ids, fix view action duplication

* remove debug code

* make tests happy-ish
2024-01-08 16:27:32 +01:00
Connor Peet 0385382382
testing: more out-of-editor refinements (#201834)
- Som more tweaks to our own runner scripts to allow asking for the
  generated coverage formats.
- Add actions alongside debug/run for executing coverage profiles
- Finish with displaying function coverage stats in Coverage view,
  allow changing its sort order.

Fixes #200529
Fixes #199380
2024-01-04 21:22:46 +01:00
Connor Peet c016ce64fb
testing: misc work on test coverage (#201758)
- Allow coverage bar color thresholds to be configurable as the Java
  folks requested.
- Update some of our scripts for integration into
  the selfhost test runner.
- Initial parts of showing function coverage in the Test Coverage view.
  (Still a work in progress, more tomorrow)
2024-01-04 08:42:22 +01:00
Connor Peet b964ed995a
eng: fix waitServer not working in unit test debug (#201334)
Fixes #182341
2023-12-20 14:09:46 -08:00
Connor Peet 027aa0ff19
testing: avoid console log in unit tests (#201141)
Fixes #192468
2023-12-18 18:39:13 +01:00
Johannes Rieken a5698e8857
Joh/rainy-mollusk (#200976)
* snippet completions should also check with the completion model

this will allow to return "more" from the snippet completion item provider and rely on the completions model to do some filtering

* when debugging tests allow to use console.log

* fix https://github.com/microsoft/vscode/issues/191070
2023-12-15 16:07:56 +01:00
Johannes Rieken 3056f52f92
add failing/skipped test for https://github.com/microsoft/vscode/issues/191070 (#200125)
* fix --dev option of unit tests fyi @joaomoreno

* fix timing issue when getting line, add failing/skipped test for https://github.com/microsoft/vscode/issues/191070
2023-12-06 12:16:49 +01:00
Logan Ramos e5e9a6556e
Remove extra console.log (#199985) 2023-12-04 22:23:08 +01:00
Connor Peet a0b548807a
eng: add assertHeap method for memory assertions (#198334)
This adds an `assertHeap` function that can be used in tests. It
takes a heap snapshot, and asserts the state of classes in memory. This
works in Node and the Electron sandbox, but is a no-op in the browser.
Snapshots are process asynchronously and will report failures at the end
of the suite.

This method should be used sparingly (e.g. once at the end of a suite to
ensure nothing leaked before), as gathering a heap snapshot is fairly
slow, at least until V8 11.5.130 (https://v8.dev/blog/speeding-up-v8-heap-snapshots).

When used, the function will ensure the test has a minimum timeout
duration of 20s to avoid immediate failures.

It takes options containing a mapping of class names, and assertion functions
to run on the number of retained instances of that class. For example:

```ts
assertSnapshot({
	classes: {
		ShouldNeverLeak: count => assert.strictEqual(count, 0),
		SomeSingleton: count => assert(count <= 1),
	}
});
```

Closes https://github.com/microsoft/vscode/issues/191920
2023-11-15 10:41:22 -08:00
João Moreno a5d71aad39
Cleanup dependencies (#195026)
* move build dependencies to devDependencies

* build: bump tree-sitter

* dependencies cleanup

* remove leftover file
2023-10-09 09:34:15 +02:00
Connor Peet c6a9da71a2
eng: allow snapshot mutation messages locally (#194498)
* eng: allow snapshot mutation messages locally

Fixes https://github.com/microsoft/vscode/issues/192439
Fixes https://github.com/microsoft/vscode/issues/194493

* keep snapshot tests allowed
2023-09-29 18:36:27 +01:00
Benjamin Pasero 6b9583d2dc
fix (#192807)
* fix

* fix

* fix

* fix
2023-09-11 12:54:53 -07:00
Benjamin Pasero 0c5c400ea5
debt - more polish in global test reporter (#192774)
* debt - more polish in global test reporter

* cleanup

* cleanup

* fixes
2023-09-11 17:16:16 +02:00
Benjamin Pasero edd2f9f3f1
eng - fail test that logs unexpected output (#192700)
eng - fail test that logs
2023-09-11 14:35:48 +02:00
Connor Peet 6a847ba6d1
eng: add support for snapshot tests (#190444)
* eng: add support for snapshot tests

This adds Jest-like support for snapshot testing.
Developers can do something like:

```js
await assertSnapshot(myComplexObject)
```

The first time this is run, the snapshot expectation file is written
to a `__snapshots__` directory beside the test file. Subsequent runs
will compare the object to the snapshot, and fail if it doesn't match.

You can see an example of this in the test for snapshots themselves!

After a successful run, any unused snapshots are cleaned up. On a failed
run, a gitignored `.actual` snapshot file is created beside the
snapshot for easy processing and inspection.

Shortly I will do some integration with the selfhost test extension to
allow developers to easily update snapshots from the vscode UI.

For #189680

cc @ulugbekna @hediet

* fix async stacktraces getting clobbered

* random fixes

* comment out leak detector, for now

* add option to snapshot file extension
2023-08-15 12:03:51 -07:00
Benjamin Pasero 424388032a
tests - increase timeout when running in CI (#182288) 2023-05-12 13:02:15 +02:00
Benjamin Pasero b0b69338e8
debt - further reduce electron-browser layer (#178504)
* debt - move more tests out of `electron-browser`

* move more tests

* move preload script as well

* fix
2023-03-28 10:35:58 -07:00
Johannes d555777b1a
simplify _VSCODE_NODE_MODULES util 2022-11-18 09:42:32 +01:00
Johannes 8dd8d214d8
don't use __$__nodeRequire to fetch product configuration 2022-11-18 09:41:51 +01:00
Johannes 2d6ad4be88
* add global for node_modules access
* remove most usages of require.__$__nodeRequire
* stop using require.nodeRequire
2022-11-18 09:41:43 +01:00
Raymond Zhao 9feaed8f51
Revert "joh/representative canidae" (#166641) 2022-11-17 13:53:17 -08:00
Johannes 6dd2726c73
simplify _VSCODE_NODE_MODULES util 2022-11-17 17:58:51 +01:00
Johannes 93c3f3202b
don't use __$__nodeRequire to fetch product configuration 2022-11-17 15:41:23 +01:00
Johannes 0824db3bad
* add global for node_modules access
* remove most usages of require.__$__nodeRequire
* stop using require.nodeRequire
2022-11-17 12:09:14 +01:00
Johannes 15b8f56574
fix rendering/UI for ./scripts/test.sh --dev 2022-10-04 14:51:58 +02:00
Alexandru Dima a68f9da5fe
There is no need to pass in nodeMain when passing in baseUrl (#160893) 2022-09-14 13:04:14 +02:00
Johannes Rieken 1857d6c076
for test runinng, use --dev instead of --debug (#159040)
fixes https://github.com/microsoft/vscode/issues/159011
2022-08-24 07:54:39 -04:00
deepak1556 c3077080ec Merge remote-tracking branch 'origin' into electron-18.x.y 2022-06-10 18:29:22 +09:00
Johannes 0656d21d11
auto-fixed prefer-const violation 2022-06-08 17:49:21 +02:00
deepak1556 1044556d8b chore: bump electron@18.0.0-beta.4 2022-05-31 08:25:29 +09:00
Robo 32d40cf44e
chore: update to electron 17 (#143223)
* chore: bump electron@17.0.0

* Revert "chore: revert to electron@13 (#143851)"

This reverts commit df645f1450.

* chore: bump electron@17.1.0

* Revert "ci: fix build with latest node-gyp"

This reverts commit c3e948aa30.

* chore: revert ci changes for node v16

* chore: update yarn.lock

* chore: bump electron@17.1.1
2022-03-11 00:51:37 +09:00
Robo df645f1450
chore: revert to electron@13 (#143851)
* Revert "chore: update to electron 16 (#137241)"

This reverts commit 01df559c18.
This reverts commit 46301339b7

* ci: fix remote compiler for sdl-scan

* chore: fix remote/.yarnrc

* chore: fix build/npm/postinstall.js

* chore: rm crash reporter from shared process

* chore: rm crash reporter from ext host

* chore: fix build/lib/layersChecker.ts

* :chore: preserve some more changes

* fix tests

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
2022-02-24 17:49:49 +01:00
Benjamin Pasero b344f43498
Revert "linux: disable crash reporting in CI (#142572)"
This reverts commit 7dbd7367dc.
2022-02-15 16:27:08 +01:00
Benjamin Pasero 7dbd7367dc
linux: disable crash reporting in CI (#142572) 2022-02-15 08:26:18 +01:00