Skip to content

🎥 Make videos programmatically with React

cpu count

Jonny Burger2270e1dd14e5
diff --git a/packages/renderer/src/test/actual-concurrency.test.ts b/packages/renderer/src/test/actual-concurrency.test.ts
index 499f6a14a5..d359bf6b46 100644
--- a/packages/renderer/src/test/actual-concurrency.test.ts
+++ b/packages/renderer/src/test/actual-concurrency.test.ts
@@ -1,33 +1,27 @@
import {expect, test} from 'bun:test';
import {getActualConcurrency} from '../get-concurrency';
-import {getConcurrencyFromNProc} from '../get-cpu-count';
+import {getCpuCount} from '../get-cpu-count';
test('Actual concurrency null should choose a good result', () => {
expect(getActualConcurrency(null)).toBe(
- Math.round(
- Math.min(8, Math.max(1, (getConcurrencyFromNProc() as number) / 2)),
- ),
+ Math.round(Math.min(8, Math.max(1, (getCpuCount() as number) / 2))),
);
});
test('50% should yield half the cores', () => {
expect(getActualConcurrency('50%')).toBe(
- Math.floor(
- Math.min(8, Math.max(1, (getConcurrencyFromNProc() as number) / 2)),
- ),
+ Math.floor(Math.min(8, Math.max(1, (getCpuCount() as number) / 2))),
);
});
test('75% should be 3/4 of the cores', () => {
expect(getActualConcurrency('75%')).toBe(
- Math.floor((getConcurrencyFromNProc() as number) * 0.75),
+ Math.floor((getCpuCount() as number) * 0.75),
);
});
test('Slightly over 100% is ok as long as it is rounded', () => {
- expect(getActualConcurrency('100.2%')).toBe(
- getConcurrencyFromNProc() as number,
- );
+ expect(getActualConcurrency('100.2%')).toBe(getCpuCount() as number);
});
test('Should also accept integers', () => {
diff --git a/turbo.json b/turbo.json
index 1221a85b18..b03993b5f1 100644
--- a/turbo.json
+++ b/turbo.json
@@ -28,6 +28,20 @@
"dependsOn": ["^build", "build"],
"outputs": []
},
+ "@remotion/example#test": {
+ "dependsOn": ["^build", "build", "@remotion/it-tests#test"],
+ "outputs": []
+ },
+ "@remotion/renderer#test": {
+ "dependsOn": [
+ "^build",
+ "build",
+ "@remotion/lambda#build",
+ "@remotion/example#test",
+ "@remotion/cloudrun#build"
+ ],
+ "outputs": []
+ },
"lint": {
"dependsOn": ["//#ts-build"],
"outputs": []
@@ -45,7 +59,7 @@
"outputMode": "new-only"
},
"@remotion/cloudrun#build": {
- "dependsOn": ["^build"],
+ "dependsOn": ["^build", "//#ts-build"],
"outputs": [
"dist/shared/sa-permissions.json",
"container/dist/**",
@@ -58,6 +72,7 @@
"dependsOn": ["^build"],
"outputMode": "new-only"
},
+
"@remotion/it-tests#test": {
"dependsOn": [
"^build",