Skip to content

Commit bf04b76

Browse files
committed
test: delivery encoder tests follow the ffprobe argv contract and run in the integration lane
1 parent c86d9f2 commit bf04b76

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

‎packages/engine/src/services/deliveryEncoderOptions.test.ts‎

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,29 +87,27 @@ describe.skipIf(!HAS_FFMPEG)("delivery options on a real encode", () => {
8787
function encode(name: string, extra: Partial<EncoderOptions>): string {
8888
const out = join(dir, name);
8989
const args = buildEncoderArgs({ ...base, quality: 18, ...extra }, input, out);
90-
const run = spawnSync(getFfmpegBinary(), ["-v", "error", ...args], {
90+
const run = spawnSync(getFfmpegBinary(), ["-v", "error"].concat(args), {
9191
encoding: "utf-8",
9292
});
9393
expect(run.status, run.stderr).toBe(0);
9494
return out;
9595
}
9696

97+
const probe = (inputPath: string, args: readonly string[]): string => {
98+
const argv = ["-v", "error", ...args, "--", inputPath];
99+
return spawnSync(getFfprobeBinary(), argv, { encoding: "utf-8" }).stdout;
100+
};
101+
97102
function packets(file: string): { time: number; bytes: number; key: boolean }[] {
98-
const out = spawnSync(
99-
getFfprobeBinary(),
100-
[
101-
"-v",
102-
"error",
103-
"-select_streams",
104-
"v:0",
105-
"-show_entries",
106-
"packet=pts_time,size,flags",
107-
"-of",
108-
"csv=p=0",
109-
file,
110-
],
111-
{ encoding: "utf-8" },
112-
).stdout;
103+
const out = probe(file, [
104+
"-select_streams",
105+
"v:0",
106+
"-show_entries",
107+
"packet=pts_time,size,flags",
108+
"-of",
109+
"csv=p=0",
110+
]);
113111
return out
114112
.trim()
115113
.split("\n")

‎packages/producer/scripts/test-classification.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const INTEGRATION_TEST_FILES = new Set([
3434
"src/services/assetMediaType.test.ts",
3535
"src/services/htmlCompiler.mediaType.test.ts",
3636
"src/services/htmlCompiler.naturalDuration.test.ts",
37+
"src/services/render/deliveryRender.integration.test.ts",
3738
"src/services/render/firstFrameStartingState.integration.test.ts",
3839
"src/services/render/hlsRender.integration.test.ts",
3940
"src/services/render/motionBlurVideo.integration.test.ts",

‎scripts/test-reachability.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
],
4848
"sources": {
4949
"packages/producer/scripts/run-test-lane.mjs": "638885e14480d03290803389325a655f3749442167d784e07bb3af3404598af7",
50-
"packages/producer/scripts/test-classification.mjs": "c434da94aa74aef060ef41736af798fd5a9af9236684a47d07a19661c1f78b9b",
50+
"packages/producer/scripts/test-classification.mjs": "01098b1372341f3b815200f9ff7cd3abb8ccaea469e15b924535988b205a5d60",
5151
".github/workflows/ci.yml#job#producer-source-tests": "45da72aa6cf08cdfd5bcf5311e89f12af4842f9eebc6735df19da8c02f4d4864",
5252
"packages/producer/package.json#script#test:unit": "ae6beda8319d166774be958ea5593cd27dbf7f6c9bce1d787a3fe28dfc3477b1",
5353
"packages/producer/package.json#script#test:integration": "008589f37d026877595a13501cbb66abd5cbe50e21fdcac6904f45466c3f475d",

0 commit comments

Comments
 (0)