|
9 | 9 | import * as fs from 'fs'; |
10 | 10 | import * as path from 'path'; |
11 | 11 | import * as tmp from 'tmp'; |
12 | | -import {addWritePermissionFlag, writeExecutableFile} from './file_system_utils'; |
13 | | -import { |
14 | | - PackageMappings, |
15 | | - readPackageJsonContents, |
16 | | - updateMappingsForPackageJson, |
17 | | -} from './package_json'; |
| 12 | + |
18 | 13 | import { |
19 | 14 | BazelExpandedValue, |
20 | 15 | BazelFileInfo, |
21 | 16 | resolveBazelFile, |
22 | 17 | resolveBinaryWithRunfilesGracefully, |
23 | 18 | } from './bazel'; |
24 | | -import {debug} from './debug'; |
| 19 | +import { |
| 20 | + PackageMappings, |
| 21 | + readPackageJsonContents, |
| 22 | + updateMappingsForPackageJson, |
| 23 | +} from './package_json'; |
| 24 | +import {addWritePermissionFlag, writeExecutableFile} from './file_system_utils'; |
25 | 25 | import { |
26 | 26 | expandEnvironmentVariableSubstitutions, |
27 | 27 | getBinaryPassThroughScript, |
28 | 28 | prependToPathVariable, |
29 | 29 | runCommandInChildProcess, |
30 | 30 | } from './process_utils'; |
| 31 | + |
31 | 32 | import {ENVIRONMENT_TMP_PLACEHOLDER} from './constants'; |
| 33 | +import {debug} from './debug'; |
| 34 | + |
| 35 | +/** Error class that is used when an integration command fails. */ |
| 36 | +class IntegrationTestCommandError extends Error {} |
32 | 37 |
|
33 | 38 | /** |
34 | 39 | * Test runner that takes a set of files within a Bazel package and copies the files |
@@ -230,10 +235,11 @@ export class TestRunner { |
230 | 235 | ); |
231 | 236 |
|
232 | 237 | if (!success) { |
233 | | - throw Error( |
234 | | - `Integration test command: \`${resolvedBinary} ${evaluatedArgs.join(' ')}\` failed. ` + |
235 | | - `See error output above for details.`, |
236 | | - ); |
| 238 | + console.error(`Command failed: \`${resolvedBinary} ${evaluatedArgs.join(' ')}\``); |
| 239 | + console.error(`Command ran in test directory: ${path.normalize(testDir)}`); |
| 240 | + console.error(`See error output above.`); |
| 241 | + |
| 242 | + throw new IntegrationTestCommandError(); |
237 | 243 | } |
238 | 244 | } |
239 | 245 | } |
|
0 commit comments