Skip to content

Commit 2fa0f6e

Browse files
committed
test: use Azure format for printing
1 parent 266910d commit 2fa0f6e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

script/test

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if (process.platform === 'darwin') {
6060
assert(executablePaths.length === 1, `More than one application to run tests against was found. ${executablePaths.join(',')}`)
6161
executablePath = executablePaths[0]
6262
} else {
63-
throw new Error('Running tests on this platform is not supported.')
63+
throw new Error('##[error] Running tests on this platform is not supported.')
6464
}
6565

6666
function prepareEnv (suiteName) {
@@ -91,7 +91,7 @@ function runCoreMainProcessTests (callback) {
9191

9292
const testEnv = Object.assign({}, prepareEnv('core-main-process'), {ATOM_GITHUB_INLINE_GIT_EXEC: 'true'})
9393

94-
console.log('Executing core main process tests'.bold.green)
94+
console.log('##[command] Executing core main process tests'.bold.green)
9595
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit', env: testEnv})
9696
cp.on('error', error => { callback(error) })
9797
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-main-process'}) })
@@ -105,7 +105,7 @@ for (let testFile of testFiles) {
105105
coreRenderProcessTestSuites.push( function (callback) {
106106

107107
const testEnv = prepareEnv('core-render-process')
108-
console.log(`Executing core render process tests for ${testFile}`.bold.green)
108+
console.log(`##[command] Executing core render process tests for ${testFile}`.bold.green)
109109
const testArguments = [
110110
'--resource-path', resourcePath,
111111
'--test', testFile
@@ -145,17 +145,17 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
145145
const nodeModulesPath = path.join(repositoryPackagePath, 'node_modules')
146146
let finalize = () => null
147147
if (require(pkgJsonPath).atomTestRunner) {
148-
console.log(`Installing test runner dependencies for ${packageName}`.bold.green)
148+
console.log(`##[command] Installing test runner dependencies for ${packageName}`.bold.green)
149149
if (fs.existsSync(nodeModulesPath)) {
150150
const backup = backupNodeModules(repositoryPackagePath)
151151
finalize = backup.restore
152152
} else {
153153
finalize = () => fs.removeSync(nodeModulesPath)
154154
}
155155
runApmInstall(repositoryPackagePath)
156-
console.log(`Executing ${packageName} tests`.green)
156+
console.log(`##[command] Executing ${packageName} tests`.green)
157157
} else {
158-
console.log(`Executing ${packageName} tests`.bold.green)
158+
console.log(`##[command] Executing ${packageName} tests`.bold.green)
159159
}
160160
const cp = childProcess.spawn(executablePath, testArguments, {env: testEnv})
161161

@@ -169,7 +169,7 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
169169
})
170170
cp.on('close', exitCode => {
171171
if (exitCode !== 0) {
172-
console.log(`Package tests failed for ${packageName}:`.red)
172+
console.log(`##[error] Package tests failed for ${packageName}:`.red)
173173
console.log(stderrOutput)
174174
}
175175
finalize()
@@ -183,7 +183,7 @@ function runBenchmarkTests (callback) {
183183
const testArguments = ['--benchmark-test', benchmarksPath]
184184
const testEnv = prepareEnv('benchmark')
185185

186-
console.log('Executing benchmark tests'.bold.green)
186+
console.log('##[command] Executing benchmark tests'.bold.green)
187187
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit', env: testEnv})
188188
cp.on('error', error => { callback(error) })
189189
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-benchmarks'}) })
@@ -277,9 +277,9 @@ async.parallel(testSuitesToRun, function (err, results) {
277277
const failedSteps = results.filter(({exitCode}) => exitCode !== 0)
278278

279279
if (failedSteps.length > 0) {
280-
console.warn("\n \n *** Reporting the errors that happened in all of the tests: *** \n \n")
280+
console.warn("##[error] \n \n *** Reporting the errors that happened in all of the tests: *** \n \n")
281281
for (const {step} of failedSteps) {
282-
console.error(`Error! The '${step}' test step finished with a non-zero exit code`)
282+
console.error(`##[error] The '${step}' test step finished with a non-zero exit code`)
283283
}
284284
process.exit(1)
285285
}

0 commit comments

Comments
 (0)