From b567016ddd0023260736a7edad5b2c4f5efdd11c Mon Sep 17 00:00:00 2001 From: Sander Declerck Date: Tue, 14 Oct 2025 16:11:34 +0200 Subject: [PATCH] Simplify test --- test/e2e/safe-chain-proxy.e2e.spec.js | 103 +++++++++++++------------- 1 file changed, 50 insertions(+), 53 deletions(-) diff --git a/test/e2e/safe-chain-proxy.e2e.spec.js b/test/e2e/safe-chain-proxy.e2e.spec.js index a1ffe53..0c21f88 100644 --- a/test/e2e/safe-chain-proxy.e2e.spec.js +++ b/test/e2e/safe-chain-proxy.e2e.spec.js @@ -60,58 +60,55 @@ describe("E2E: Safe chain proxy", () => { 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"); - // verdaccio.yaml - /* -storage: ./storage -uplinks: - npmjs: - url: https://registry.npmjs.org/ -packages: - "**": - access: $all - proxy: npmjs -log: { type: file, path: ./verdaccio.log, level: trace, colors: false } - */ - await configShell.runCommand( - `echo 'storage: ./storage' >> /.verdaccio-config.yaml` - ); - await configShell.runCommand(`echo 'auth:' >> /.verdaccio-config.yaml`); - await configShell.runCommand( - `echo ' htpasswd:' >> /.verdaccio-config.yaml` - ); - await configShell.runCommand( - `echo ' file: ./htpasswd' >> /.verdaccio-config.yaml` - ); - await configShell.runCommand( - `echo ' max_users: 100' >> /.verdaccio-config.yaml` - ); - await configShell.runCommand(`echo 'uplinks:' >> /.verdaccio-config.yaml`); - await configShell.runCommand(`echo ' npmjs:' >> /.verdaccio-config.yaml`); - await configShell.runCommand( - `echo ' url: https://registry.npmjs.org/' >> /.verdaccio-config.yaml` - ); - await configShell.runCommand(`echo 'packages:' >> /.verdaccio-config.yaml`); - await configShell.runCommand(`echo ' "**":' >> /.verdaccio-config.yaml`); - await configShell.runCommand( - `echo ' access: $all' >> /.verdaccio-config.yaml` - ); - await configShell.runCommand( - `echo ' proxy: npmjs' >> /.verdaccio-config.yaml` - ); - await configShell.runCommand( - `echo 'log: { type: file, path: ./verdaccio.log, level: trace, colors: false }' >> /.verdaccio-config.yaml` - ); + // await configShell.runCommand("touch /.verdaccio-config.yaml"); + // // verdaccio.yaml + // /* + // storage: ./storage + // uplinks: + // npmjs: + // url: https://registry.npmjs.org/ + // packages: + // "**": + // access: $all + // proxy: npmjs + // log: { type: file, path: ./verdaccio.log, level: trace, colors: false } + // */ + // await configShell.runCommand( + // `echo 'storage: ./storage' >> /.verdaccio-config.yaml` + // ); + // await configShell.runCommand(`echo 'auth:' >> /.verdaccio-config.yaml`); + // await configShell.runCommand( + // `echo ' htpasswd:' >> /.verdaccio-config.yaml` + // ); + // await configShell.runCommand( + // `echo ' file: ./htpasswd' >> /.verdaccio-config.yaml` + // ); + // await configShell.runCommand( + // `echo ' max_users: 100' >> /.verdaccio-config.yaml` + // ); + // await configShell.runCommand(`echo 'uplinks:' >> /.verdaccio-config.yaml`); + // await configShell.runCommand(`echo ' npmjs:' >> /.verdaccio-config.yaml`); + // await configShell.runCommand( + // `echo ' url: https://registry.npmjs.org/' >> /.verdaccio-config.yaml` + // ); + // await configShell.runCommand(`echo 'packages:' >> /.verdaccio-config.yaml`); + // await configShell.runCommand(`echo ' "**":' >> /.verdaccio-config.yaml`); + // await configShell.runCommand( + // `echo ' access: $all' >> /.verdaccio-config.yaml` + // ); + // await configShell.runCommand( + // `echo ' proxy: npmjs' >> /.verdaccio-config.yaml` + // ); + // await configShell.runCommand( + // `echo 'log: { type: file, path: ./verdaccio.log, level: trace, colors: false }' >> /.verdaccio-config.yaml` + // ); // Start a local npm registry (verdaccio) inside the container - container.dockerExec( - "npx -y verdaccio --listen 4873 -c /verdaccio-config.yaml", - true - ); + container.dockerExec("npx -y verdaccio --listen 4873", true); - // Polling until verdaccio is ready (max 60 seconds) + // Polling until verdaccio is ready (max 30 seconds) let verdaccioStarted = false; - for (let i = 0; i < 120; i++) { + for (let i = 0; i < 30; i++) { await new Promise((resolve) => setTimeout(resolve, 500)); try { const curlOutput = container.dockerExec( @@ -137,12 +134,12 @@ log: { type: file, path: ./verdaccio.log, level: trace, colors: false } console.log("NPM install output:", result.output); - const verdaccioLog = await container.openShell("bash"); - const { output: logOutput } = await verdaccioLog.runCommand( - "cat /verdaccio.log" - ); + // const verdaccioLog = await container.openShell("bash"); + // const { output: logOutput } = await verdaccioLog.runCommand( + // "cat /verdaccio.log" + // ); - console.log("Verdaccio log output:", logOutput); + // console.log("Verdaccio log output:", logOutput); // Check if the installation was successful assert(