diff --git a/services/clsi/README.md b/services/clsi/README.md index e7edc98ad4..c566e34726 100644 --- a/services/clsi/README.md +++ b/services/clsi/README.md @@ -28,7 +28,7 @@ The CLSI can be configured through the following environment variables: - `LISTEN_ADDRESS` - The address for the RESTful service to listen on. Set to `0.0.0.0` to listen on all network interfaces - `PROCESS_LIFE_SPAN_LIMIT_MS` - Process life span limit in milliseconds - `SMOKE_TEST` - Whether to run smoke tests -- `TEXLIVE_IMAGE` - The TeX Live Docker image to use for sibling containers, e.g. `us-east1-docker.pkg.dev/overleaf-ops/ol-docker/texlive-full:2025.1` +- `TEXLIVE_IMAGE` - The TeX Live Docker image to use for sibling containers, e.g. `us-east1-docker.pkg.dev/overleaf-ops/ol-docker/texlive-full:2026.1` - `TEX_LIVE_IMAGE_NAME_OVERRIDE` - The name of the registry for the Docker image e.g. `us-east1-docker.pkg.dev/overleaf-ops/ol-docker` - `TEXLIVE_IMAGE_USER` - When using sibling containers, the user to run as in the TeX Live image. Defaults to `tex` - `TEXLIVE_OPENOUT_ANY` - Sets the `openout_any` environment variable for TeX Live (see the `\openout` primitive [documentation](http://tug.org/texinfohtml/web2c.html#tex-invocation)) diff --git a/services/clsi/test/acceptance/fixtures/examples/asymptote/output.pdf b/services/clsi/test/acceptance/fixtures/examples/asymptote/output.pdf index 193839eb6f..446a9643cd 100644 Binary files a/services/clsi/test/acceptance/fixtures/examples/asymptote/output.pdf and b/services/clsi/test/acceptance/fixtures/examples/asymptote/output.pdf differ diff --git a/services/clsi/test/acceptance/fixtures/examples/epstopdf/image-eps-converted-to.pdf b/services/clsi/test/acceptance/fixtures/examples/epstopdf/image-eps-converted-to.pdf deleted file mode 100644 index 7b92690ce1..0000000000 Binary files a/services/clsi/test/acceptance/fixtures/examples/epstopdf/image-eps-converted-to.pdf and /dev/null differ diff --git a/services/clsi/test/acceptance/fixtures/examples/epstopdf/output.pdf b/services/clsi/test/acceptance/fixtures/examples/epstopdf/output.pdf index 74641a9b23..1f8ac10a9a 100644 Binary files a/services/clsi/test/acceptance/fixtures/examples/epstopdf/output.pdf and b/services/clsi/test/acceptance/fixtures/examples/epstopdf/output.pdf differ diff --git a/services/clsi/test/acceptance/js/ExampleDocumentTests.js b/services/clsi/test/acceptance/js/ExampleDocumentTests.js index bfb3853c8a..90ca109d29 100644 --- a/services/clsi/test/acceptance/js/ExampleDocumentTests.js +++ b/services/clsi/test/acceptance/js/ExampleDocumentTests.js @@ -41,6 +41,13 @@ const convertToPng = function (pdfPath, pngPath) { }) } +// ImageMagick reports the mean absolute error as " ()". +// Identical images do not always yield an exact zero: aarch64 builds leave +// floating point residue behind, so comparing an image against a byte-identical +// copy of itself measures around 2e-20. A single differing pixel measures around +// 7e-07, so anything below this threshold is the same image. +const MAX_NORMALISED_MAE = 1e-12 + const compare = function (originalPath, generatedPath) { return new Promise((resolve, reject) => { const diffFile = `${fixturePath(generatedPath)}-diff.png` @@ -52,7 +59,12 @@ const compare = function (originalPath, generatedPath) { let stderr = '' proc.stderr.on('data', chunk => (stderr += chunk)) proc.on('exit', () => { - if (stderr.trim() === '0 (0)') { + // take the parenthesised value: "1.55242e-15 (2.36884e-20)" -> "2.36884e-20". + // a failed comparison (mismatched dimensions, missing file) does not match + // the metric format, leaving NaN, which fails the threshold check below + const match = stderr.trim().match(/\((?[^)]+)\)$/) + const normalisedMae = match ? parseFloat(match.groups.normalised) : NaN + if (normalisedMae <= MAX_NORMALISED_MAE) { // remove output diff if test matches expected image fs.unlink(diffFile, err => { if (err) {