11import type { ContainerConfig } from '../docker-container.ts' ;
2- import { runDown , runUp } from '../docker-container.ts' ;
2+ import { runDown , runLogs , runUp } from '../docker-container.ts' ;
33
44function kryptonContainers ( ) : ContainerConfig [ ] {
55 const postgres : ContainerConfig = {
@@ -31,12 +31,7 @@ function kryptonContainers(): ContainerConfig[] {
3131 ] ,
3232 waitPort : 20443 ,
3333 env : [ 'STACKS_EVENT_OBSERVER=host.docker.internal:3700' , 'MINE_INTERVAL=0.1s' ] ,
34- volumes : [
35- 'stacks-blockchain/:/app/config' ,
36- 'stacks-blockchain/.chaindata:/tmp/stacks-blockchain-data' ,
37- ] ,
3834 extraHosts : [ 'host.docker.internal:host-gateway' ] ,
39- restartPolicy : 'on-failure' ,
4035 } ;
4136
4237 return [ postgres , stacksBlockchain ] ;
@@ -53,6 +48,12 @@ export async function globalSetup() {
5348export async function globalTeardown ( ) {
5449 const containers = kryptonContainers ( ) ;
5550 for ( const config of [ ...containers ] . reverse ( ) ) {
51+ try {
52+ process . stdout . write ( `\n[testenv:krypton] logs for ${ config . name } \n` ) ;
53+ await runLogs ( config , [ '--once' ] ) ; // tail last logs
54+ } catch ( error ) {
55+ process . stdout . write ( `[testenv:krypton] could not read logs for ${ config . name } : ${ error } \n` ) ;
56+ }
5657 await runDown ( config ) ;
5758 }
5859 process . stdout . write ( `[testenv:krypton] all containers removed\n` ) ;
0 commit comments