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: Task customization #29442

Closed
4 tasks done
dbaeumer opened this issue Jun 26, 2017 · 6 comments
Closed
4 tasks done

Test: Task customization #29442

dbaeumer opened this issue Jun 26, 2017 · 6 comments

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Jun 26, 2017

Complexity: 3
Tests: #28235

Setup:

  • fresh workspace
  • have gulp installed
  • gulpfile.js
var gulp = require('gulp');

gulp.task('build', function() {
    console.log('Build'); 
    console.log("src/protocol.ts(413,17): error TS2304: Cannot find name 'TextDocumentClientCapabilities'.");
    console.log("src/protocol.ts(413,17): error TS4033: Property 'textDocument' of exported interface has or is using private name 'TextDocumentClientCapabilities'.");
});

gulp.task('watch', function() {
    console.log('Watch');
    console.log("src/protocol.ts(413,17): error TS2304: Cannot find name 'TextDocumentClientCapabilities'.");
    console.log("src/protocol.ts(413,17): error TS4033: Property 'textDocument' of exported interface has or is using private name 'TextDocumentClientCapabilities'.");
});

Test:

  • Task > Run Task: this should list two tasks one for gulp watch one for gulp build
  • Task > Run Build Task: this should also list the two task since they are detected as build tasks
  • Run the build tasks: this should show a quick pick to select a problem matcher. Select continue without a scanning the output: Ensure that the tasks executes and no problems are detected.
  • Task > Run Build Task: shows the list again with the task run last listed under recently used tasks. This time select a problem matcher: Enusre that problems are detected (2) and that the tasks.json file opens with a configuration like this:
{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			"type": "gulp",
			"task": "build",
			"problemMatcher": [
				"$tsc"
			]
		}
	]
}
  • delete the tasks section in the tasks.json file. Run the steps again. Ensure that the tasks section get updated again and that the comment in the file is preserved.
  • Task > Run Task. Press the gear icon to the right of the gulp: watch task. Ensure that a corresponding configuration section is inserted into the tasks.json and that the problem matcher is set to an empty array.
  • add a label property to one of the tasks. Ensure that it is reflected in the task's quick pick
  • tweak also the presentation options of a task. Ensure that reveal, echo and focus work as expected
  • tweak also the panel property of the presentation property. This should change the behavior as follows:
    • new: every execution of the task creates a new panel.
    • dedicated: there is one panel for the task. Every execution uses the same panel and the panel is not reused with other tasks.
    • shared: the panel is shared with other tasks that are marked as shared.
  • tweak the primary build task: open the tasks.json. Add the following to the gulp build task: "group": { "kind": "build", "isPrimary": true }. Execute Task > Run Build Task... This should execute the gulp build task without showing the quick pick.
@isidorn
Copy link
Contributor

isidorn commented Jun 27, 2017

This should be a complexity of at least 4.

@isidorn
Copy link
Contributor

isidorn commented Jun 27, 2017

I have tested out this scenario. But I think we should have additional test plan items for:

  • Tasks menu
  • Tasks discovery and configuring tasks for some custom workspace

@michelkaporin
Copy link
Contributor

Agree with @isidorn on additional plan items for menu, as well as for custom workspace configuration. It would be great to see how current task workflow can be reused in some popular sample projects (e.g. MERN, etc.)

@dbaeumer can you explain what is an impact of task execution group property (kind)? If I change kind from build to some other, then I don't see it in Run Build Tasks command, which makes sense. What about "test", "clean" and "rebuildAll"?

@dbaeumer
Copy link
Member Author

Agree. That is a good idea: I created #29618 and assigned it to @joaomoreno (thanks for volunteering) and @michelkaporin

@dbaeumer
Copy link
Member Author

Regarding the group: I should remove clean and rebuildAll for now. If you assign the test group then the task is listed with Run Test Tasks... The reason why this was not on the plan is that it is simply the same as isTestCommand which got deprecated to have more flexibility in the future.

@michelkaporin
Copy link
Contributor

thanks for explanation @dbaeumer

@Lixire Lixire removed their assignment Jun 27, 2017
@Lixire Lixire closed this as completed Jun 27, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants