Skip to content

🎥 Make videos programmatically with React

fix stuff

Jonny Burgera49dd115c4e4
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index 4f89ee0e41..c09fff82ea 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -34,19 +34,13 @@ jobs:
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- - name: Test Lambda IT
- timeout-minutes: 12
- run: |
- pnpm run testlambda
- name: Ensure Lambda browser
run: |
cd packages/lambda && bunx remotion browser ensure
- - name: IT Tests
- run: |
- cd packages/it-tests && bun test src/lambda src/cloudrun --run
- - name: Lambda Units
+ - name: Test Lambda IT
+ timeout-minutes: 12
run: |
- cd packages/lambda && bun test src/test/integration --run
+ pnpm run testlambda
ssr-tests:
runs-on: ubuntu-latest
name: SSR integration
diff --git a/packages/it-tests/package.json b/packages/it-tests/package.json
index 60d5a8b2a0..b2214686de 100644
--- a/packages/it-tests/package.json
+++ b/packages/it-tests/package.json
@@ -8,7 +8,7 @@
"scripts": {
"test": "bun test src/rendering --run",
"testssr": "bun test src/ssr src/bundle src/templates src/monorepo --timeout 40000",
- "testlambda": "exit 0",
+ "testlambda": "bun test src/lambda src/cloudrun --run",
"formatting": "prettier src --check"
},
"private": true,
diff --git a/packages/lambda/package.json b/packages/lambda/package.json
index 224000febb..21a780aac4 100644
--- a/packages/lambda/package.json
+++ b/packages/lambda/package.json
@@ -10,7 +10,7 @@
"scripts": {
"formatting": "prettier src --check",
"lint": "eslint src",
- "testlambda": "exit 0",
+ "testlambda": "bun test src/test/integration",
"test": "bun test src/test/unit",
"make": "tsc -d && bun build.ts",
"prepublishOnly": "bun build.ts && bun ensure-version-match.js"
diff --git a/packages/lambda/src/test/mock-implementation.ts b/packages/lambda/src/test/mock-implementation.ts
index 35c38e4680..d18a43637c 100644
--- a/packages/lambda/src/test/mock-implementation.ts
+++ b/packages/lambda/src/test/mock-implementation.ts
@@ -87,7 +87,7 @@ export const mockImplementation: ProviderSpecifics<AwsProvider> = {
files
.filter((p) => p.key.startsWith(input.prefix))
.map((file) => {
- const size = file.content.byteLength;
+ const size = file.content.length;
return {
Key: file.key,
ETag: 'etag',
diff --git a/packages/lambda/src/test/mocks/mock-store.ts b/packages/lambda/src/test/mocks/mock-store.ts
index ae49084675..5695da9e61 100644
--- a/packages/lambda/src/test/mocks/mock-store.ts
+++ b/packages/lambda/src/test/mocks/mock-store.ts
@@ -1,6 +1,6 @@
import type {CloudProvider} from '@remotion/serverless';
-import type {Privacy} from '@remotion/serverless/client';
-import {Readable} from 'stream';
+import {streamToString, type Privacy} from '@remotion/serverless/client';
+import type {Readable} from 'stream';
import type {BucketWithLocation} from '../../api/get-buckets';
import type {AwsProvider} from '../../functions/aws-implementation';
import type {AwsRegion} from '../../regions';
@@ -12,7 +12,7 @@ type S3MockFile<Provider extends CloudProvider> = {
region: Provider['region'];
acl: 'public-read' | 'private' | 'none';
key: string;
- content: Uint8Array;
+ content: string;
};
let mockS3Store: S3MockFile<AwsProvider>[] = [];
@@ -43,32 +43,6 @@ export const getS3FilesInBucket = ({
);
};
-function streamToUint8Array(
- obj: Readable | string | Uint8Array,
-): Promise<Uint8Array> {
- return new Promise<Uint8Array>((resolve, reject) => {
- if (obj instanceof Readable) {
- let data = Uint8Array.from([]);
-
- obj.on('data', (chunk) => {
- data = Uint8Array.from([...data, ...chunk]);
- });
-
- obj.on('end', () => {
- resolve(data);
- });
-
- obj.on('error', (err) => {
- reject(err);
- });
- } else if (typeof obj === 'string') {
- resolve(Uint8Array.from(Buffer.from(obj)));
- } else {
- resolve(obj);
- }
- });
-}
-
export const writeMockS3File = async ({
body,
privacy,
@@ -90,7 +64,12 @@ export const writeMockS3File = async ({
);
});
mockS3Store.push({
- content: await streamToUint8Array(body),
+ content:
+ typeof body === 'string'
+ ? body
+ : body instanceof Uint8Array
+ ? Buffer.from(body).toString()
+ : await streamToString(body),
acl:
privacy === 'no-acl'
? 'none'