mirror of
https://github.com/dokploy/dokploy.git
synced 2026-06-14 03:19:49 +00:00
refactor(tests): remove console logs from volume backup and restore tests for cleaner output
This commit is contained in:
@@ -237,12 +237,6 @@ describe(
|
||||
}
|
||||
|
||||
// Verify the backup file was actually created by Dokploy's command
|
||||
const { stdout: files } = await execAsync(
|
||||
`ls -lh "${volumeBackupPath}"`,
|
||||
);
|
||||
console.log(`Files in backup directory:\n${files}`);
|
||||
|
||||
// Find the actual backup file created
|
||||
const { stdout: backupFiles } = await execAsync(
|
||||
`find "${volumeBackupPath}" -name "*.tar" -type f`,
|
||||
);
|
||||
@@ -268,8 +262,6 @@ describe(
|
||||
const { stdout: tarContents } = await execAsync(
|
||||
`tar -tf "${backupFilePath}"`,
|
||||
);
|
||||
console.log("📋 Tar contents preview (first 30 lines):");
|
||||
console.log(tarContents.split("\n").slice(0, 30).join("\n"));
|
||||
|
||||
expect(tarContents).toContain("large-file-1.dat");
|
||||
expect(tarContents).toContain("large-file-2.dat");
|
||||
@@ -310,7 +302,6 @@ describe(
|
||||
const { stdout: extractedFiles } = await execAsync(
|
||||
`find "${tempDir}" -type f`,
|
||||
);
|
||||
console.log("Extracted files:", extractedFiles);
|
||||
|
||||
// Verify marker file exists somewhere
|
||||
const markerFiles = extractedFiles
|
||||
|
||||
@@ -691,13 +691,9 @@ describe(
|
||||
console.log(`📊 Backup size: ${sizeInMB.toFixed(2)}MB`);
|
||||
|
||||
// Verify backup contents before restore
|
||||
console.log("🔍 Checking backup contents...");
|
||||
const { stdout: backupContents } = await execAsync(
|
||||
`tar -tf "${backupFilePath}" | grep -E "(image[123]\\.jpg|file-[0-9]+\\.txt)"`,
|
||||
);
|
||||
console.log(
|
||||
`Sample files in backup (showing first 10 and last 10):\n${backupContents.split("\n").slice(0, 10).join("\n")}\n...\n${backupContents.split("\n").slice(-10).join("\n")}`,
|
||||
);
|
||||
|
||||
// Check if large files are in the backup
|
||||
const hasImage1 = backupContents.includes("image1.jpg");
|
||||
@@ -796,10 +792,8 @@ describe(
|
||||
|
||||
// Check large files exist
|
||||
const { stdout: uploads } = await execAsync(`
|
||||
docker run --rm -v ${wpVolumeName}:/data ubuntu bash -c "ls -lh /data/wp-content/uploads/2024/01/ && echo '---' && find /data/wp-content/uploads/2024/01/ -name '*.jpg' -type f"
|
||||
docker run --rm -v ${wpVolumeName}:/data ubuntu bash -c "find /data/wp-content/uploads/2024/01/ -name '*.jpg' -type f"
|
||||
`);
|
||||
console.log("📁 Uploads directory after restore:");
|
||||
console.log(uploads);
|
||||
|
||||
// Check if large files were restored
|
||||
const hasRestoredImage1 = uploads.includes("image1.jpg");
|
||||
|
||||
Reference in New Issue
Block a user