Skip to content

🎥 Make videos programmatically with React

move it-tests to bun as well

Jonny Burger58e1f3b37245
diff --git a/packages/it-tests/package.json b/packages/it-tests/package.json
index 4df69005bc..eb233b1907 100644
--- a/packages/it-tests/package.json
+++ b/packages/it-tests/package.json
@@ -3,9 +3,9 @@
"version": "4.0.177",
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
- "test": "vitest src/rendering --run",
+ "test": "bun test src/rendering --run",
"testssr": "bun test src/ssr src/bundle src/templates src/monorepo --timeout 40000",
- "testlambda": "vitest src/lambda --run"
+ "testlambda": "bun test src/lambda src/cloudrun --run"
},
"private": true,
"devDependencies": {
@@ -31,8 +31,6 @@
"create-video": "workspace:*",
"execa": "5.1.1",
"remotion": "workspace:*",
- "sharp": "0.32.6",
- "vite": "^4.5.3",
- "vitest": "0.31.1"
+ "sharp": "0.32.6"
}
}
diff --git a/packages/it-tests/src/bundle/bundle-studio.test.ts b/packages/it-tests/src/bundle/bundle-studio.test.ts
index 0c77007a9a..5c7b8889b2 100644
--- a/packages/it-tests/src/bundle/bundle-studio.test.ts
+++ b/packages/it-tests/src/bundle/bundle-studio.test.ts
@@ -1,5 +1,5 @@
import path from "path";
-import { expect, test } from "vitest";
+import { expect, test } from "bun:test";
import { RenderInternals, openBrowser } from "@remotion/renderer";
import { existsSync } from "fs";
diff --git a/packages/it-tests/src/cloudrun/cloudrun-browser-bundle.test.ts b/packages/it-tests/src/cloudrun/cloudrun-browser-bundle.test.ts
index e18e580e56..edcd7fb9bd 100644
--- a/packages/it-tests/src/cloudrun/cloudrun-browser-bundle.test.ts
+++ b/packages/it-tests/src/cloudrun/cloudrun-browser-bundle.test.ts
@@ -13,7 +13,7 @@ test("Should not be able to bundle @remotion/cloudrun directly", async () => {
entryPoints: [require.resolve("@remotion/cloudrun")],
logLevel: "silent",
})
- ).rejects.toThrow(/Could not resolve "pnpapi"/);
+ ).toThrow(/Could not resolve "pnpapi"/);
});
describe("Should be able to bundle @remotion/cloudrun/client with ESBuild", () => {
@@ -35,10 +35,10 @@ describe("Should be able to bundle @remotion/cloudrun/client with ESBuild", () =
expect(contents.includes("getRemotionEnvironment")).toBe(false);
});
- test("Bundle should be below 6MB", async () => {
+ test("Bundle should be below 7MB", async () => {
const file = await fs.promises.readFile(outfile, "utf-8");
expect(file.length).toBeGreaterThan(10000);
- expect(file.length).toBeLessThanOrEqual(6000000);
+ expect(file.length).toBeLessThanOrEqual(7_000_000);
});
test("Bundle should not include Renderer", async () => {
diff --git a/packages/it-tests/src/lambda/lambda-browser-bundle.test.ts b/packages/it-tests/src/lambda/lambda-browser-bundle.test.ts
index 476961ad81..2a875e353b 100644
--- a/packages/it-tests/src/lambda/lambda-browser-bundle.test.ts
+++ b/packages/it-tests/src/lambda/lambda-browser-bundle.test.ts
@@ -13,7 +13,7 @@ test("Should not be able to bundle @remotion/lambda directly", async () => {
entryPoints: [require.resolve("@remotion/lambda")],
logLevel: "silent",
})
- ).rejects.toThrow(/Could not resolve "pnpapi"/);
+ ).toThrow(/Could not resolve "pnpapi"/);
});
describe("Should be able to bundle @remotion/lambda/client with ESBuild", () => {
diff --git a/packages/it-tests/src/rendering/cancel-render.test.ts b/packages/it-tests/src/rendering/cancel-render.test.ts
index e4dd68cce8..defdf85ede 100644
--- a/packages/it-tests/src/rendering/cancel-render.test.ts
+++ b/packages/it-tests/src/rendering/cancel-render.test.ts
@@ -1,10 +1,22 @@
import path from "path";
import fs from "fs";
-import { beforeEach, expect, test } from "vitest";
+import { beforeAll, beforeEach, expect, test } from "bun:test";
import execa from "execa";
const outputPath = path.join(process.cwd(), "packages/example/out.mp4");
+beforeAll(async () => {
+ /**
+ * Before running any of these tests, we should bundle the example project. In the CI, this is already done.
+ */
+ if (process.env.CI) {
+ return;
+ }
+ await execa("pnpm", ["exec", "remotion", "bundle"], {
+ cwd: path.join(process.cwd(), "..", "example"),
+ });
+});
+
beforeEach(() => {
if (fs.existsSync(outputPath)) {
fs.unlinkSync(outputPath);
@@ -18,6 +30,7 @@ test("Should fail to render if cancelRender() was being used", async () => {
"exec",
"remotion",
"render",
+ "build",
"cancel-render",
"--frames=2-10",
outputPath,
diff --git a/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts b/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts
index 174dd04225..8557694502 100644
--- a/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts
+++ b/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts
@@ -104,5 +104,6 @@ test(
},
{
retry: 2,
+ timeout: 40000,
}
);
diff --git a/packages/it-tests/src/rendering/frame-accuracy.test.ts b/packages/it-tests/src/rendering/frame-accuracy.test.ts
index 0babb59892..5adb82b769 100644
--- a/packages/it-tests/src/rendering/frame-accuracy.test.ts
+++ b/packages/it-tests/src/rendering/frame-accuracy.test.ts
@@ -95,12 +95,24 @@ test("should render correct frames from embedded videos - WebM offthread", async
expect(missedFrames).toBe(0);
});
-test("should render correct frames from embedded videos - MP4 onthread", async () => {
- const missedFrames = await getMissedFramesforCodec("mp4", false);
- expect(missedFrames).toBeLessThanOrEqual(8);
-});
+test(
+ "should render correct frames from embedded videos - MP4 onthread",
+ async () => {
+ const missedFrames = await getMissedFramesforCodec("mp4", false);
+ expect(missedFrames).toBeLessThanOrEqual(8);
+ },
+ {
+ timeout: 40000,
+ }
+);
-test("should render correct frames from embedded videos - MP4 offthread", async () => {
- const missedFrames = await getMissedFramesforCodec("mp4", true);
- expect(missedFrames).toBe(0);
-});
+test(
+ "should render correct frames from embedded videos - MP4 offthread",
+ async () => {
+ const missedFrames = await getMissedFramesforCodec("mp4", true);
+ expect(missedFrames).toBe(0);
+ },
+ {
+ timeout: 40000,
+ }
+);
diff --git a/packages/it-tests/src/rendering/get-video-metadata.test.ts b/packages/it-tests/src/rendering/get-video-metadata.test.ts
index a3559743a8..8c714d2910 100644
--- a/packages/it-tests/src/rendering/get-video-metadata.test.ts
+++ b/packages/it-tests/src/rendering/get-video-metadata.test.ts
@@ -113,6 +113,6 @@ test("Should not return duration in variable fps video", async () => {
);
expect(existsSync(video)).toEqual(true);
- const hi = await getVideoMetadata(video, { logLevel: "verbose" });
- console.log(hi);
+ const hi = await getVideoMetadata(video, { logLevel: "info" });
+ expect(hi.durationInSeconds).toBe(null);
});
diff --git a/packages/it-tests/src/rendering/rendering.test.ts b/packages/it-tests/src/rendering/rendering.test.ts
index f48df377dc..d127a671e8 100644
--- a/packages/it-tests/src/rendering/rendering.test.ts
+++ b/packages/it-tests/src/rendering/rendering.test.ts
@@ -533,24 +533,30 @@ test("Should be able to render a huge payload that gets serialized", async () =>
fs.unlinkSync(outputPath.replace(".mp4", ".png"));
});
-test("If timeout, the error should be shown", async () => {
- const task = await execa(
- "pnpm",
- [
- "exec",
- "remotion",
- "render",
- "build",
- "Timeout",
- outputPath,
- "--timeout=7000",
- ],
- {
- cwd: path.join(process.cwd(), "..", "example"),
- reject: false,
- }
- );
-
- expect(task.exitCode).toBe(1);
- expect(task.stderr).toContain("This error should appear");
-});
+test(
+ "If timeout, the error should be shown",
+ async () => {
+ const task = await execa(
+ "pnpm",
+ [
+ "exec",
+ "remotion",
+ "render",
+ "build",
+ "Timeout",
+ outputPath,
+ "--timeout=7000",
+ ],
+ {
+ cwd: path.join(process.cwd(), "..", "example"),
+ reject: false,
+ }
+ );
+
+ expect(task.exitCode).toBe(1);
+ expect(task.stderr).toContain("This error should appear");
+ },
+ {
+ timeout: 30000,
+ }
+);
diff --git a/packages/it-tests/vitest.config.mts b/packages/it-tests/vitest.config.mts
deleted file mode 100644
index 0f885a8d76..0000000000
--- a/packages/it-tests/vitest.config.mts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { defineConfig } from "vitest/config";
-
-export default defineConfig({
- test: {
- testTimeout: 90000,
- maxConcurrency: 1,
- threads: false,
- },
-});
diff --git a/packages/lambda-php/.phpunit.result.cache b/packages/lambda-php/.phpunit.result.cache
index f4d3381b12..8601c4e88e 100644
--- a/packages/lambda-php/.phpunit.result.cache
+++ b/packages/lambda-php/.phpunit.result.cache
@@ -1 +1 @@
-{"version":1,"defects":[],"times":{"Remotion\\LambdaPhp\\Tests\\PHPClientTest::testClient":0.022,"Remotion\\LambdaPhp\\Tests\\PHPRenderProgressTest::testClient":0.017}}
\ No newline at end of file
+{"version":1,"defects":[],"times":{"Remotion\\LambdaPhp\\Tests\\PHPClientTest::testClient":0.021,"Remotion\\LambdaPhp\\Tests\\PHPRenderProgressTest::testClient":0.016}}
\ No newline at end of file
diff --git a/packages/lambda-php/composer.lock b/packages/lambda-php/composer.lock
index 8bbec0c0de..421344c2db 100644
--- a/packages/lambda-php/composer.lock
+++ b/packages/lambda-php/composer.lock
@@ -8,16 +8,16 @@
"packages": [
{
"name": "aws/aws-crt-php",
- "version": "v1.2.5",
+ "version": "v1.2.6",
"source": {
"type": "git",
"url": "https://github.com/awslabs/aws-crt-php.git",
- "reference": "0ea1f04ec5aa9f049f97e012d1ed63b76834a31b"
+ "reference": "a63485b65b6b3367039306496d49737cf1995408"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/0ea1f04ec5aa9f049f97e012d1ed63b76834a31b",
- "reference": "0ea1f04ec5aa9f049f97e012d1ed63b76834a31b",
+ "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/a63485b65b6b3367039306496d49737cf1995408",
+ "reference": "a63485b65b6b3367039306496d49737cf1995408",
"shasum": ""
},
"require": {
@@ -56,22 +56,22 @@
],
"support": {
"issues": "https://github.com/awslabs/aws-crt-php/issues",
- "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.5"
+ "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.6"
},
- "time": "2024-04-19T21:30:56+00:00"
+ "time": "2024-06-13T17:21:28+00:00"
},
{
"name": "aws/aws-sdk-php",
- "version": "3.314.6",
+ "version": "3.314.7",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "d04da330b0201edab71edd33a03b8d5ad6e4a313"
+ "reference": "3a7ea3e49ae50eaaa969dc15d69b2dd46b4d7284"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d04da330b0201edab71edd33a03b8d5ad6e4a313",
- "reference": "d04da330b0201edab71edd33a03b8d5ad6e4a313",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/3a7ea3e49ae50eaaa969dc15d69b2dd46b4d7284",
+ "reference": "3a7ea3e49ae50eaaa969dc15d69b2dd46b4d7284",
"shasum": ""
},
"require": {
@@ -151,9 +151,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.314.6"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.314.7"
},
- "time": "2024-06-20T18:09:51+00:00"
+ "time": "2024-06-24T21:03:27+00:00"
},
{
"name": "guzzlehttp/guzzle",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 726fe39896..c117ec0223 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1299,12 +1299,6 @@ importers:
sharp:
specifier: 0.32.6
version: 0.32.6
- vite:
- specifier: ^4.5.3
- version: 4.5.3(@types/[email protected])([email protected])
- vitest:
- specifier: 0.31.1
packages/lambda:
dependencies:
@@ -2075,9 +2069,6 @@ importers:
react:
specifier: 18.3.1
version: 18.3.1
- vitest:
- specifier: 0.31.1
packages/studio-shared:
dependencies: