From 2e67d03c02f63ba657af6dcc77f3359dd7a71e32 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Fri, 1 May 2026 11:52:22 -0700 Subject: [PATCH 1/2] ci: quiet CI failure logs Signed-off-by: Carlos Villela --- .github/workflows/e2e-branch-validation.yaml | 2 +- .pre-commit-config.yaml | 4 ++-- test/cli.test.ts | 2 ++ vitest.config.ts | 10 +++++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-branch-validation.yaml b/.github/workflows/e2e-branch-validation.yaml index d88e2d1907a..bf5b6b74ca5 100644 --- a/.github/workflows/e2e-branch-validation.yaml +++ b/.github/workflows/e2e-branch-validation.yaml @@ -201,7 +201,7 @@ jobs: LAUNCHABLE_SETUP_SCRIPT: ${{ inputs.setup_script_url || '' }} BREV_PROVIDER: gcp KEEP_ALIVE: ${{ inputs.keep_alive }} - run: npx vitest run --project e2e-branch-validation --reporter=verbose + run: npx vitest run --project e2e-branch-validation - name: Update check run (completed) if: always() && inputs.pr_number != '' && env.CHECK_RUN_ID != '' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b76bbc4cf1b..85cc4036854 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -276,7 +276,7 @@ repos: hooks: - id: test-cli name: Test (CLI) - entry: bash -c 'npm run build:cli && npx vitest run --project cli --coverage --coverage.reporter=text --coverage.reporter=json-summary --coverage.reportsDirectory=coverage/cli --coverage.include="bin/**/*.js" --coverage.include="dist/lib/**/*.js" --coverage.exclude="test/**/*.js" --coverage.exclude="test/**/*.ts" && npx tsx scripts/check-coverage-ratchet.ts coverage/cli/coverage-summary.json ci/coverage-threshold-cli.json "CLI coverage"' + entry: bash -c 'npm run build:cli && npx vitest run --project cli --coverage --coverage.reporter=text-summary --coverage.reporter=json-summary --coverage.reportsDirectory=coverage/cli --coverage.include="bin/**/*.js" --coverage.include="dist/lib/**/*.js" --coverage.exclude="test/**/*.js" --coverage.exclude="test/**/*.ts" && npx tsx scripts/check-coverage-ratchet.ts coverage/cli/coverage-summary.json ci/coverage-threshold-cli.json "CLI coverage"' language: system pass_filenames: false files: ^(bin/|src/|test/) @@ -284,7 +284,7 @@ repos: - id: test-plugin name: Test (plugin) - entry: bash -c 'npx vitest run --project plugin --coverage --coverage.reporter=text --coverage.reporter=json-summary --coverage.reportsDirectory=coverage/plugin --coverage.include="nemoclaw/src/**/*.ts" --coverage.exclude="**/*.test.ts" && npx tsx scripts/check-coverage-ratchet.ts coverage/plugin/coverage-summary.json ci/coverage-threshold-plugin.json "Plugin coverage"' + entry: bash -c 'npx vitest run --project plugin --coverage --coverage.reporter=text-summary --coverage.reporter=json-summary --coverage.reportsDirectory=coverage/plugin --coverage.include="nemoclaw/src/**/*.ts" --coverage.exclude="**/*.test.ts" && npx tsx scripts/check-coverage-ratchet.ts coverage/plugin/coverage-summary.json ci/coverage-threshold-plugin.json "Plugin coverage"' language: system pass_filenames: false files: ^nemoclaw/ diff --git a/test/cli.test.ts b/test/cli.test.ts index 70724867890..584b25cc3c7 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -67,6 +67,7 @@ function runWithEnv( try { const out = execSync(`node "${CLI}" ${args}`, { encoding: "utf-8", + stdio: "pipe", timeout, env: { ...process.env, @@ -322,6 +323,7 @@ describe("CLI dispatch", () => { it("nemohermes list --help uses alias branding", () => { const out = execSync(`node "${HERMES_CLI}" list --help`, { encoding: "utf-8", + stdio: "pipe", timeout: execTimeout(), env: { ...process.env, diff --git a/vitest.config.ts b/vitest.config.ts index 6756f8013dd..9bb88fb6239 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -5,8 +5,16 @@ import { defineConfig } from "vitest/config"; import { testTimeout } from "./test/helpers/timeouts"; +const isGithubActions = process.env.GITHUB_ACTIONS === "true"; +const isCi = isGithubActions || process.env.CI === "true" || process.env.CI === "1"; + export default defineConfig({ test: { + // CI logs are easiest to scan when test chatter stays quiet and failures + // surface as GitHub annotations at the relevant file and line. + reporters: isGithubActions ? ["github-actions"] : ["default"], + silent: isCi, + hideSkippedTests: isCi, projects: [ { test: { @@ -58,7 +66,7 @@ export default defineConfig({ provider: "v8", include: ["nemoclaw/src/**/*.ts"], exclude: ["**/*.test.ts"], - reporter: ["text", "json-summary"], + reporter: ["text-summary", "json-summary"], }, }, }); From 4a4d915f66f9762458c53ae263eba8864089c3f2 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Fri, 1 May 2026 12:05:34 -0700 Subject: [PATCH 2/2] ci: retry flaky WSL installs Signed-off-by: Carlos Villela --- .github/workflows/wsl-e2e.yaml | 45 ++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wsl-e2e.yaml b/.github/workflows/wsl-e2e.yaml index f1eabfe5d86..a503e541526 100644 --- a/.github/workflows/wsl-e2e.yaml +++ b/.github/workflows/wsl-e2e.yaml @@ -60,15 +60,44 @@ jobs: # Native commands do not throw in PowerShell; check LASTEXITCODE. $null = wsl -d $env:WSL_DISTRO -- echo ok 2>&1 if ($LASTEXITCODE -ne 0) { - Write-Host 'Ubuntu not found - installing via wsl --install' - wsl --install -d $env:WSL_DISTRO --no-launch --web-download - if ($LASTEXITCODE -ne 0) { - throw ('wsl --install failed with exit code ' + $LASTEXITCODE) + $maxAttempts = 3 + $installed = $false + for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) { + Write-Host "Ubuntu not found - installing via wsl --install (attempt $attempt/$maxAttempts)" + wsl --install -d $env:WSL_DISTRO --no-launch --web-download + $installExitCode = $LASTEXITCODE + if ($installExitCode -eq 0) { + # The first launch initialises the distro with the default root user. + wsl -d $env:WSL_DISTRO -- bash -c 'echo distro initialised' + $launchExitCode = $LASTEXITCODE + if ($launchExitCode -eq 0) { + $installed = $true + break + } + Write-Warning "distro first-launch failed with exit code $launchExitCode" + } else { + Write-Warning "wsl --install failed with exit code $installExitCode" + } + + # Some WSL installs return a non-zero code after registering a usable distro. + $null = wsl -d $env:WSL_DISTRO -- echo ok 2>&1 + if ($LASTEXITCODE -eq 0) { + Write-Host 'Ubuntu became available after the install command returned non-zero' + $installed = $true + break + } + + if ($attempt -lt $maxAttempts) { + Write-Host 'Cleaning up any partial WSL registration before retrying' + $null = wsl --unregister $env:WSL_DISTRO 2>&1 + $delaySeconds = [Math]::Min(60, 20 * $attempt) + Write-Host "Retrying WSL install in $delaySeconds seconds..." + Start-Sleep -Seconds $delaySeconds + } } - # The first launch initialises the distro with the default root user. - wsl -d $env:WSL_DISTRO -- bash -c 'echo distro initialised' - if ($LASTEXITCODE -ne 0) { - throw ('distro first-launch failed with exit code ' + $LASTEXITCODE) + + if (-not $installed) { + throw ("failed to install and initialize $env:WSL_DISTRO after $maxAttempts attempts") } } else { Write-Host 'Ubuntu already available'