Commit Graph

57 Commits

Author SHA1 Message Date
Matt Bierner
bf04914d59 Make sure js files still follow eslint semicolon rules 2025-11-12 13:54:56 -08:00
Aman Karmani
7deabf42e7 [engineering] add testSplit option to unit-test runner (#253049)
helpful to run tests in parallel
2025-07-07 20:34:30 +00:00
Ladislau Szomoru
4d7c56ee82 Engineering - Add GitHub action for pull requests (#254056)
* Test - handle running tests as part of a GitHub action

* Add GitHub action files
2025-07-04 08:21:56 +00:00
Samuel Rigaud
e975fc9be8 test: fix typos (#247259)
Co-authored-by: Samuel Rigaud <rigaud@gmail.com>
2025-04-23 23:38:49 +00:00
João Moreno
ae43cc72b6 make unit tests faster (#241847) 2025-02-25 15:18:20 +01:00
Johannes
d96ee375ea fix tests 2025-01-24 08:46:16 +01:00
Johannes Rieken
17f6bcb7d2 chore - modernise test runner (#235511)
async/wait, remove AMD/ESM split, cleanup
2024-12-06 18:53:29 +01:00
Johannes Rieken
1994ebabef tweak inline chat hint (#234821)
* make editor readonly and disable squiggle while inline chat shows reply

https://github.com/microsoft/vscode/issues/226160

* tweak inline chat hint

only show on intented empty lines, hide when command run

* fix tests (only disable squiggle, not readonlyness)
2024-11-28 12:58:47 +01:00
Johannes Rieken
e45ebc6d59 fail tests when having unhandled errors (#234673) 2024-11-26 08:32:08 -08: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
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
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
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
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
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
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
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
0656d21d11 auto-fixed prefer-const violation 2022-06-08 17:49:21 +02:00
Alex Dima
cab9713422 Fixes #141994: Address eslint problems 2022-02-02 13:18:12 +01:00
Benjamin Pasero
f317abfd68 layers - clean up top level workbench test folder 2022-01-20 10:47:35 +01:00
Alexandru Dima
7dfe2e33ea Fix test running around loading assertCleanState 2021-10-19 11:09:47 +02:00
Alex Dima
11862795ea Remove LanguageIdentifier and ensure tests dispose instantiated LanguagesRegistry objects 2021-10-18 10:29:16 +02:00
Connor Peet
c6d7cfed8a testing: fix undefined not being reported correctly in results
Fixes #125669
2021-07-07 15:28:55 -07:00
Connor Peet
24ea8408c3 testing: propoagate timeout option for unit tests 2021-04-29 12:19:56 -07:00
Benjamin Pasero
7095f4706c unit tests (electron) - avoid sending circular structures over 2021-04-21 08:13:08 +02:00
Alexandru Dima
533d094020 Allow logging FS access with stacks 2021-01-11 15:32:39 +01:00