mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Log even more
This commit is contained in:
parent
daf69964f2
commit
bfe5820d0f
1 changed files with 20 additions and 6 deletions
|
|
@ -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"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue