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

Updated documentation #853

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions node/docs/minagent.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Use the details below to determine when specific agent features were added:
* `node` handler
- Added in 1.95.1. Used node v5.10.1.
- Updated in 2.117.0 to use node v6.10.3.
* `node10` handler
- Added in 2.144.0. Used node v10.x
* `node16` handler
- Added in 2.206.1. Used node v16.x
* `powershell3` handler
- Added in 1.95.1
- Updated in 1.97 to propagate `Data` property for endpoints
Expand Down
10 changes: 10 additions & 0 deletions node/docs/nodeEnvironment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ To leverage this capability, simply add `Node10` as an execution target:
},
```

With agent version 2.206.1 Node 16 can be used.

```
"execution": {
"Node16": {
"target": "path/to/entry"
}
},
```

Existing `Node` execution targets will still resolve to a Node 6 environment for now to maintain back-compat.

### Testing your task
Expand Down
6 changes: 3 additions & 3 deletions node/docs/nodeVersioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Agent Node Handler

The agent currently has 2 different node handlers that it can use to execute node tasks: Node 6 and Node 10.
The agent currently has 3 different node handlers that it can use to execute node tasks: Node 6, Node 10, Node 16.
The handler used depends on the `execution` property specified in the tasks `task.json`.
If the `execution` property is specified to be `Node`, the task will run on the Node 6 handler, if it is specified to be `Node10` it will run on the Node 10 handler.
If the `execution` property is specified to be `Node`, the task will run on the Node 6 handler, for `Node10` it will run on the Node 10 handler, for `Node16` it will run on the Node 16 handler.

## Mock-test Node Handler

[Unit testing](https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops#step-2-unit-testing-your-task-scripts) of tasks can be done using the task-lib's built in mock-task functionality.
To ensure tests are run in the same environment as the agent, this library looks for a `task.json` file in the same directory as the supplied task entry point.
If no `task.json` is found it searches all ancestor directories as well.
If the `task.json` is still not found, the library defaults to Node 10, otherwise it uses the appropriate handler based on the `execution` property.
If the `task.json` is still not found, the library defaults to Node 16, otherwise it uses the appropriate handler based on the `execution` property.
If this version of node is not found on the path, the library downloads the appropriate version.

### Behavior overrides
Expand Down