-
Notifications
You must be signed in to change notification settings - Fork 35
print all spawnCoanaDlx output on errors in CI #1065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v1.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issues.
|
Bugbot Autofix prepared a fix for 2 of the 2 bugs found in the latest run.
Or push these changes by commenting: Preview (3559ff7be7)diff --git a/src/utils/dlx.mts b/src/utils/dlx.mts
--- a/src/utils/dlx.mts
+++ b/src/utils/dlx.mts
@@ -25,12 +25,10 @@
import { getDefaultOrgSlug } from '../commands/ci/fetch-default-org-slug.mts'
import constants, {
- CI,
FLAG_QUIET,
FLAG_SILENT,
NPM,
PNPM,
- VITEST,
YARN,
} from '../constants.mts'
import { getErrorCause } from './errors.mts'
@@ -44,6 +42,24 @@
const require = createRequire(import.meta.url)
+/**
+ * Logs spawn output when running in e2e-tests workflow for debugging.
+ */
+function logSpawnOutput(
+ stdout: string | undefined,
+ stderr: string | undefined,
+): void {
+ // Only log when running e2e-tests in CI.
+ if (constants.ENV.CI && constants.ENV.VITEST) {
+ if (stdout) {
+ console.log(stdout)
+ }
+ if (stderr) {
+ console.error(stderr)
+ }
+ }
+}
+
const { PACKAGE_LOCK_JSON, PNPM_LOCK_YAML, YARN_LOCK } = constants
export type DlxOptions = ShadowBinOptions & {
@@ -277,28 +293,12 @@
spawnExtra,
)
const output = await result.spawnPromise
- // Print output when running in e2e-tests workflow for debugging.
- if (CI && VITEST) {
- if (output.stdout) {
- console.log(output.stdout)
- }
- if (output.stderr) {
- console.error(output.stderr)
- }
- }
+ logSpawnOutput(output.stdout, output.stderr)
return { ok: true, data: output.stdout }
} catch (e) {
const stdout = (e as any)?.stdout
const stderr = (e as any)?.stderr
- // Print output when running in e2e-tests workflow for debugging.
- if (CI && VITEST) {
- if (stdout) {
- console.log(stdout)
- }
- if (stderr) {
- console.error(stderr)
- }
- }
+ logSpawnOutput(stdout, stderr)
const cause = getErrorCause(e)
const message = stderr || cause
return { |
|
@mtorp Investigation is still on-going in this PR or does it need a merge? |
The goal is to debug some of the flack reachability and fix-related E2E tests.
Note
Low Risk
Debug-only logging gated behind
CI && VITESTand!silent, with no changes to execution flow or data handling outside test/CI environments.Overview
spawnCoanaDlxnow conditionally prints capturedstdout/stderrafter a dlx run (both on success and in the error path) when running underCI+VITEST, while still respecting the caller’ssilentoption.This adds access to
stdoutfrom thrown errors so CI failures include more diagnostic output without changing normal local behavior.Written by Cursor Bugbot for commit 68e8500. This will update automatically on new commits. Configure here.