Skip to content

Commit

Permalink
fix stream tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Sep 20, 2024
1 parent 4d056f0 commit 1b96ab5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 3 additions & 9 deletions test/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (r *Runner) RunTests(t *testing.T) {
var testNumber int

func (r *Runner) run(t *testing.T, test *testCase, f func(*testing.T, *testCase)) {
if test.custom == nil && !r.should(runRequestType[test.requestType]) {
if !r.should(runRequestType[test.requestType]) {
return
}

Expand Down Expand Up @@ -144,18 +144,12 @@ func (r *Runner) checkStreamUpdate(t *testing.T, egressID string, expected map[s
for _, s := range info.StreamResults {
require.Equal(t, s.Status == livekit.StreamInfo_FAILED, s.Error != "")

var e livekit.StreamInfo_Status
if strings.HasSuffix(s.Url, ".contribute.live-video.net/app/{f...1}") {
e = expected[badRtmpUrl1Redacted]
} else {
e = expected[s.Url]
}
if e == livekit.StreamInfo_FAILED && s.Status == livekit.StreamInfo_ACTIVE {
if expected[s.Url] == livekit.StreamInfo_FAILED && s.Status == livekit.StreamInfo_ACTIVE {
failureStillActive = true
continue
}

require.Equal(t, e, s.Status)
require.Equal(t, expected[s.Url], s.Status)
}

if !failureStillActive {
Expand Down
4 changes: 2 additions & 2 deletions test/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import (
)

const (
badRtmpUrl1 = "rtmp://xxx.contribute.live-video.net/app/fake1"
badRtmpUrl1Redacted = "rtmp://xxx.contribute.live-video.net/app/{f...1}"
badRtmpUrl1 = "rtmp://localhost:1936/wrong/stream"
badRtmpUrl1Redacted = "rtmp://localhost:1936/wrong/{st...am}"
badRtmpUrl2 = "rtmp://localhost:1936/live/stream"
badRtmpUrl2Redacted = "rtmp://localhost:1936/live/{st...am}"
badSrtUrl1 = "srt://localhost:8891?streamid=publish:wrongport&pkt_size=1316"
Expand Down

0 comments on commit 1b96ab5

Please sign in to comment.