浏览代码

Add test to ensure files are deleted

tags/v5.1.0
Chocobozzz 2 个月前
父节点
当前提交
b52f504848
找不到此签名对应的密钥 GPG 密钥 ID: 583A612D890159BE
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. +10
    -1
      server/tests/cli/create-move-video-storage-job.ts

+ 10
- 1
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)
})


正在加载...
取消
保存