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: keep look's pictures when the many-video-clips check fails (#16)

riverisbuilding261828ff8239
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 06fe40e..7d3e0fe 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -39,6 +39,16 @@ jobs:
- run: choco install ffmpeg --no-progress -y
if: runner.os == 'Windows'
- run: pnpm test
+ env:
+ # what a failing test keeps to be looked at (look's two pictures of a t that differed)
+ OPENFILM_TEST_ARTIFACTS: ${{ runner.temp }}/test-artifacts
+ - uses: actions/upload-artifact@v4
+ if: failure()
+ with:
+ name: test-artifacts-${{ matrix.os }}
+ path: ${{ runner.temp }}/test-artifacts
+ if-no-files-found: ignore
+ retention-days: 14
# what npm would get: the tarball of openfilm, listed in the log and checked (no tests, fixtures or dev files; the
# official product.json)
diff --git a/packages/openfilm/src/timeline.test.mjs b/packages/openfilm/src/timeline.test.mjs
index 65abf3e..442ee66 100644
--- a/packages/openfilm/src/timeline.test.mjs
+++ b/packages/openfilm/src/timeline.test.mjs
@@ -1,7 +1,7 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
-import { mkdtempSync, writeFileSync } from 'node:fs';
+import { cpSync, mkdtempSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { FilmPage, launch, serve } from './host.mjs';
@@ -344,6 +344,12 @@ test('look\'s check and a render of a film of many video clips: the same t draws
const dir = footage('of-lazy-look-');
writeFileSync(join(dir, 'film.html'), filmHtml(manyCuts()));
const r = await look([dir], { count: 8 });
+ /* a check that failed keeps what it drew for CI to upload: the two pictures of the t that differed */
+ if (r.ok === false && process.env.OPENFILM_TEST_ARTIFACTS) {
+ const kept = join(process.env.OPENFILM_TEST_ARTIFACTS, 'many-video-clips');
+ cpSync(join(dir, '.film/cache/look'), kept, { recursive: true });
+ writeFileSync(join(kept, 'look.txt'), `${r.lines.join('\n')}\n`);
+ }
assert.notEqual(r.ok, false, r.lines.join('\n'));
assert.match(r.lines.join('\n'), /same t, same picture/);
const { out } = await render([dir], { fps: 10, workers: 2, onProgress: () => {} });