function runTests (objectStorage: boolean) {
let servers: PeerTubeServer[] = []
const videosUUID: string[] = []
+ const publishedAt: string[] = []
before(async function () {
- this.timeout(60000)
+ this.timeout(120000)
const config = objectStorage
? ObjectStorageCommand.getDefaultConfig()
for (let i = 1; i <= 5; i++) {
const { uuid, shortUUID } = await servers[0].videos.upload({ attributes: { name: 'video' + i } })
+ await waitJobs(servers)
+
+ const video = await servers[0].videos.get({ id: uuid })
+ publishedAt.push(video.publishedAt as string)
+
if (i > 2) {
videosUUID.push(uuid)
} else {
for (const server of servers) {
const videoDetails = await server.videos.get({ id: videosUUID[4] })
- expect(videoDetails.files).to.have.lengthOf(4)
+ expect(videoDetails.files).to.have.lengthOf(5)
expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)
- expect(videoDetails.streamingPlaylists[0].files).to.have.lengthOf(4)
+ expect(videoDetails.streamingPlaylists[0].files).to.have.lengthOf(5)
if (objectStorage) {
await checkFilesInObjectStorage(videoDetails.files, 'webtorrent')
}
})
+ it('Should not have updated published at attributes', async function () {
+ for (const id of videosUUID) {
+ const video = await servers[0].videos.get({ id })
+
+ expect(publishedAt.some(p => video.publishedAt === p)).to.be.true
+ }
+ })
+
after(async function () {
await cleanupTests(servers)
})