Skip to content

Commit

Permalink
fix live playlist tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Oct 17, 2024
1 parent 1f00aa0 commit a47f750
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (r *Runner) buildStreamOutputs(o *streamOptions) []*livekit.StreamOutput {
}

func (r *Runner) buildSegmentOutputs(o *segmentOptions) []*livekit.SegmentedFileOutput {
if u := r.getUploadConfig(); u != nil && o.suffix == livekit.SegmentedFileSuffix_INDEX {
if u := r.getUploadConfig(); u != nil {
output := &livekit.SegmentedFileOutput{
FilenamePrefix: path.Join(uploadPrefix, o.prefix),
PlaylistName: o.playlist,
Expand Down
20 changes: 11 additions & 9 deletions test/segments.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,17 @@ func (r *Runner) verifySegmentOutput(t *testing.T, p *config.PipelineConfig, fil
localPlaylistPath = path.Join(r.FilePrefix, path.Base(storedPlaylistPath))
download(t, p.GetSegmentConfig().StorageConfig, localPlaylistPath, storedPlaylistPath)

manifestLocal := path.Join(path.Dir(localPlaylistPath), res.EgressId+".json")
manifestStorage := path.Join(path.Dir(storedPlaylistPath), res.EgressId+".json")
manifest := loadManifest(t, p.GetSegmentConfig().StorageConfig, manifestLocal, manifestStorage)

for _, playlist := range manifest.Playlists {
require.Equal(t, segmentCount, len(playlist.Segments))
for _, segment := range playlist.Segments {
localPath := path.Join(r.FilePrefix, path.Base(segment.Filename))
download(t, p.GetSegmentConfig().StorageConfig, localPath, segment.Filename)
if plType == m3u8.PlaylistTypeEvent {
manifestLocal := path.Join(path.Dir(localPlaylistPath), res.EgressId+".json")
manifestStorage := path.Join(path.Dir(storedPlaylistPath), res.EgressId+".json")
manifest := loadManifest(t, p.GetSegmentConfig().StorageConfig, manifestLocal, manifestStorage)

for _, playlist := range manifest.Playlists {
require.Equal(t, segmentCount, len(playlist.Segments))
for _, segment := range playlist.Segments {
localPath := path.Join(r.FilePrefix, path.Base(segment.Filename))
download(t, p.GetSegmentConfig().StorageConfig, localPath, segment.Filename)
}
}
}

Expand Down

0 comments on commit a47f750

Please sign in to comment.