diff --git a/test/common/markdown/gulpfile.js b/test/common/markdown/gulpfile.js index e50f9f142a..b8db8decf0 100644 --- a/test/common/markdown/gulpfile.js +++ b/test/common/markdown/gulpfile.js @@ -1,56 +1,60 @@ -"use strict"; -var gulp = require("gulp"); -var concat = require("gulp-concat"); -var through2 = require("through2"); -var markdownlint = require("markdownlint"); +function RunTest() { + "use strict"; + var gulp = require("gulp"); + var concat = require("gulp-concat"); + var through2 = require("through2"); + var markdownlint = require("markdownlint"); -gulp.task("test-mdsyntax", function task() { - var paths = []; - var rootpath; + gulp.task("test-mdsyntax", function task() { + var paths = []; + var rootpath; - // assign --repoRoot into rootpath - var j = process.argv.indexOf("--rootpath"); - if (j > -1) { - rootpath = process.argv[j + 1]; - } + // assign --repoRoot into rootpath + var j = process.argv.indexOf("--rootpath"); + if (j > -1) { + rootpath = process.argv[j + 1]; + } - if(rootpath == null) - { - throw "--rootpath must be specified before all other parameters" - } + if(rootpath == null) + { + throw "--rootpath must be specified before all other parameters" + } - // parse --filter into paths. --rootpath must be specified first. - var j = process.argv.indexOf("--filter"); - if (j > -1) { - var filters = process.argv[j + 1].split(","); - filters.forEach(function (filter) { - paths.push(rootpath + "/" + filter); - }, this); - } + // parse --filter into paths. --rootpath must be specified first. + var j = process.argv.indexOf("--filter"); + if (j > -1) { + var filters = process.argv[j + 1].split(","); + filters.forEach(function (filter) { + paths.push(rootpath + "/" + filter); + }, this); + } - if(paths.length == 0) - { - throw "--filter must be specified" - } + if(paths.length == 0) + { + throw "--filter must be specified" + } - var rootJsonFile = rootpath + "/.markdownlint.json" - var fs = require('fs'); - fs.appendFileSync('markdownissues.txt', '--EMPTY--\r\n'); - gulp.src(paths, { "read": false }) - .pipe(through2.obj(function obj(file, enc, next) { - markdownlint( - { - "files": [file.path], - "config": require(rootJsonFile) - }, - function callback(err, result) { - var resultString = (result || "").toString(); - if (resultString) { - file.contents = new Buffer(resultString); - } - next(err, file); - }); - })) - .pipe(concat("markdownissues.txt", { newLine: "\r\n" })) - .pipe(gulp.dest(".")); -}); + var rootJsonFile = rootpath + "/.markdownlint.json" + var fs = require('fs'); + fs.appendFileSync('markdownissues.txt', '--EMPTY--\r\n'); + gulp.src(paths, { "read": false }) + .pipe(through2.obj(function obj(file, enc, next) { + markdownlint( + { + "files": [file.path], + "config": require(rootJsonFile) + }, + function callback(err, result) { + var resultString = (result || "").toString(); + if (resultString) { + file.contents = new Buffer(resultString); + } + next(err, file); + }); + })) + .pipe(concat("markdownissues.txt", { newLine: "\r\n" })) + .pipe(gulp.dest(".")); + }); +} + +RunTest(); diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 index 5adec433dc..6fb69a3721 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 @@ -28,12 +28,14 @@ Describe "CmsMessage cmdlets and Get-PfxCertificate basic tests" -Tags "CI" { } It "Verify Get-PfxCertificate right password" { + #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Test secret.")] $pass = ConvertTo-SecureString "password" -AsPlainText -Force $cert = Get-PfxCertificate $protectedCertLocation -Password $pass $cert.Subject | Should Be "CN=localhost" } It "Verify Get-PfxCertificate wrong password" { + #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Test secret.")] $pass = ConvertTo-SecureString "wrongpass" -AsPlainText -Force $e = { Get-PfxCertificate $protectedCertLocation -Password $pass -ErrorAction Stop } | ShouldBeErrorId "GetPfxCertificateUnknownCryptoError,Microsoft.PowerShell.Commands.GetPfxCertificateCommand" }