From d59b71d6360ef4932cedde9d559f88dc89aaef5e Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sat, 20 Dec 2025 21:44:22 -0600 Subject: [PATCH] refactor(tests): remove console logs from volume backup and restore tests for cleaner output --- .../__test__/volume-backups/volume-backup.real.test.ts | 9 --------- .../__test__/volume-backups/volume-restore.real.test.ts | 8 +------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/apps/dokploy/__test__/volume-backups/volume-backup.real.test.ts b/apps/dokploy/__test__/volume-backups/volume-backup.real.test.ts index f1de5eecf..5253c2bfa 100644 --- a/apps/dokploy/__test__/volume-backups/volume-backup.real.test.ts +++ b/apps/dokploy/__test__/volume-backups/volume-backup.real.test.ts @@ -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 diff --git a/apps/dokploy/__test__/volume-backups/volume-restore.real.test.ts b/apps/dokploy/__test__/volume-backups/volume-restore.real.test.ts index 2f2095a91..d14b783e3 100644 --- a/apps/dokploy/__test__/volume-backups/volume-restore.real.test.ts +++ b/apps/dokploy/__test__/volume-backups/volume-restore.real.test.ts @@ -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");