Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/sanity/README.md
5240 views

VS Code Release Sanity Check Tests

Overview

Automated end-to-end release sanity tests for published VS Code builds. These tests verify critical functionality across different platforms and installation methods, ensuring that published builds meet quality standards before reaching end users.

See Sanity Check wiki page for more details on sanity testing.

Usage

Many tests will use the underlying platform to install and verify basic VS Code functionality. Such tests will need to be run on the corresponding target OS/virtual machine and will fail if ran outside. Use -g or -f command-line options to filter tests to match the host platform.

Command-Line Options

OptionAliasDescription
--commit <commit>-cThe commit to test (required)
--quality <quality>-qThe quality to test (required, "stable", "insider" or "exploration")
--no-cleanupDo not cleanup downloaded files after each test
--no-signing-checkSkip Authenticode and codesign signature checks
--no-headlessRun tests with a visible UI (desktop tests only)
--no-detectionEnable all tests regardless of platform and skip executable runs
--grep <pattern>-gOnly run tests matching the given pattern (Mocha grep)
--fgrep <string>-fOnly run tests containing the given string (Mocha fgrep)
--test-results <path>-tOutput test results in JUnit format to the specified path
--timeout <sec>Set the test-case timeout in seconds (default: 600 seconds)
--verbose-vEnable verbose logging
--help-hShow this help message

Example

To run CLI tests for all platforms on given commit of Insiders build, from the root directory run:

npm run sanity-test -- --commit 19228f26df517fecbfda96c20956f7c521e072be --quality insider -g "cli*"

Scripts

Platform-specific scripts are provided in the scripts/ directory to set up the environment and run tests:

ScriptPlatformDescription
run-win32.cmdWindowsRuns tests using Edge as the Playwright browser
run-macOS.shmacOSInstalls Playwright WebKit and runs tests
run-ubuntu.shUbuntuSets up X11, Chromium, and Snap daemon, then runs tests
run-docker.shLinux (Docker)Builds and runs tests inside a Docker container
run-docker.cmdWindows (Docker)Windows wrapper for Docker-based Linux tests

Docker Script Options

The run-docker.sh script accepts the following options:

OptionDescription
--container <name>Container dockerfile name (required, e.g., "ubuntu", "alpine")
--arch <arch>Target architecture: amd64, arm64, or arm (default: amd64)
--base-image <image>Override the base Docker image (e.g., "ubuntu:24.04")

All other arguments are passed through to the sanity test runner.

Containers

Docker container definitions are provided in the containers/ directory for testing on various Linux distributions:

ContainerBase ImageDescription
alpineAlpine 3.xAlpine Linux with musl libc
centosCentOS Stream 9RHEL-compatible distribution
debian-10Debian 10 (Buster)Older Debian with legacy library versions
debian-12Debian 12 (Bookworm)Current Debian stable
fedoraFedora 36/40Cutting-edge RPM-based distribution
opensuseopenSUSE Leap 16.0SUSE-based enterprise distribution
redhatRed Hat UBI 9Red Hat Universal Base Image
ubuntuUbuntu 22.04/24.04Popular Debian-based distribution

Each container includes:

  • Node.js 22.x runtime

  • X11 server (Xvfb) for headless desktop testing

  • D-Bus for desktop integration

  • Architecture-specific VS Code dependencies

Some containers include web browser used for validating web server targets.

Running Tests in a Container

# Ubuntu 24.04 on amd64 ./scripts/run-docker.sh --container ubuntu --base-image ubuntu:24.04 -c <commit> -q insider # Alpine on arm64 ./scripts/run-docker.sh --container alpine --arch arm64 -c <commit> -q stable

CI/CD Pipeline

Sanity tests run in Azure Pipelines via the product-sanity-tests.yml pipeline.

Pipeline Parameters

ParameterDescription
buildQualityThe quality of the build to test: "exploration", "insider", or "stable"
buildCommitThe published build commit SHA
npmRegistryCustom NPM registry URL (optional)

Test Matrix

The pipeline tests across multiple platforms and architectures:

Native Hosts:

  • macOS arm64

  • Windows x64

  • Windows arm64

  • Ubuntu 22.04 x64 (native, with Snap support)

Partial Support:

For the following platforms only downloads are validated (and not install/runtime):

  • macOS x64

Linux Containers (amd64 and arm64):

  • Alpine 3.23

  • CentOS Stream 9

  • Debian 10 and 12 (also arm32)

  • Fedora 36 and 40

  • openSUSE Leap 16.0

  • Red Hat UBI 9

  • Ubuntu 22.04 and 24.04 (also arm32)

Pipeline Files

References

The following public documentation pages provide details on end-user VS Code setup scenarios.