test(docker): verify the built Docker image with testcontainers#852
Open
u1f992 wants to merge 1 commit into
Open
test(docker): verify the built Docker image with testcontainers#852u1f992 wants to merge 1 commit into
u1f992 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Docker イメージ(VIVLIOSTYLE_CLI_IMAGE)を対象に、Testcontainers + Vitest で “ビルド済みイメージの契約テスト” を実行できるようにし、GitHub Actions のイメージビルド後に検証を追加する PR です。Vivliostyle CLI の Docker リリース品質(動作・フォント・PDF生成・拡張性など)を CI で検知する狙いに沿った変更になっています。
Changes:
- Docker イメージ検証用の Vitest 設定と
pnpm test:dockerスクリプトを追加 - Testcontainers によるコンテナ起動・コマンド実行・GUI プレビュー描画検証・ゴールデン比較を行うテストを追加
- Actions のイメージビルドジョブに「pull → test:docker 実行」を追加し、fixture / 生成物(スクリーンショット)に合わせて ignore を調整
Reviewed changes
Copilot reviewed 7 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
vite.docker.config.ts |
Docker 検証テストのみを走らせる Vitest 設定を追加 |
tests/docker/image.test.ts |
Testcontainers を使った Docker イメージの契約テスト一式を追加 |
tests/docker/fixtures/render-matches-golden/Noto_Sans_JP/OFL.txt |
ゴールデン検証用フォント fixture のライセンスを追加 |
tests/docker/fixtures/render-matches-golden/needs-liberation.html |
ゴールデンレンダリング比較用の HTML fixture を追加 |
tests/docker/fixtures/build/manuscript.md |
vivliostyle build の最小 fixture を追加 |
package.json |
test:docker スクリプトと testcontainers(devDependency)を追加 |
pnpm-lock.yaml |
testcontainers 追加に伴う lock 更新 |
.gitignore |
fixture PDF の例外許可と docker テストのスクリーンショット出力の ignore を追加 |
.github/workflows/test.yml |
ビルドしたイメージを pull して pnpm test:docker を実行するステップを追加 |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
13a21a4 to
87e4f0c
Compare
92c535d to
e461252
Compare
This comment was marked as outdated.
This comment was marked as outdated.
u1f992
added a commit
that referenced
this pull request
Jul 3, 2026
The container verification this PR carried as build/image-contract.sh is superseded by the testcontainers-based suite (tests/docker-image.test.ts, PR #852). Remove the script and its fixtures, and point the derive-purge oracle at that suite: oracle.sh now runs `pnpm test:docker` against the candidate image and extracts failed test names from the Vitest summary. The fonts-liberation rationale that lived in the removed script's render-fidelity check is inlined into the Dockerfile comment.
Member
Author
|
42f5f3b vivliostyle/vivliostyle.js#2035 #859 を踏まえて、コンテナが特定のフォントを持つかは特にテストする必要がなくなります。 |
A vitest + testcontainers suite under tests/docker, run via `pnpm test:docker` and kept out of the default `pnpm test`, verifying an already-built Vivliostyle CLI image named by VIVLIOSTYLE_CLI_IMAGE: container config/identity, the CLI and npm/pnpm, fonts, headless builds + GUI preview across browsers, press-ready, and apt-based extension. Network-dependent checks run unconditionally and fail (not skip) on outage, so a transient problem cannot let a broken image pass. ci(docker): run the image tests against the built image build-and-push-image builds the image and pushes it to the local registry; pull it into the daemon and run `pnpm test:docker` against it (VIVLIOSTYLE_CLI_IMAGE=localhost:5000/vivliostyle/cli:latest) so the suite gates CI instead of only being runnable locally. test(docker): switch the extensibility probe to rename and drop the perl-base repair test(docker): add build and preview tests for a uid:gid missing from /etc/passwd test(docker): drop the bundled-font assertions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#793 の一部です。 #846 の上に積んでいます。コンテナイメージにテストを追加し、Actionsにも組み込むことで問題のあるリリースを防ごうとするものです。
時間がかかるため通常のテストには組み込んでおらず、環境変数
VIVLIOSTYLE_CLI_IMAGEをセットしたうえでpnpm run test:dockerで実行できます。