Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Jul 18, 2024
1 parent 93dd6a6 commit 35dea12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 7 additions & 3 deletions test/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const (
redactedUrl1 = "rtmp://localhost:1935/live/{st...am}"
streamUrl2 = "rtmp://localhost:1935/live/stream_key"
redactedUrl2 = "rtmp://localhost:1935/live/{str...key}"
badStreamUrl1 = "rtmp://sfo.contribute.live-video.net/app/fake1"
redactedBadUrl1 = "rtmp://sfo.contribute.live-video.net/app/{f...1}"
badStreamUrl1 = "rtmp://xxx.contribute.live-video.net/app/fake1"
redactedBadUrl1 = "rtmp://xxx.contribute.live-video.net/app/{f...1}"
badStreamUrl2 = "rtmp://localhost:1936/live/stream"
redactedBadUrl2 = "rtmp://localhost:1936/live/{st...am}"
webUrl = "https://videoplayer-2k23.vercel.app/videos/eminem"
Expand Down Expand Up @@ -270,7 +270,11 @@ func (r *Runner) checkStreamUpdate(t *testing.T, egressID string, expected map[s

require.Equal(t, len(expected), len(info.StreamResults))
for _, s := range info.StreamResults {
require.Equal(t, expected[s.Url], s.Status)
if strings.HasSuffix(s.Url, ".contribute.live-video.net/app/{f...1}") {
require.Equal(t, expected[redactedBadUrl1], s.Status)
} else {
require.Equal(t, expected[s.Url], s.Status)
}
require.Equal(t, s.Status == livekit.StreamInfo_FAILED, s.Error != "")
}
}
Expand Down
5 changes: 1 addition & 4 deletions test/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,8 @@ func (r *Runner) runStreamTest(t *testing.T, req *rpc.StartEgressRequest, test *
require.Equal(t, livekit.StreamInfo_FINISHED.String(), info.Status.String())
require.Greater(t, float64(info.Duration)/1e9, 10.0)

case redactedBadUrl1, redactedBadUrl2:
require.Equal(t, livekit.StreamInfo_FAILED.String(), info.Status.String())

default:
t.Fatal("invalid stream url in result")
require.Equal(t, livekit.StreamInfo_FAILED.String(), info.Status.String())
}
}
}
Expand Down

0 comments on commit 35dea12

Please sign in to comment.