aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-03-06 15:20:12 +0100
committerChocobozzz <me@florianbigard.com>2023-03-07 10:18:32 +0100
commitb52f50484878b17a1f3446083b9c1fcaebdc1b59 (patch)
tree7ee250441a0acc5d40f3e0584009a6141f9edacf /server/tests/cli
parentf2dbbf6a969d33464aa9024517c7a2c4a4f35e75 (diff)
downloadPeerTube-b52f50484878b17a1f3446083b9c1fcaebdc1b59.tar.gz
PeerTube-b52f50484878b17a1f3446083b9c1fcaebdc1b59.tar.zst
PeerTube-b52f50484878b17a1f3446083b9c1fcaebdc1b59.zip
Add test to ensure files are deleted
Diffstat (limited to 'server/tests/cli')
-rw-r--r--server/tests/cli/create-move-video-storage-job.ts11
1 files changed, 10 insertions, 1 deletions
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 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import { join } from 'path'
3import { areMockObjectStorageTestsDisabled } from '@shared/core-utils' 4import { areMockObjectStorageTestsDisabled } from '@shared/core-utils'
4import { HttpStatusCode, VideoDetails } from '@shared/models' 5import { HttpStatusCode, VideoDetails } from '@shared/models'
5import { 6import {
@@ -12,7 +13,7 @@ import {
12 setAccessTokensToServers, 13 setAccessTokensToServers,
13 waitJobs 14 waitJobs
14} from '@shared/server-commands' 15} from '@shared/server-commands'
15import { expectStartWith } from '../shared' 16import { checkDirectoryIsEmpty, expectStartWith } from '../shared'
16 17
17async function checkFiles (origin: PeerTubeServer, video: VideoDetails, inObjectStorage: boolean) { 18async function checkFiles (origin: PeerTubeServer, video: VideoDetails, inObjectStorage: boolean) {
18 for (const file of video.files) { 19 for (const file of video.files) {
@@ -106,6 +107,14 @@ describe('Test create move video storage job', function () {
106 } 107 }
107 }) 108 })
108 109
110 it('Should not have files on disk anymore', async function () {
111 await checkDirectoryIsEmpty(servers[0], 'videos', [ 'private' ])
112 await checkDirectoryIsEmpty(servers[0], join('videos', 'private'))
113
114 await checkDirectoryIsEmpty(servers[0], join('streaming-playlists', 'hls'), [ 'private' ])
115 await checkDirectoryIsEmpty(servers[0], join('streaming-playlists', 'hls', 'private'))
116 })
117
109 after(async function () { 118 after(async function () {
110 await cleanupTests(servers) 119 await cleanupTests(servers)
111 }) 120 })