From ce3b0e843074f3d3852c7be130ce5ff4b410237d Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Sat, 17 Jan 2026 11:21:45 +0100 Subject: [PATCH] test(integration): remove sftp tests --- .../integration/backends/Dockerfile.tester | 5 -- .../integration/backends/docker-compose.yml | 14 +----- app/test/integration/backends/nfs.test.ts | 2 +- app/test/integration/backends/sftp.test.ts | 48 ------------------- app/test/integration/backends/webdav.test.ts | 2 +- package.json | 3 +- 6 files changed, 5 insertions(+), 69 deletions(-) delete mode 100644 app/test/integration/backends/sftp.test.ts diff --git a/app/test/integration/backends/Dockerfile.tester b/app/test/integration/backends/Dockerfile.tester index fe0522b7..415a9765 100644 --- a/app/test/integration/backends/Dockerfile.tester +++ b/app/test/integration/backends/Dockerfile.tester @@ -10,10 +10,5 @@ RUN apt-get update && apt-get install -y \ netcat-openbsd \ && rm -rf /var/lib/apt/lists/* -RUN useradd -m davuser - -# Enable user_allow_other for FUSE mounts -RUN echo "user_allow_other" >> /etc/fuse.conf - WORKDIR /app diff --git a/app/test/integration/backends/docker-compose.yml b/app/test/integration/backends/docker-compose.yml index 31ea3c24..b05b7666 100644 --- a/app/test/integration/backends/docker-compose.yml +++ b/app/test/integration/backends/docker-compose.yml @@ -12,9 +12,8 @@ services: environment: - NODE_ENV=test - LOG_LEVEL=debug - command: tail -f /dev/null # Keep alive for exec + command: tail -f /dev/null - # Mock SMB Server smb-server: image: dperson/samba environment: @@ -23,7 +22,6 @@ services: tmpfs: - /tmp/samba - # Mock WebDAV Server webdav-server: image: bytemark/webdav environment: @@ -33,7 +31,6 @@ services: volumes: - webdav-data:/var/lib/dav/data - # Mock NFS Server nfs-server: image: erichough/nfs-server privileged: true @@ -43,15 +40,6 @@ services: volumes: - nfs-data:/exports - # Mock SFTP Server - sftp-server: - image: atmoz/sftp - command: testuser:testpass:1001 - volumes: - - sftp-data:/home/testuser - volumes: webdav-data: nfs-data: - sftp-data: - diff --git a/app/test/integration/backends/nfs.test.ts b/app/test/integration/backends/nfs.test.ts index 8367a901..f89f0187 100644 --- a/app/test/integration/backends/nfs.test.ts +++ b/app/test/integration/backends/nfs.test.ts @@ -38,5 +38,5 @@ describe("NFS Backend Integration", () => { // 4. Unmount const unmountResult = await backend.unmount(); expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted); - }, 60000); + }, 10000); }); diff --git a/app/test/integration/backends/sftp.test.ts b/app/test/integration/backends/sftp.test.ts deleted file mode 100644 index c96f70f9..00000000 --- a/app/test/integration/backends/sftp.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { describe, expect, it, beforeAll } from "bun:test"; -import { makeSftpBackend } from "../../../server/modules/backends/sftp/sftp-backend"; -import { BACKEND_STATUS } from "../../../schemas/volumes"; -import * as fs from "node:fs/promises"; - -describe("SFTP Backend Integration", () => { - const mountPath = "/tmp/test-mount-sftp"; - - const config = { - backend: "sftp" as const, - host: "sftp-server", - username: "testuser", - password: "testpass", - path: "", - port: 22, - skipHostKeyCheck: true, - }; - - beforeAll(async () => { - await fs.rm(mountPath, { recursive: true, force: true }).catch(() => {}); - }); - - it("should mount, check health, and unmount successfully", async () => { - // SKIPPED: The atmoz/sftp Docker image sets restrictive permissions on the home - // directory that prevent writes even when mounting as root. This is a test infrastructure - // limitation, not an issue with the SFTP backend code itself. In production, - // SFTP servers typically have properly configured writable directories. - const backend = makeSftpBackend(config, mountPath); - - // 1. Mount - const mountResult = await backend.mount(); - expect(mountResult.status).toBe(BACKEND_STATUS.mounted); - - // 2. Health Check - const healthResult = await backend.checkHealth(); - expect(healthResult.status).toBe(BACKEND_STATUS.mounted); - - // 3. Write/Read test - Write to writable directory - const testFile = `${mountPath}/test-sftp-${Date.now()}.txt`; - await fs.writeFile(testFile, "hello from sftp integration"); - const content = await fs.readFile(testFile, "utf-8"); - expect(content).toBe("hello from sftp integration"); - - // 4. Unmount - const unmountResult = await backend.unmount(); - expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted); - }, 60000); -}); diff --git a/app/test/integration/backends/webdav.test.ts b/app/test/integration/backends/webdav.test.ts index c310e667..34d23c53 100644 --- a/app/test/integration/backends/webdav.test.ts +++ b/app/test/integration/backends/webdav.test.ts @@ -45,5 +45,5 @@ describe("WebDAV Backend Integration", () => { // 4. Unmount const unmountResult = await backend.unmount(); expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted); - }, 60000); + }, 10000); }); diff --git a/package.json b/package.json index 58569c85..7b6ff8da 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "test": "bun run test:server && bun run test:client", "test:e2e": "NODE_ENV=test dotenv -e .env.local -- playwright test", "test:e2e:ui": "NODE_ENV=test dotenv -e .env.local -- playwright test --ui", - "test:codegen": "playwright codegen localhost:4096" + "test:codegen": "playwright codegen localhost:4096", + "test:integration": "app/test/integration/backends/run.sh" }, "dependencies": { "@dnd-kit/core": "^6.3.1",