mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2026-09-03 20:53:09 -05:00
Fix running again object storage move job
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
} from '@peertube/peertube-server-commands'
|
||||
import { checkDirectoryIsEmpty } from '@tests/shared/directories.js'
|
||||
import { completeCheckHlsPlaylist } from '@tests/shared/streaming-playlists.js'
|
||||
import { expect } from 'chai'
|
||||
import { join } from 'path'
|
||||
import { expectStartWith } from '../shared/checks.js'
|
||||
|
||||
@@ -168,6 +169,15 @@ describe('Test create move video storage job CLI', function () {
|
||||
}
|
||||
})
|
||||
|
||||
it('Should not re-move all files', async function () {
|
||||
const command = `npm run create-move-video-storage-job -- --to-object-storage --all-videos`
|
||||
const { stdout } = await servers[0].cli.execWithEnv(command, objectStorage.getDefaultMockConfig())
|
||||
|
||||
expect(stdout).to.not.include('Creating external storage move job ')
|
||||
|
||||
await waitJobs(servers)
|
||||
})
|
||||
|
||||
it('Should not have files on disk anymore', async function () {
|
||||
await checkDirectoryIsEmpty(servers[0], 'captions', [ 'private' ])
|
||||
|
||||
@@ -232,6 +242,15 @@ describe('Test create move video storage job CLI', function () {
|
||||
}
|
||||
})
|
||||
|
||||
it('Should not re-move all files', async function () {
|
||||
const command = `npm run create-move-video-storage-job -- --to-file-system --all-videos`
|
||||
const { stdout } = await servers[0].cli.execWithEnv(command, objectStorage.getDefaultMockConfig())
|
||||
|
||||
expect(stdout).to.not.include('Creating external storage move job ')
|
||||
|
||||
await waitJobs(servers)
|
||||
})
|
||||
|
||||
it('Should not have files on disk anymore', async function () {
|
||||
for (const fileUrl of oldFileUrls) {
|
||||
await makeRawRequest({ url: fileUrl, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
|
||||
|
||||
Reference in New Issue
Block a user