Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Output Panel #59238

Closed
3 tasks done
sandy081 opened this issue Sep 24, 2018 · 0 comments
Closed
3 tasks done

Test Output Panel #59238

sandy081 opened this issue Sep 24, 2018 · 0 comments
Labels
output Output channel system issues testplan-item

Comments

@sandy081
Copy link
Member

sandy081 commented Sep 24, 2018

Ref #57618

Complexity: 4

The underlying strategy of Output channel is changed to let extension host process use Spdlog and write the Output channel content instead of sending the data to the renderer. This introduces some delay from the time extension appends data to the time the data appears in the output channel UI. Extension author can bypass this delay by using the force-flag while creating the channel.

Purpose of this test plan item is to make sure existing Output channel functionalities are retained without regressions. Following set up will help you in testing it:

Set Up

Create a sample extension that can do following

  1. Create an Output Channel
  2. Append content to output channel
  3. Clear content in output channel
  4. Show/Hide the output channel

You can use and build on top of following sample

import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
	let channel, timer, counter = 1;
	const getChannel = (): vscode.OutputChannel => {
		if (!channel) {
			channel = vscode.window.createOutputChannel('Test Channel');
		}
		return channel;
	};
	vscode.commands.registerCommand('testExtension.clearChannel', () => getChannel().clear());
	vscode.commands.registerCommand('testExtension.showChannel', () => getChannel().show());
	vscode.commands.registerCommand('testExtension.hideChannel', () => getChannel().hide());
	vscode.commands.registerCommand('testExtension.startAppending', () => {
		if (!timer) {
			timer = setInterval(() => getChannel().appendLine(`${counter++} // Cancellation that controls whether or not we can cancel in the middle of type checking. In general cancelling is *not* safe for the type checker.  We might be in the middle of computing something, and we will leave our internals in an inconsistent state.  Callers who set the cancellation token should catch if a cancellation exception occurs, and should throw away and create a new TypeChecker.`), 1000);
		}
	});
	vscode.commands.registerCommand('testExtension.stopAppending', () => {
		if (timer) {
			clearInterval(timer);
			timer = null;
		}
	});
	
}

Test

  • Append content:
    -- Make sure that channel content is shown after appending. There will be a delay by default. If you created the channel by passing force flag to true then the content is shown immediately.

  • Clear content: Currently shown content is cleared in the channel.
    -- Verify this by using the available clear action in the Output panel and also by API.

  • Show Channel: Should show the selected channel (Verify from Dropdown and API)

  • Hide Channel: Should hide the Output panel (API).

  • No content loss:
    -- Make sure that channel content is not lost when you switch between channels or toggle the panel or while performing any other action.
    -- Make sure that channel content is not lost while the content is being appended but the channel is hidden.
    -- Random: Run commands from the above sample and also available Output actions in the UI randomly and test the results are as expected.

@sandy081 sandy081 added this to the September 2018 milestone Sep 24, 2018
@sandy081 sandy081 added the output Output channel system issues label Sep 24, 2018
@joaomoreno joaomoreno removed their assignment Sep 25, 2018
@alexr00 alexr00 removed their assignment Sep 25, 2018
@Tyriar Tyriar removed their assignment Sep 26, 2018
@Tyriar Tyriar closed this as completed Sep 26, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
output Output channel system issues testplan-item
Projects
None yet
Development

No branches or pull requests

4 participants