-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed the token to the correlation ID. (#1027)
- Loading branch information
1 parent
4c60d46
commit b281dc9
Showing
10 changed files
with
70 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
powershell/Tests/L0/Write-LoggingCommand.WritesTaskIssueWithCorrelationId.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[CmdletBinding()] | ||
param() | ||
|
||
$env:COMMAND_CORRELATION_ID = "test_id123" | ||
|
||
# Arrange. | ||
. $PSScriptRoot\..\lib\Initialize-Test.ps1 | ||
Invoke-VstsTaskScript -ScriptBlock { | ||
$vstsModule = Get-Module -Name VstsTaskSdk | ||
|
||
# 1 | ||
Assert-AreEqual $null $env:COMMAND_CORRELATION_ID "SDK removes the correlation ID after loading." | ||
|
||
# 2 | ||
$actual = & $vstsModule Get-TaskVariable -Name "COMMAND_CORRELATION_ID" | ||
Assert-AreEqual $null $actual "The correlation ID is inaccessible using task variables." | ||
|
||
# 3 | ||
$actual = & $vstsModule Write-TaskError -Message "test error" -AsOutput | ||
$expected = "##vso[task.logissue correlationId=test_id123;source=TaskInternal;type=error]test error" | ||
Assert-TaskIssueMessagesAreEqual $expected $actual "The default 'TastInternal' source and the correlation ID were added for errors." | ||
|
||
# 4 | ||
$actual = & $vstsModule Write-TaskWarning -Message "test warning" -AsOutput | ||
$expected = "##vso[task.logissue correlationId=test_id123;source=TaskInternal;type=warning]test warning" | ||
Assert-TaskIssueMessagesAreEqual $expected $actual "The default 'TastInternal' source and the correlation ID were added for warnings." | ||
|
||
# 5 | ||
$actual = & $vstsModule Write-TaskError -Message "test error" -IssueSource $IssueSources.CustomerScript -AsOutput | ||
$expected = "##vso[task.logissue correlationId=test_id123;source=CustomerScript;type=error]test error" | ||
Assert-TaskIssueMessagesAreEqual $expected $actual "Adds the specified issue source and the correlation ID for errors." | ||
|
||
# 6 | ||
$actual = & $vstsModule Write-TaskWarning -Message "test warning" -IssueSource $IssueSources.CustomerScript -AsOutput | ||
$expected = "##vso[task.logissue correlationId=test_id123;source=CustomerScript;type=warning]test warning" | ||
Assert-TaskIssueMessagesAreEqual $expected $actual "Adds the specified issue source and the correlation ID for warnings." | ||
} |
37 changes: 0 additions & 37 deletions
37
powershell/Tests/L0/Write-LoggingCommand.WritesTaskIssueWithToken.ps1
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "0.20.0", | ||
"version": "0.20.1", | ||
"private": true, | ||
"scripts": { | ||
"build": "node make.js build", | ||
|