Commit Graph

35 Commits

Author SHA1 Message Date
Osvaldo Ortega ae536d389c Exclude web.test.js 2026-03-10 16:00:59 -07:00
Benjamin Pasero cdf404ff47 debt - restore old layer name (#250928) 2025-06-09 07:08:43 +00:00
João Moreno ae43cc72b6 make unit tests faster (#241847) 2025-02-25 15:18:20 +01:00
Benjamin Pasero f09184ceb7 esm - set type: module top level (#230210) 2024-10-01 20:48:56 +02: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 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 35faacda93 print loader error 2024-06-04 08:23:17 +02: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 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 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
Robo e5f61433b5 chore: update to Electron 22 (#177600)
* Revert "chore: revert to Electron 19 (#175851)"

This reverts commit 3a11b47eee.

* chore: bump electron@22.3.3

* build: use custom version for V8 sandbox

* chore: update electron@22.4.1

* chore: enable forceAllocationsToV8Sandbox for extension host

* chore: bump electron@22.4.2

* chore: bump electron@22.4.3

* sandbox - cleanup from electron 22 update (#178919)

* Revert "chore: revert to Electron 19 (#175851)"

This reverts commit 3a11b47eee.

* chore: bump electron@22.3.3

* build: use custom version for V8 sandbox

* chore: update electron@22.4.1

* chore: enable forceAllocationsToV8Sandbox for extension host

* chore: bump electron@22.4.2

* chore: bump electron@22.4.3

* temp: update distro

* sandbox - cleanup from electron 22 update

* missing comile

* more changes

* fix build

* restore

* 💄

* compile

---------

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
2023-04-03 09:09:31 +02:00
Johannes d555777b1a simplify _VSCODE_NODE_MODULES util 2022-11-18 09:42:32 +01:00
Johannes 824c70b275 fix node tests 2022-11-18 09:42:15 +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 1a0223da3f fix node tests 2022-11-17 17:19:29 +01: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
Benjamin Pasero 08ac1bb67c tests - improve exclusion handling for node.js tests 2022-04-21 17:10:16 +02:00
Benjamin Pasero 12500e46ac properly skip unit test (#137853) 2022-04-11 17:02:34 +02:00
Benjamin Pasero 9a78ee3b1a unit - skip all tests for test component in node 2022-04-05 17:27:24 +02:00
Benjamin Pasero 2ada17080c Use playwright for desktop smoke tests (#146692)
* Use `playwright` for desktop smoke tests

* fix distro issues

* tests - enable prefs tests for web
2022-04-04 10:13:08 +02:00
Connor Peet 6fcf02f29a testing: re-enable possibly fixed tests 2022-04-01 13:20:50 -07: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 f613ab462e tests - skip some, enable some 2022-02-09 07:14:42 +01:00
Alex Dima cab9713422 Fixes #141994: Address eslint problems 2022-02-02 13:18:12 +01:00
Alex Dima 1498d0f340 Add explicit layers for editor contributions (fixes #140995) 2022-01-21 10:29:55 +01:00
Connor Peet 2b19344369 testing: debug test failures
For #137853
2021-12-14 11:29:14 -08:00
Benjamin Pasero 687521092d smoke - print running tasks after smoke test run 2021-11-29 10:12:42 +01:00
Benjamin Pasero 12178a4cf7 unit - exclude more tests for node.js runs (#137853) 2021-11-29 10:02:03 +01:00
Benjamin Pasero 754190f326 Run unit tests against node.js too (#137790)
* tests - run unit tests also against node.js

* fixes

* fail if major node.js version mismatch

* -tfs is unsupported

* Add `@ts-check` and remove `jsdom`

* tests - process.env layer breaker

* Improve loader config

* skip one test

* address todos

* try to force color output

* Use a file: URI as baseUrl

Co-authored-by: Alex Dima <alexdima@microsoft.com>
2021-11-24 13:45:17 +01:00