Skip to content

Commit

Permalink
prepare for v5.0.1 release (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
connectdotz authored Nov 4, 2022
1 parent d272bad commit 57463e7
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 46 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ shows the autoRun will be triggered by either test or source file changes.
### How to use the Test Explorer?
Users with `vscode` v1.59 and `vscode-jest` v4.1 and up will start to see tests appearing in the test explorer automatically. Test explorer provides a "test-centric" view, allows users to run/debug tests directly from the explorer (in addition to the inline debug codeLens), and provides a native terminal output experience (with colors!):

![TestExplorer-5.1.jpg](images/TestExplorer-5.1.jpg)
![TestExplorer-5.1.jpg](images/testExplorer-5.1.jpg)

<a id='how-to-toggle-auto-run'>**How to toggle autoRun for the workspace?**</a>
- In TestExplorer, click on the root of the test tree, i.e. the one with the workspace name and the current autoRun mode. You will see a list of buttons to its right.
Expand Down Expand Up @@ -356,7 +356,7 @@ There are 2 ways to change autoRun:
1. Temporarily [toggle autRun on/off in TestExplorer](#how-to-toggle-auto-run)
2. Change "jest.autoRun" in `settings.json` file.

**autoRun Configuration**
<a id="autorun-config">**autoRun Configuration**</a>

```ts
AutoRun =
Expand Down
Binary file added images/main-features-5.0.1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 70 additions & 42 deletions release-notes/release-note-v5.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,66 @@
# vscode-jest v5 Releases <!-- omit in toc -->

---
- [v5.0.0 (pre-release)](#v500-pre-release)
- [Features](#features)
- [Output Terminals](#output-terminals)
- [Login Shell Support](#login-shell-support)
- [Long Run Monitor](#long-run-monitor)
- [One-click disable non-jest folder for monorepo project](#one-click-disable-non-jest-folder-for-monorepo-project)
- [v5.0 (pre-release) (roll-up)](#v50-pre-release-roll-up)
- [Main Features](#main-features)
- [1. toggle autoRun and coverage through TestExplorer inline menu](#1-toggle-autorun-and-coverage-through-testexplorer-inline-menu)
- [2. automate monorepo project setup through "Setup Tool"](#2-automate-monorepo-project-setup-through-setup-tool)
- [3. improve test run output with terminal](#3-improve-test-run-output-with-terminal)
- [4. deep activation](#4-deep-activation)
- [5. login shell support](#5-login-shell-support)
- [6. long run monitor](#6-long-run-monitor)
- [7. one-click disable non-jest folder for monorepo project](#7-one-click-disable-non-jest-folder-for-monorepo-project)
- [8. autoRun change](#8-autorun-change)
- [Fixes](#fixes)
- [Deep Activation](#deep-activation)
- [AutoRun Default Change](#autorun-default-change)
- [Incorrect TestExplorer tests passed count](#incorrect-testexplorer-tests-passed-count)
- [Breaking Changes](#breaking-changes)
- [Change log](#change-log)

---
## v5.0.0 (pre-release)
## v5.0 (pre-release) (roll-up)

After more than an year with the vscode TestExplorer, it has been proven stable and a preferred user-experience. In v5.0.0 we started to consolidate and clean up redundant legacy functions/UI in favor of TestExplorer, such as moving run output to Terminal, retire legacy test status decorators and settings.
v5 mainly focuses on addressing performance and ease of use. The goal is to help new and experienced users fully utilize the extension features to make testing a fun experience.

This release also aim to address some common pain points, such as slow and resource-intensive start-up (especially for large projects), shell env issue (cmd not found), shallow activation and "greedy" monorepo runs.
We have also decided to make TestExplorer a preferred UI outlet instead of our custom UI developed before TestExplorer. For example, we no longer support the inline decorator for test status as TestExplorer provided a much more powerful gutter status/menu.
### Main Features

### Features
![main-features-5.0](images/../../images/main-features-5.0.1.jpg)

#### Output Terminals
#### 1. toggle autoRun and coverage through TestExplorer inline menu
This allows quick one-click change of autoRun and test-coverage for runtime only. This allow users to change test-run behavior frequently to adapt to different phrases in the development cycle. Hopefully, it also help new users that experiences performance issues to be able to self-help easily.

![v5-output-terminals](../images/v5-output-terminals.png)
More details can be found in
- [how to toggle autoRun](../README.md#how-to-toggle-auto-run)
- [how to toggle coverage](../README.md#how-to-toggle-coverage)

Also updated README targeting performance: [performance troubleshooting](https://github.com/jest-community/vscode-jest#performance-issue) guide and [autoRun trade-off](../README.md#autorun) consideration.

([v5.0.1](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.1): [#932](https://github.com/jest-community/vscode-jest/pull/932) - @connectdotz)

#### 2. automate monorepo project setup through "Setup Tool"

This expanded setup-tool (renamed from setup wizard) to help convert monorepo projects from single-root to multi-root workspaces and assisting detecting `jest.rootPath`.

See [setup monorepo project guide](https://github.com/jest-community/vscode-jest/blob/master/setup-wizard.md#setup-monorepo-project) for more info.

([v5.0.1](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.1): [#921](https://github.com/jest-community/vscode-jest/pull/921) - @connectdotz)

#### 3. improve test run output with terminal

Jest run will be shown in Terminal instead of OUTPUT tab to provide familiar run-in-terminal-like experience. We also fixed a few bugs that prevented the full output to be shown. It should be much easier to investigate when tests fail or not executed.

We will no longer force "reveal" the last run output terminal. The new terminals will only be automatically "revealed" when encountered errors prevented tests to run. Therefore, we are retiring setting `"jest.showTerminalOnLaunch"`

([#910](https://github.com/jest-community/vscode-jest/pull/910) - @connectdotz)
([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#910](https://github.com/jest-community/vscode-jest/pull/910) - @connectdotz)

#### 4. deep activation

#### Login Shell Support
The extension auto activates (showing "Jest" in status bar and TestExplorer) when it detects jest config files or modules under the project root. For more sophisticated projects that jest root !== project root, they will not be activated automatically even if they set the `jest.rootPath`. In v5, we will look for jest config files in the whole project tree, except in "node_modules" for performance reason.

For projects do not meet any of the existing activation events, there is now a new activation event for `".vscode-jest"` file, an empty marker file, anywhere in the project tree (however, prefer to be in jest root folder).

([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#907](https://github.com/jest-community/vscode-jest/pull/907) - @connectdotz)

#### 5. login shell support

vscode process env doesn't always fully initialized, especially during restart. This usually manifest into command not found errors (exit code 127), such as `"env: node: No such file or directory"` or `"env: yarn: No such file or directory"` when running jest process.

Expand All @@ -43,50 +71,50 @@ While there are many work arounds, we want to add one more option for users pref

Note, the extra initialization might have some performance overhead, use this with caution.

(#874 - @connectdotz)
([#874](https://github.com/jest-community/vscode-jest/pull/874) - @connectdotz)
([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#874](https://github.com/jest-community/vscode-jest/pull/874) - @connectdotz)

#### Long Run Monitor
#### 6. long run monitor

In v5 we also added a long-run monitor to be proactive in helping users detect and potential workaround such situation. The threshold setting ["jest.monitorLongRun"](../README.md#monitorlongrun) default is 60 seconds: `"jest.monitorLongRun": 60000`,

([#904](https://github.com/jest-community/vscode-jest/pull/904) - @connectdotz)

#### One-click disable non-jest folder for monorepo project
([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#904](https://github.com/jest-community/vscode-jest/pull/904) - @connectdotz)

The current monorepo jest detection is "greedy", it assumes all multi-root folders have jest tests. Indeed it's not ideal and we do plan to fix it. Until then, users can now one-click to "disable" the failed folders from the error message window.
#### 7. one-click disable non-jest folder for monorepo project

([#896](https://github.com/jest-community/vscode-jest/pull/896) - @jonnytest1)
Users can now easily one-click to "disable" the failed folder from the error message window.

### Fixes

#### Deep Activation

The extension auto activates (showing "Jest" in status bar and TestExplorer) when it detects jest config files or modules under the project root. For more sophisticated projects that jest root !== project root, they will not be activated automatically even if they set the `jest.rootPath`. In v5, we will look for jest config files in the whole project tree, except in "node_modules" for performance reason.

For projects do not meet any of the existing activation events, there is now a new activation event for `".vscode-jest"` file, an empty marker file, anywhere in the project tree (however, prefer to be in jest root folder).
([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#896](https://github.com/jest-community/vscode-jest/pull/896) - @jonnytest1)

([#907](https://github.com/jest-community/vscode-jest/pull/907) - @connectdotz)

#### AutoRun Default Change
#### 8. autoRun change

1. Introducing [autoRun short-hand](../README.md#autorun-config) to make setting up autoRun easier
2. Change autoRun default to drop running all tests on start-up (this is potentially a breaking change)

The `"jest.autoRun"` default used to be `{"watch": "true", "onStartup": ["all-tests"]}`. While this ensure no test would be "missing", it does take a toll for start up performance, especially for projects with many expensive tests. With TestExplorer provided complete test tree view, we believe it should be all right for most users to just starts with `{"watch": "true"}`, thus the change.

If you already have the `"jest.autoRun"` in your settings.json file, nothing will change. If you didn't have `"jest.autoRun"`, then you will probably notice a faster start-up, but maybe not all tests are run and marked as circle (unknown) instead. These are the files that have not checkout/changed therefore less risk of being broken (determined by watchman). Of course users can always run them explicitly or change the setting if desired.

([#906](https://github.com/jest-community/vscode-jest/pull/906) - @connectdotz)
:speech_balloon: Discussion: Giving the nature of autoRun trade-off (performance vs. completeness/automation), we would love to hear from our users:
- [what is your autoRun setting?](https://github.com/jest-community/vscode-jest/discussions/933)
- [autoRun default... what should it be?](https://github.com/jest-community/vscode-jest/discussions/934)


#### Incorrect TestExplorer tests passed count
Fixed the test suites got counted toward these counts.
([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#906](https://github.com/jest-community/vscode-jest/pull/906) - @connectdotz)

([#916](https://github.com/jest-community/vscode-jest/pull/916) - @connectdotz)
### Fixes
- address issues that vscode runs occasionally appears to be hanging when the runs already completed. ([#926](https://github.com/jest-community/vscode-jest/pull/926), [#927](https://github.com/jest-community/vscode-jest/pull/927), [#932](https://github.com/jest-community/vscode-jest/pull/932))
- missing runtime error detection and reporting when the run fails to start. ([#927](https://github.com/jest-community/vscode-jest/pull/927))
- Fix quoting test names with special characters ([#928](https://github.com/jest-community/vscode-jest/pull/928))
- fixed incorrect TestExplorer tests passed count ([#916](https://github.com/jest-community/vscode-jest/pull/916) - @connectdotz)
- various document updates

### Breaking Changes
- `"jest.showTerminalOnLaunch"` is deprecated.
- ["jest.textExplorer"](../README.md#testexplorer):
- can not be turned off any more.
- removed the "enable" and "showClassicStatus" attributes. The only valid attribute is "showInlineError".
- `"jest.autoRun` default value has changed. see detail above.
### Change log
- [v5.0.1 pre-release](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.1)
- [v5.0.0 pre-release](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0)

---

Detailed changes: [v5.0.0 pre-release](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0)
3 changes: 2 additions & 1 deletion src/extensionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,5 +463,6 @@ export class ExtensionManager {

const ReleaseNoteBase = 'https://github.com/jest-community/vscode-jest/blob/master/release-notes';
const ReleaseNotes: Record<string, string> = {
'5.0.0': `${ReleaseNoteBase}/release-note-v5.md#v500-pre-release`,
'5.0.1': `${ReleaseNoteBase}/release-note-v5.md#v50-pre-release-roll-up`,
'5.0.0': `${ReleaseNoteBase}/release-note-v5.md#v50-pre-release-roll-up`,
};
2 changes: 1 addition & 1 deletion tests/extensionManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ describe('ExtensionManager', () => {
${1} | ${'4.6'} | ${false} | ${undefined} | ${false}
${2} | ${'5.0.0'} | ${true} | ${undefined} | ${false}
${3} | ${'5.0.0'} | ${true} | ${'See What Is Changed'} | ${true}
${4} | ${'5.0.1'} | ${false} | ${undefined} | ${false}
${4} | ${'5.0.1'} | ${true} | ${undefined} | ${false}
${5} | ${'6.0.0'} | ${false} | ${undefined} | ${false}
`(
'show release note once for specific version: case $case',
Expand Down

0 comments on commit 57463e7

Please sign in to comment.