51 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
3b68a06818
esm - removal of CSS loader (#230206) 2024-10-01 19:24:18 +02:00
Benjamin Pasero
332b89f198
esm - remove AMD build scripts, tests and variables 2024-09-27 08:04:01 +02:00
Robo
b5a6aa14a8
feat: switch to npm as default package manager (#226927)
* feat: move from yarn to npm

* chore: skip yarn.lock files

* fix: playwright download

* chore: fix compile and hygiene

* chore: bump vsce@2.17.0

Refs 8b49e9dfdf

* test: update results for bat and sh colorizer tests

* fix: add missing lock files for windows

* fix: switch to legacy-peer-deps

* chore: update markdown-it@14.1.0

Refs 737c95a129

esbuild step in extensions-ci-pr was previously using markdown-it
from root which had userland punycode and was able to compile successfully.

* ci: increase pr timeout for windows integration tests

* chore: fix product build

* build: ignore extension dev dependency for rcedit

* build: fix working directory inside container

* build: fix dependency generation

* npm: update dependencies

* ci: use global npmrc

* ci: update cache

* ci: setup global npmrc for private npm auth

* build: fix extension bundling

* chore: sync npm dependencies

* ci: debug env variables for container

* ci: fix win32 cli pipeline

* build: fix npmrc config usage for build/ and remote/ dirs

* fix: windows build

* fix: container builds

* fix: markdown-language-features tests and bundling

```
[03:58:22] Error: Command failed: /Users/demohan/.nvm/versions/node/v20.15.1/bin/node /Users/demohan/github/vscode/extensions/markdown-language-features/esbuild-notebook.js --outputRoot /Users/demohan/github/vscode/.build/extensions/markdown-language-features
✘ [ERROR] Could not resolve "punycode"

    extensions/markdown-language-features/node_modules/markdown-it/lib/index.js:14:27:
      14 │ var punycode     = require('punycode');
         ╵                            ~~~~~~~~~~

  The package "punycode" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
```

Adds userland package based on beed9aee2c

* fix: container builds for distro

* chore: update yarn occurrences

* fixup! chore: bump vsce@2.17.0

Uses the closest version to `main` branch that does not
include d3cc84cdec
while still having the fix 8b49e9dfdf

* chore: sync npm dependencies

* chore: sync npm dependencies

* chore: sync npm dependencies

* chore: throw error when yarn is used for installation

* chore: add review feedback

* chore: switch exec => run where needed

* chore: npm sync dependencies

* fix: markdown-language-features bundling

```
✘ [ERROR] Could not resolve "punycode"

    extensions/markdown-language-features/node_modules/markdown-it/lib/index.js:14:27:
      14 │ var punycode     = require('punycode');
         ╵                            ~~~~~~~~~~

  The package "punycode" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
```

Adds missing userland package based on markdown-it/markdown-it@beed9ae,
can be removed once we update markdown-it >= 14.1.0

* ci: rename no-yarn-lock-changes.yml

* chore: sync npm dependencies

* ci: restore no-yarn-lock-changes.yml

We can disable it in a separate PR to keep the required
checks happy and also need workflow edit perms.

* chore: sync npm dependencies

* ci: rebuild cache

* ci: fix no-package-lock-changes.yml

* chore: bump distro

* chore: rm yarn.lock files

* chore: rm yarn.lock files without dependencies

* chore: add vscode-selfhost-import-aid to postinstall dirs

* chore: bump distro
2024-09-06 22:18:02 +09:00
Sandeep Somavarapu
ebc02af2d8
rename electron-node to electron-utility (#227672) 2024-09-05 00:49:23 -07:00
Sandeep Somavarapu
01fcf004a6
Use electron net directly in shared process (#227553)
* Use electron net directly in shared process

* add built file

* introduce shared electron-node layer

* remove electron-utility layer

* fix (overlook): move back cli files to node
2024-09-04 07:26:43 -07:00
Benjamin Pasero
d60295dc0e
ESM: revisit need for _VSCODE_NODE_MODULES (fix #226453) (#227427) 2024-09-03 15:18:08 +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
02fcc994ac
esm - port over unit test changes (#225711) 2024-08-15 19:58:52 +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 3a11b47eee0cd39d658e67e4afb0007b708a12b1.

* 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 3a11b47eee0cd39d658e67e4afb0007b708a12b1.

* 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 df645f14506142d6b20be6f6bda6bc40286ff739.

* chore: bump electron@17.1.0

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

This reverts commit c3e948aa30f54b0ad20f1a99627949cda4ad0c9f.

* 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 01df559c184549248fcfbcecc5a616462e00c252.
This reverts commit 46301339b71e7f99187edd262b809e8788bcb358

* 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
Alex Dima
689467c841
Try to restore yarn mocha and move browser tests to /browser/ 2021-11-23 16:07:15 +01:00
Henning Dieterichs
00123b32a7
Updates sinon from 1.17 to 11.1. 2021-06-09 10:03:46 +02:00
Henning Dieterichs
294b3bdf16
Revert "Include sinon-test in renderer.html / index.html"
This reverts commit e4e0f8be89fa41806fd24b3d56baa9ff22dbe92b.
2021-06-08 17:18:34 +02:00
Henning Dieterichs
e4e0f8be89
Include sinon-test in renderer.html / index.html 2021-06-08 17:16:54 +02:00
Alex Dima
ca5144362b
Move coverage.js into test/unit 2020-02-07 12:37:26 +01:00
Alex Dima
97f826b007
Move assert.js into test/unit 2020-02-07 12:32:06 +01:00
Alex Dima
3ce3886428
Move css.mock to unit/node 2020-02-07 12:22:51 +01:00
Alex Dima
2e7c169024
Move more files to test/unit 2020-02-07 12:21:30 +01:00