resolutions: number[]
transcoded: boolean
- objectStorage: boolean
+ objectStorage?: ObjectStorageCommand
objectStorageBaseUrl?: string
}) {
const {
resolutions,
transcoded,
objectStorage,
- objectStorageBaseUrl = ObjectStorageCommand.getMockPlaylistBaseUrl()
+ objectStorageBaseUrl = objectStorage?.getMockPlaylistBaseUrl()
} = options
for (const server of servers) {
playlistUrl: hlsPlaylist.playlistUrl,
resolutions,
transcoded,
- withRetry: objectStorage
+ withRetry: !!objectStorage
})
if (objectStorage) {
const subPlaylist = await originServer.streamingPlaylists.get({
url: `${baseUrl}/${video.uuid}/${i}.m3u8`,
- withRetry: objectStorage // With object storage, the request may fail because of inconsistent data in S3
+ withRetry: !!objectStorage // With object storage, the request may fail because of inconsistent data in S3
})
expect(subPlaylist).to.contain(segmentName)
baseUrlSegment: baseUrl,
videoUUID: video.uuid,
segmentName,
- hlsPlaylist
+ hlsPlaylist,
+ withRetry: !!objectStorage // With object storage, the request may fail because of inconsistent data in S3
})
if (originServer.internalServerNumber === server.internalServerNumber) {
const files = await readdir(hlsPath)
// fragmented file and playlist per resolution + master playlist + segments sha256 json file
- expect(files).to.have.lengthOf(savedResolutions.length * 2 + 2)
+ expect(files, `Directory content: ${files.join(', ')}`).to.have.lengthOf(savedResolutions.length * 2 + 2)
for (const resolution of savedResolutions) {
const fragmentedFile = files.find(f => f.endsWith(`-${resolution}-fragmented.mp4`))