Log even more

This commit is contained in:
Sander Declerck 2025-10-14 15:16:57 +02:00
parent daf69964f2
commit bfe5820d0f
No known key found for this signature in database

View file

@ -59,14 +59,21 @@ describe("E2E: Safe chain proxy", () => {
}); });
it(`safe-chain proxy allows to request through a local http registry`, async () => { it(`safe-chain proxy allows to request through a local http registry`, async () => {
const configShell = await container.openShell("bash");
await configShell.runCommand("touch ~/.verdaccio-config.yaml");
await configShell.runCommand("echo 'log:' >> ~/.verdaccio-config.yaml");
await configShell.runCommand(
"echo ' type: file' >> ~/.verdaccio-config.yaml"
);
await configShell.runCommand(
"echo ' path: /verdaccio.log' >> ~/.verdaccio-config.yaml"
);
// Start a local npm registry (verdaccio) inside the container // Start a local npm registry (verdaccio) inside the container
container.dockerExec("npx -y verdaccio", true); container.dockerExec("npx -y verdaccio -c ~/.verdaccio-config.yaml", true);
const shell1 = await container.openShell("bash");
await shell1.runCommand("safe-chain teardown");
// Polling until verdaccio is ready (max 60 seconds)
let verdaccioStarted = false; let verdaccioStarted = false;
// Wait for verdaccio to be ready (max 60 seconds)
for (let i = 0; i < 120; i++) { for (let i = 0; i < 120; i++) {
await new Promise((resolve) => setTimeout(resolve, 500)); await new Promise((resolve) => setTimeout(resolve, 500));
try { try {
@ -75,7 +82,7 @@ describe("E2E: Safe chain proxy", () => {
); );
if (curlOutput.includes("200 OK")) { if (curlOutput.includes("200 OK")) {
verdaccioStarted = true; verdaccioStarted = true;
console.log("Verdaccio started, after " + i * 500 + "ms"); console.log("Verdaccio started, after " + i * 500 + "ms", curlOutput);
break; break;
} }
} catch { } catch {
@ -93,6 +100,13 @@ describe("E2E: Safe chain proxy", () => {
console.log("NPM install output:", result.output); console.log("NPM install output:", result.output);
const verdaccioLog = await container.openShell("bash");
const { output: logOutput } = await verdaccioLog.runCommand(
"cat /verdaccio.log"
);
console.log("Verdaccio log output:", logOutput);
// Check if the installation was successful // Check if the installation was successful
assert( assert(
result.output.includes("added"), result.output.includes("added"),