test(integration): remove sftp tests

This commit is contained in:
Nicolas Meienberger 2026-01-17 11:21:45 +01:00
parent 9f10960621
commit ce3b0e8430
6 changed files with 5 additions and 69 deletions

View file

@ -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

View file

@ -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:

View file

@ -38,5 +38,5 @@ describe("NFS Backend Integration", () => {
// 4. Unmount
const unmountResult = await backend.unmount();
expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted);
}, 60000);
}, 10000);
});

View file

@ -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);
});

View file

@ -45,5 +45,5 @@ describe("WebDAV Backend Integration", () => {
// 4. Unmount
const unmountResult = await backend.unmount();
expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted);
}, 60000);
}, 10000);
});

View file

@ -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",