Skip to content

Commit

Permalink
Improve reference image regeneration workflow and fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mormahr committed Dec 3, 2022
1 parent be8833e commit 2ab8fdf
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,4 @@ Dockerfile
README.md
test-watch
update-dependencies-from-setup
update-test-data
regenerate-e2e-references
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ Desktop.

### Visual tests with reference images

`test-data` contains reference inputs `*.html` and corresponding outputs `*.png`.
A test suite will render the html files and will compare the output with the reference images to
ensure no changes slipped in.
`e2e/data` contains reference inputs `*.html` and corresponding output `.png`.
The e2e test will render the html files and compare the output with the reference images to ensure
no changes slipped in.

To update test-data or add new test cases run `./update-test-data`.
To update reference images or add new test cases run `./regenerate-e2e-references`.

[weasyprint]: https://weasyprint.org
[semver]: https://semver.org
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.regenerate-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.8"
services:
pdf:
build: .

regenerate:
build: e2e
links:
- "pdf:pdf"
volumes:
- "./e2e/data:/root/data"
- "./e2e/diffs:/root/diffs"
command: ./scripts/regenerate.sh
1 change: 0 additions & 1 deletion e2e/regenerate

This file was deleted.

1 change: 0 additions & 1 deletion e2e/run

This file was deleted.

3 changes: 3 additions & 0 deletions regenerate-e2e-references
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

docker-compose -f docker-compose.regenerate-e2e.yml up --build regenerate
3 changes: 0 additions & 3 deletions update-test-data

This file was deleted.

0 comments on commit 2ab8fdf

Please sign in to comment.