test: debugging failed tests

This commit is contained in:
Adam Uhlíř 2025-05-09 12:13:36 +02:00
parent 221587b0e4
commit ca6aaa2687
No known key found for this signature in database
GPG Key ID: 1D17A9E81F76155B
3 changed files with 25 additions and 2 deletions

View File

@ -9,6 +9,7 @@ permissions:
contents: write
pull-requests: write
id-token: write
issues: write
jobs:
release-please:

View File

@ -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<ReturnType<typeof runCommandRaw>> {
const result = await runCommandRaw(args)
if (result.error) {
console.log(result.stdout)
console.error(result.stderr)
}
return result
}
function wrapper (fn: () => Promise<unknown>): () => Promise<unknown> {
return async () => {
try {

View File

@ -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<ReturnType<typeof runCommandRaw>> {
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')}`