-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add livestream channel clip samples and tests #4449
base: main
Are you sure you want to change the base?
Conversation
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
r.Errorf("createChannelClip got err: %v", err) | ||
} | ||
if got := buf.String(); !strings.Contains(got, clipName) { | ||
r.Errorf("createChannelClip got\n----\n%v\n----\nWant to contain:\n----\n%v\n----\n", got, clipName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd prefer to not have the test output formatted in this way. It makes it harder to read on GitHub.
The test input can be as simple as:
r.Errorf("createChannelClip: want: %v, got %v", clipName, got)
@@ -517,6 +525,64 @@ func TestChannelEvents(t *testing.T) { | |||
} | |||
}) | |||
|
|||
// Tests for clips | |||
// Send a test stream for the clip. | |||
cmd := exec.Command("ffmpeg", "-re", "-f", "lavfi", "-t", "45", "-i", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: I have concerns about running arbitrary processes from within tests. @muncus PTAL.
- Let's isolate this test into its own file. I want to keep this test hermeneutically sealed from other tests as best as possible.
- What exactly is the point of executing this command? The bytes returned from the output are thrown away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, this command is generating a video stream. Can we do this with a static file instead?
I'd prefer to avoid adding ffmpeg
to our testing images, as it has a history of vulnerabilities and could increase ongoing maintenance requirements.
Fixes b:341726237
Important: FFmpeg (https://www.ffmpeg.org/) must be installed in the test environment.
Checklist
go test -v ./..
(see Testing)gofmt
(see Formatting)