Skip to content

Commit 5d32de0

Browse files
committed
refactor(test): simplify binary test output to clean checklist format
Replace verbose separator lines and multi-line logging with a simple checklist format for better readability in CI logs. Before: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Testing: JS Distribution (dist/index.js) Path: /path/to/binary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Binary exists: true ✓ Binary found and ready for testing After: ✓ JS Distribution (dist/index.js) Changes: - Single line per binary with status symbol (✓/⊘/✗) - Condensed error/info messages with 2-space indent - Removed separator lines and verbose logging - Cleaner CI output for quick status scanning
1 parent 3899178 commit 5d32de0

File tree

1 file changed

+11
-34
lines changed

1 file changed

+11
-34
lines changed

packages/cli/test/integration/binary/helpers.mts

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,74 +72,51 @@ export async function prepareBinary(
7272
binary: BinaryConfig,
7373
binaryType: string,
7474
): Promise<boolean> {
75-
// Log which binary we're testing.
76-
logger.log('')
77-
logger.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`)
78-
logger.log(`Testing: ${binary.name}`)
79-
logger.log(`Path: ${binary.path}`)
80-
logger.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`)
81-
8275
// Check if binary exists.
8376
let binaryExists = existsSync(binary.path)
84-
logger.log(`Binary exists: ${binaryExists}`)
8577

8678
if (!binaryExists) {
87-
logger.log('')
88-
logger.warn(`Binary not found: ${binary.path}`)
89-
9079
// In CI: Skip building (rely on cache).
9180
if (process.env.CI) {
92-
logger.log('Running in CI - skipping build (binary not in cache)')
81+
logger.log(`⊘ ${binary.name} (not cached)`)
9382
if (binaryType === 'sea') {
94-
logger.log('To build SEA binaries, run: gh workflow run build-sea.yml')
83+
logger.log(' To build: gh workflow run build-sea.yml')
9584
} else if (binaryType === 'smol') {
96-
logger.log(
97-
'To build smol binaries, run: gh workflow run build-smol.yml',
98-
)
85+
logger.log(' To build: gh workflow run build-smol.yml')
9986
}
100-
logger.log('')
10187
return false
10288
}
10389

10490
// Locally: Prompt user to build.
91+
logger.log(`⊘ ${binary.name} (not found)`)
10592
const timeWarning = binaryType === 'smol' ? ' (may take 30-60 min)' : ''
10693
const shouldBuild = await confirm({
10794
default: true,
10895
message: `Build ${binary.name}?${timeWarning}`,
10996
})
11097

11198
if (!shouldBuild) {
112-
logger.log('Skipping build. Tests will be skipped.')
113-
logger.log(
114-
`To build manually, run: ${binary.buildCommand?.join(' ') ?? 'N/A'}`,
115-
)
116-
logger.log('')
99+
logger.log(' Skipping tests')
117100
return false
118101
}
119102

120-
logger.log('Building binary...')
103+
logger.log(' Building...')
121104
const buildSuccess = await buildBinary(binary, binaryType)
122105

123106
if (buildSuccess) {
124107
binaryExists = existsSync(binary.path)
125108
}
126109

127110
if (!binaryExists) {
128-
logger.log('')
129-
logger.error(`Failed to build ${binary.name}. Tests will be skipped.`)
130-
logger.log('To build this binary manually, run:')
131-
logger.log(` ${binary.buildCommand?.join(' ') ?? 'N/A'}`)
132-
logger.log('')
111+
logger.log(` ✗ Build failed`)
112+
logger.log(` To build manually: ${binary.buildCommand?.join(' ') ?? 'N/A'}`)
133113
return false
134114
}
135115

136-
logger.log(`Binary built successfully: ${binary.path}`)
137-
logger.log('')
116+
logger.log(` ✓ Build complete`)
138117
} else {
139-
// Binary already exists.
140-
logger.log('')
141-
logger.log(`✓ Binary found and ready for testing`)
142-
logger.log('')
118+
// Binary exists.
119+
logger.log(`✓ ${binary.name}`)
143120
}
144121

145122
return true

0 commit comments

Comments
 (0)