From ca6aaa26876be0db1444709be094371b27727345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Uhl=C3=AD=C5=99?= Date: Fri, 9 May 2025 12:13:36 +0200 Subject: [PATCH] test: debugging failed tests --- .github/workflows/release_please.yaml | 1 + test/commands/start.test.ts | 13 ++++++++++++- test/commands/stop.test.ts | 13 ++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_please.yaml b/.github/workflows/release_please.yaml index 4e37663..06ea6ea 100644 --- a/.github/workflows/release_please.yaml +++ b/.github/workflows/release_please.yaml @@ -9,6 +9,7 @@ permissions: contents: write pull-requests: write id-token: write + issues: write jobs: release-please: diff --git a/test/commands/start.test.ts b/test/commands/start.test.ts index ade09fc..3d18ffc 100644 --- a/test/commands/start.test.ts +++ b/test/commands/start.test.ts @@ -1,5 +1,5 @@ import { Codex } from '@codex-storage/sdk-js' -import { runCommand } from '@oclif/test' +import { runCommand as runCommandRaw } from '@oclif/test' import { use as chaiUse, expect } from 'chai' import chaiAsPromised from 'chai-as-promised' import Dockerode from 'dockerode' @@ -12,6 +12,17 @@ import { deleteNetwork, findContainer } from '../utils/docker' chaiUse(chaiAsPromised) let testFailed = false +async function runCommand(args: string): Promise> { + const result = await runCommandRaw(args) + + if (result.error) { + console.log(result.stdout) + console.error(result.stderr) + } + + return result +} + function wrapper (fn: () => Promise): () => Promise { return async () => { try { diff --git a/test/commands/stop.test.ts b/test/commands/stop.test.ts index 5566641..e35b8be 100644 --- a/test/commands/stop.test.ts +++ b/test/commands/stop.test.ts @@ -1,4 +1,4 @@ -import { runCommand } from '@oclif/test' +import { runCommand as runCommandRaw } from '@oclif/test' import { use as chaiUse, expect } from 'chai' import chaiAsPromised from 'chai-as-promised' import Dockerode from 'dockerode' @@ -9,6 +9,17 @@ import { deleteNetwork, findContainer } from '../utils/docker' chaiUse(chaiAsPromised) +async function runCommand(args: string): Promise> { + const result = await runCommandRaw(args) + + if (result.error) { + console.log(result.stdout) + console.error(result.stderr) + } + + return result +} + describe('stop command', () => { let docker: Dockerode const envPrefix = `codex-factory-test-${randomBytes(4).toString('hex')}`