Skip to content

The open source AI video agent: turns any coding agent into a video agent, with an editor to change anything it makes.

CI: ffmpeg on Windows installs or the step fails; two tests that broke CI runs (#43)

riverisbuildingc5819882d87f
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7d3e0fe..3be983f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -36,7 +36,16 @@ jobs:
if: runner.os == 'Linux'
- run: brew install ffmpeg
if: runner.os == 'macOS'
- - run: choco install ffmpeg --no-progress -y
+ # Chocolatey reports success when its feed times out and nothing is installed: tried three times, then the step
+ # fails if there is still no ffmpeg, instead of every test that needs it failing later
+ - run: |
+ for ($i = 1; $i -le 3 -and -not (Get-Command ffmpeg -ErrorAction SilentlyContinue); $i++) {
+ choco install ffmpeg --no-progress -y
+ if (-not (Get-Command ffmpeg -ErrorAction SilentlyContinue)) { Start-Sleep -Seconds (20 * $i) }
+ }
+ if (-not (Get-Command ffmpeg -ErrorAction SilentlyContinue)) { Write-Error 'ffmpeg did not install'; exit 1 }
+ ffmpeg -version | Select-Object -First 1
+ shell: pwsh
if: runner.os == 'Windows'
- run: pnpm test
env:
diff --git a/SECURITY.md b/SECURITY.md
index 7db6bbc..1c02c17 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -5,8 +5,9 @@ connect. It listens on 127.0.0.1 only, and answers the CLI and its own pages wit
## Reporting
-Please report a vulnerability privately to **[email protected]**, not in a public issue. Say what you found, how to
-reproduce it, and which version (`openfilm --version`). You will hear back within a few days, and we will tell you
+Please report a vulnerability privately, not in a public issue: on GitHub, under **Security → Report a
+vulnerability** in this repository, or by email to **[email protected]**. Say what you found, how to reproduce it,
+and which version (`openfilm --version`). You will hear back within a few days, and we will tell you
when a fix is released. We credit reporters who want to be named.
Supported: the latest release on npm.
diff --git a/packages/openfilm/studio/server/main.test.mjs b/packages/openfilm/studio/server/main.test.mjs
index 37be933..4cb9020 100644
--- a/packages/openfilm/studio/server/main.test.mjs
+++ b/packages/openfilm/studio/server/main.test.mjs
@@ -10,7 +10,19 @@ import { fileURLToPath } from 'node:url';
const MAIN = fileURLToPath(new URL('./main.mjs', import.meta.url));
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
-const freePort = () => new Promise((done) => { const s = createServer().listen(0, '127.0.0.1', () => { const { port } = /** @type {import('node:net').AddressInfo} */ (s.address()); s.close(() => done(port)); }); });
+/**
+ * A port free now, below every system's range for outgoing connections (Linux's starts at 32768, macOS's and Windows's
+ * at 49152): one the system picked from that range can be taken by another connection the moment it is let go.
+ */
+async function freePort() {
+ for (;;) {
+ const port = 20_000 + Math.floor(Math.random() * 12_000);
+ const free = await new Promise((done) => {
+ const s = createServer().once('error', () => done(false)).listen(port, '127.0.0.1', () => s.close(() => done(true)));
+ });
+ if (free) return port;
+ }
+}
/** run.json once it names a Studio that answers and `ok(run)` holds, within `ms`. */
async function until(home, ok, ms = 20_000) {
diff --git a/packages/openfilm/studio/server/stage.test.mjs b/packages/openfilm/studio/server/stage.test.mjs
index fee9c67..49f3561 100644
--- a/packages/openfilm/studio/server/stage.test.mjs
+++ b/packages/openfilm/studio/server/stage.test.mjs
@@ -20,9 +20,18 @@ async function stageOf(dir) {
const origin = `http://127.0.0.1:${server.address().port}`;
files = folderFiles(dir, { timelineInject: `<script>${HOST_FLAG}</script><script>${STAGE.replaceAll('__EDITOR__', JSON.stringify(origin))}</script>` });
const browser = await launch();
+ const close = async () => { await browser.close(); server.closeAllConnections?.(); server.close(); };
const page = await browser.newPage({ viewport: { width: 320, height: 180 } });
- await page.goto(`${origin}/film.html`);
- await page.evaluate(async () => { await window.film.ready; await window.film.frame(0.5); });
+ /* a setup that fails closes what it opened: a browser left open keeps the test file, and the run, from ending */
+ try {
+ await page.goto(`${origin}/film.html`);
+ /* window.film may not be there yet when the page has loaded */
+ await page.waitForFunction(() => Boolean(window.film));
+ await page.evaluate(async () => { await window.film.ready; await window.film.frame(0.5); });
+ } catch (e) {
+ await close();
+ throw e;
+ }
let seq = 0;
/** Ask the stage what the editor asks it. */
const ask = (op, args) => page.evaluate(({ op, args, seq }) => new Promise((done) => {
@@ -34,7 +43,7 @@ async function stageOf(dir) {
window.addEventListener('message', hear);
window.postMessage({ source: 'openfilm-studio', type: 'stage', seq, op, ...args }, '*');
}), { op, args, seq: ++seq });
- return { ask, close: async () => { await browser.close(); server.closeAllConnections?.(); server.close(); } };
+ return { ask, close };
}
test('a click on a page\'s backdrop (a box filling the page) takes the clip, not the box; a smaller box is taken', { timeout: 60_000 }, async () => {