-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v5,6: add useAdditionalVariablesOnly parameter (#63)
- Loading branch information
Showing
18 changed files
with
183 additions
and
11 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
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
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
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
4 changes: 4 additions & 0 deletions
4
tasks/ReplaceTokensV5/tests/_data/variables.useadditionalvariablesonly.expected.json
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,4 @@ | ||
{ | ||
"var1": "var1_value", | ||
"var2": "" | ||
} |
41 changes: 41 additions & 0 deletions
41
tasks/ReplaceTokensV5/tests/externalVariables/L0_UseAdditionalVariablesOnly.ts
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,41 @@ | ||
import ma = require('azure-pipelines-task-lib/mock-answer'); | ||
import tmrm = require('azure-pipelines-task-lib/mock-run'); | ||
import path = require('path'); | ||
|
||
const taskPath = path.join(__dirname, '..', '..', 'index.js'); | ||
const tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); | ||
|
||
// variables | ||
process.env['VAR1'] = 'variables'; | ||
process.env['VAR2'] = 'variables'; | ||
|
||
// inputs | ||
tmr.setInput('enableTelemetry', 'false'); | ||
tmr.setInput('targetFiles', 'input.json'); | ||
tmr.setInput('writeBOM', 'true'); | ||
tmr.setInput('variableFiles', 'variables.ext'); | ||
tmr.setInput('useAdditionalVariablesOnly', 'true'); | ||
|
||
// sdk answers | ||
let answers = { | ||
checkPath: {}, | ||
findMatch: { | ||
'input.json': [process.env['__inputpath__']], | ||
'variables.ext': [process.env['__variablespath__']] | ||
}, | ||
stats: {}, | ||
exist: {} | ||
}; | ||
answers['stats'][process.env['__inputpath__']] = { | ||
isDirectory: false | ||
}; | ||
answers['stats'][process.env['__variablespath__']] = { | ||
isDirectory: false | ||
}; | ||
answers['exist'][process.env['__inputpath__']] = true; | ||
answers['exist'][process.env['__variablespath__']] = true; | ||
|
||
tmr.setAnswers(answers); | ||
|
||
// act | ||
tmr.run(); |
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
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
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
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
10 changes: 10 additions & 0 deletions
10
tasks/ReplaceTokensV6/tests/_data/file.only_additional_variables.expected.txt
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,10 @@ | ||
var.var: DEFAULT | ||
var.secret: DEFAULT | ||
var1: env | ||
var2: inline | ||
var_json: file | ||
var_yaml1: file | ||
var_yaml2: file | ||
var.yml1: file | ||
var.yml2: inline | ||
unknown: DEFAULT |
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