From b52f50484878b17a1f3446083b9c1fcaebdc1b59 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 6 Mar 2023 15:20:12 +0100 Subject: Add test to ensure files are deleted --- server/tests/cli/create-move-video-storage-job.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'server/tests') diff --git a/server/tests/cli/create-move-video-storage-job.ts b/server/tests/cli/create-move-video-storage-job.ts index c357f501b..4927e0309 100644 --- a/server/tests/cli/create-move-video-storage-job.ts +++ b/server/tests/cli/create-move-video-storage-job.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ +import { join } from 'path' import { areMockObjectStorageTestsDisabled } from '@shared/core-utils' import { HttpStatusCode, VideoDetails } from '@shared/models' import { @@ -12,7 +13,7 @@ import { setAccessTokensToServers, waitJobs } from '@shared/server-commands' -import { expectStartWith } from '../shared' +import { checkDirectoryIsEmpty, expectStartWith } from '../shared' async function checkFiles (origin: PeerTubeServer, video: VideoDetails, inObjectStorage: boolean) { for (const file of video.files) { @@ -106,6 +107,14 @@ describe('Test create move video storage job', function () { } }) + it('Should not have files on disk anymore', async function () { + await checkDirectoryIsEmpty(servers[0], 'videos', [ 'private' ]) + await checkDirectoryIsEmpty(servers[0], join('videos', 'private')) + + await checkDirectoryIsEmpty(servers[0], join('streaming-playlists', 'hls'), [ 'private' ]) + await checkDirectoryIsEmpty(servers[0], join('streaming-playlists', 'hls', 'private')) + }) + after(async function () { await cleanupTests(servers) }) -- cgit v1.2.3