Skip to content

🎥 Make videos programmatically with React

delete more test artifacts

Jonny Burgerc0e63e47ccf5
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 bcc738cf78..6a8b33d303 100644
--- a/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts
+++ b/packages/it-tests/src/rendering/frame-accuracy-gif.test.ts
@@ -35,8 +35,6 @@ const getMissedFramesforCodec = async () => {
}
);
- console.log(outputPath);
-
await execa(
await RenderInternals.getExecutableBinary(null, process.cwd(), "ffmpeg"),
[
@@ -89,6 +87,8 @@ const getMissedFramesforCodec = async () => {
missedFrames++;
}
}
+
+ RenderInternals.deleteDirectory(outputDir);
return missedFrames;
};
diff --git a/packages/it-tests/src/rendering/frame-accuracy-video.test.ts b/packages/it-tests/src/rendering/frame-accuracy-video.test.ts
index 98634cdba2..3537de6ce9 100644
--- a/packages/it-tests/src/rendering/frame-accuracy-video.test.ts
+++ b/packages/it-tests/src/rendering/frame-accuracy-video.test.ts
@@ -80,6 +80,8 @@ const getMissedFramesforCodec = async () => {
missedFrames++;
}
}
+ RenderInternals.deleteDirectory(outputDir);
+
return missedFrames;
};
diff --git a/packages/it-tests/src/rendering/frame-accuracy.test.ts b/packages/it-tests/src/rendering/frame-accuracy.test.ts
index a0ccc1ffae..6554152188 100644
--- a/packages/it-tests/src/rendering/frame-accuracy.test.ts
+++ b/packages/it-tests/src/rendering/frame-accuracy.test.ts
@@ -5,6 +5,7 @@ import path from "path";
import sharp from "sharp";
import { random } from "remotion";
import { expect, test } from "vitest";
+import { RenderInternals } from "@remotion/renderer";
function selectColor(color: string, frame: number) {
return Math.floor((random(`${color}-${frame}`) * 255) % 255);
@@ -81,6 +82,8 @@ const getMissedFramesforCodec = async (
missedFrames++;
}
}
+ RenderInternals.deleteDirectory(outputPath);
+
return missedFrames;
};
diff --git a/packages/it-tests/src/ssr/render-frames.test.ts b/packages/it-tests/src/ssr/render-frames.test.ts
index faa4de0a5b..8458cc6940 100644
--- a/packages/it-tests/src/ssr/render-frames.test.ts
+++ b/packages/it-tests/src/ssr/render-frames.test.ts
@@ -63,5 +63,7 @@ test("Legacy SSR way of rendering videos should still work", async () => {
[outPath]
);
expect(probe.stderr).toMatch(/Video: h264/);
+
+ RenderInternals.deleteDirectory(framesDir);
await puppeteerInstance.close();
});
diff --git a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
index df8b710769..3d1954f154 100644
--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
@@ -94,10 +94,8 @@ test('Should make a transparent video', async () => {
});
// We create a temporary directory for storing the frames
- const out = path.join(
- await fs.promises.mkdtemp(path.join(os.tmpdir(), 'remotion-')),
- 'hithere.webm'
- );
+ const tmpdir = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'remotion-'));
+ const out = path.join(tmpdir, 'hithere.webm');
file.pipe(createWriteStream(out));
await new Promise<void>((resolve) => {
@@ -134,5 +132,6 @@ test('Should make a transparent video', async () => {
prefix: rendersPrefix(startRes.renderId),
});
+ RenderInternals.deleteDirectory(tmpdir);
expect(expectFiles.length).toBe(0);
});
diff --git a/packages/renderer/src/browser/Launcher.ts b/packages/renderer/src/browser/Launcher.ts
index 32d01f5f08..736da7ccea 100644
--- a/packages/renderer/src/browser/Launcher.ts
+++ b/packages/renderer/src/browser/Launcher.ts
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import * as fs from 'fs';
+import fs from 'fs';
import * as os from 'os';
import * as path from 'path';
@@ -22,8 +22,6 @@ import {Browser} from './Browser';
import {BrowserFetcher} from './BrowserFetcher';
import {BrowserRunner} from './BrowserRunner';
-const mkdtempAsync = fs.promises.mkdtemp;
-
import type {PuppeteerNodeLaunchOptions} from './LaunchOptions';
import type {Product} from './Product';
@@ -77,7 +75,7 @@ export class ChromeLauncher implements ProductLauncher {
// Check for the user data dir argument, which will always be set even
// with a custom directory specified via the userDataDir option.
- const userDataDir = await mkdtempAsync(
+ const userDataDir = await fs.promises.mkdtemp(
path.join(tmpDir(), 'puppeteer_dev_chrome_profile-')
);
chromeArguments.push(`--user-data-dir=${userDataDir}`);