Merge pull request #222 from AikidoSec/bug/clear-pip-cache

Clear pip/uv/poetry cache before e2e tests
This commit is contained in:
bitterpanda 2025-12-07 22:08:10 +01:00 committed by GitHub
commit b40a9dd6f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View file

@ -16,6 +16,9 @@ describe("E2E: poetry coverage", () => {
const installationShell = await container.openShell("zsh"); const installationShell = await container.openShell("zsh");
await installationShell.runCommand("safe-chain setup --include-python"); await installationShell.runCommand("safe-chain setup --include-python");
// Clear poetry cache
await installationShell.runCommand("command poetry cache clear pypi --all -n");
}); });
afterEach(async () => { afterEach(async () => {
@ -29,9 +32,6 @@ describe("E2E: poetry coverage", () => {
it(`successfully installs known safe packages with poetry add`, async () => { it(`successfully installs known safe packages with poetry add`, async () => {
const shell = await container.openShell("zsh"); const shell = await container.openShell("zsh");
// Clear poetry cache using command to bypass safe-chain wrapper
await shell.runCommand("command poetry cache clear pypi --all -n");
// Initialize a new poetry project // Initialize a new poetry project
await shell.runCommand("mkdir /tmp/test-poetry-project && cd /tmp/test-poetry-project"); await shell.runCommand("mkdir /tmp/test-poetry-project && cd /tmp/test-poetry-project");
await shell.runCommand("cd /tmp/test-poetry-project && poetry init --no-interaction"); await shell.runCommand("cd /tmp/test-poetry-project && poetry init --no-interaction");

View file

@ -14,6 +14,10 @@ describe("E2E: safe-chain CLI python/pip support", () => {
await container.start(); await container.start();
// Note: We do NOT run 'safe-chain setup' here. // Note: We do NOT run 'safe-chain setup' here.
// We want to test the 'safe-chain' CLI command directly. // We want to test the 'safe-chain' CLI command directly.
// Clear pip cache
const shell = await container.openShell("zsh");
await shell.runCommand("pip3 cache purge");
}); });
afterEach(async () => { afterEach(async () => {

View file

@ -16,6 +16,9 @@ describe("E2E: uv coverage", () => {
const installationShell = await container.openShell("zsh"); const installationShell = await container.openShell("zsh");
await installationShell.runCommand("safe-chain setup --include-python"); await installationShell.runCommand("safe-chain setup --include-python");
// Clear uv cache
await installationShell.runCommand("uv cache clean");
}); });
afterEach(async () => { afterEach(async () => {