Skip to content

Commit

Permalink
chore: add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
viraj124 committed Jan 27, 2025
1 parent efb6ff2 commit 96d04c9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 29 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ jobs:
validate:
runs-on: buildjet-4vcpu-ubuntu-2204
needs: audit-deps
env:
# Required for Testcontainers to work in CI
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
DOCKER_HOST: unix:///var/run/docker.sock
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
# Disable Ryuk container to prevent port conflicts
TESTCONTAINERS_RYUK_DISABLED: true
# Force host networking
TESTCONTAINERS_HOST_OVERRIDE: "localhost"
# env:
# # Required for Testcontainers to work in CI
# TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
# DOCKER_HOST: unix:///var/run/docker.sock
# DOCKER_BUILDKIT: 1
# COMPOSE_DOCKER_CLI_BUILD: 1
# # Disable Ryuk container to prevent port conflicts
# TESTCONTAINERS_RYUK_DISABLED: true
# # Force host networking
# TESTCONTAINERS_HOST_OVERRIDE: 'localhost'
steps:
- uses: actions/checkout@v3
- uses: FuelLabs/github-actions/setups/node@master
Expand Down
49 changes: 30 additions & 19 deletions packages/integration-tests/docker-setup/docker.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type {
StartedPostgreSqlContainer} from '@testcontainers/postgresql';
import {
PostgreSqlContainer
} from '@testcontainers/postgresql';
import type { StartedPostgreSqlContainer } from '@testcontainers/postgresql';
import { PostgreSqlContainer } from '@testcontainers/postgresql';
import { exec } from 'child_process';
import { config as dotEnvConfig } from 'dotenv';
import * as path from 'path';
Expand Down Expand Up @@ -59,30 +56,44 @@ async function startL1ChainContainer(network: StartedNetwork) {
-f ${dockerfilePath} \
${projectRoot}`;

await execAsync(buildCommand);
// await execAsync(buildCommand);

try {
const { stdout, stderr } = await execAsync(buildCommand);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
console.log('Docker build output:');
console.log('stdout:', stdout);
if (stderr) {
console.error('stderr:', stderr);
}
} catch (error) {
console.error('Docker build error:', error);
throw error;
}

const container = await new GenericContainer(IMAGE_NAME)
.withExposedPorts(
{ host: 8545, container: 9545 },
// { host: 8080, container: 8081 }
{ host: 8080, container: 8081 }
)
.withNetwork(network)
.withNetworkAliases('l1_chain')
.withName('l1_chain')
.withEnvironment({
TENDERLY_RPC_URL: process.env.TENDERLY_RPC_URL
? process.env.TENDERLY_RPC_URL
: '',
})
// .withNetwork(network)
// .withNetworkAliases('l1_chain')
// .withName('l1_chain')
// .withEnvironment({
// TENDERLY_RPC_URL: process.env.TENDERLY_RPC_URL
// ? process.env.TENDERLY_RPC_URL
// : '',
// })
// .withStartupTimeout(120000)
.withWaitStrategy(
Wait.forAll([
Wait.forListeningPorts(),
Wait.forAll([
Wait.forListeningPorts(),
// Wait.forLogMessage('Server is running at https://localhost:8081'),
])
)
])
)
.start();

console.log(container.logs);

return container;
}

Expand Down

0 comments on commit 96d04c9

Please sign in to comment.