visual-regression-ci 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/package.json +1 -1
- package/src/server/importRuns.js +6 -4
package/README.md
CHANGED
|
@@ -226,7 +226,7 @@ npx visual-ci serve # review the results o
|
|
|
226
226
|
|
|
227
227
|
> **0.9.x is a pre-1.0 release.** It is complete and tested, but options and outputs may still change before 1.0.0. Pin the exact version (`npm i -D -E visual-regression-ci`) if you want no surprises.
|
|
228
228
|
|
|
229
|
-
`npx visual-ci ...` runs the copy installed in your project. In `package.json` scripts, plain `visual-ci ...` works too. Where visual-ci is **not** installed, use the exact version, e.g. `npx -y visual-regression-ci@0.9.
|
|
229
|
+
`npx visual-ci ...` runs the copy installed in your project. In `package.json` scripts, plain `visual-ci ...` works too. Where visual-ci is **not** installed, use the exact version, e.g. `npx -y visual-regression-ci@0.9.1 import ...` (that is what the pull request comment and the CLI's hints print): a bare `npx visual-ci` there would download whatever version is the newest on npm.
|
|
230
230
|
|
|
231
231
|
**The run database needs better-sqlite3**, a native module with prebuilt binaries for Linux (glibc and musl), macOS and Windows on x64 and arm64. If it can't be loaded (another platform, or a broken install), `visual-ci test` still runs and keeps its exit code: it warns once that the run won't appear in the dashboard, and `run.json` and the `--json` result are written as usual. `serve` and `import` need the database and exit with `2`, saying how to fix it: reinstall on a supported platform, or build it from source with `npm run build-release` inside `node_modules/better-sqlite3` (needs Python, make and a C++ compiler). `capture`, `install-browsers`, `--help` and `--version` don't load it (nor Playwright, except `capture`).
|
|
232
232
|
|
|
@@ -358,7 +358,7 @@ Schema `visual-ci-result`, version `1`. Future versions only add fields; existin
|
|
|
358
358
|
{
|
|
359
359
|
"schema": "visual-ci-result",
|
|
360
360
|
"version": 1,
|
|
361
|
-
"tool": { "name": "visual-ci", "version": "0.9.
|
|
361
|
+
"tool": { "name": "visual-ci", "version": "0.9.1" },
|
|
362
362
|
"command": "test",
|
|
363
363
|
"status": "failed",
|
|
364
364
|
"exit_code": 1,
|
|
@@ -491,7 +491,7 @@ When the visual check fails in GitHub Actions, review it in your own dashboard i
|
|
|
491
491
|
```bash
|
|
492
492
|
node src/cli/index.js import ~/Downloads/visual-regression-diffs.zip
|
|
493
493
|
# or, without a checkout or an install (visual-ci from npm, at the version that ran in CI):
|
|
494
|
-
npx -y visual-regression-ci@0.9.
|
|
494
|
+
npx -y visual-regression-ci@0.9.1 import ~/Downloads/visual-regression-diffs.zip
|
|
495
495
|
```
|
|
496
496
|
`-y` skips npx's "Ok to proceed?" question; the exact version (`@0.9.0`) makes npx run that release rather than whatever is newest (the first run downloads it and its dependencies). The pull request comment prints this command with the version the action used.
|
|
497
497
|
It prints each imported run with its dashboard link, e.g. `http://localhost:4000/runs/run_1732440000000` (using `PORT` if you set it), and the command that opens the dashboard, written for how you ran the import (`npx visual-ci serve` when visual-ci is installed in the project, the same `npx -y visual-regression-ci@<version>` command when run through npx, `node src/cli/index.js serve` in a checkout).
|
|
@@ -620,7 +620,7 @@ The repository is also a GitHub Action (`action.yml`). It runs `visual-ci test`
|
|
|
620
620
|
wait-on: http://127.0.0.1:3000/
|
|
621
621
|
```
|
|
622
622
|
|
|
623
|
-
> **Which version:** `@v0` is the newest 0.x release (it moves with each release: 0.9.0, 0.9.1, ...). `@v1` comes with version 1.0.0; until then use `@v0`. A full commit SHA (`@<40-character sha>`) pins the action's own code; an exact tag (`abhishek-k-33/Visual_Regression_Testing@v0.9.
|
|
623
|
+
> **Which version:** `@v0` is the newest 0.x release (it moves with each release: 0.9.0, 0.9.1, ...). `@v1` comes with version 1.0.0; until then use `@v0`. A full commit SHA (`@<40-character sha>`) pins the action's own code; an exact tag (`abhishek-k-33/Visual_Regression_Testing@v0.9.1`) pins it as long as nobody moves the tag. Neither pins the Docker image the action pulls: a tag in the registry can be pointed at another image. That is why the action checks the image before it runs it (see below), and why `image: build` exists, which always builds the image from the pinned code instead. `@main` runs the newest, unreleased code.
|
|
624
624
|
>
|
|
625
625
|
> **Faster from a release:** used as `@v0` (or an exact tag), the action pulls the published image `ghcr.io/abhishek-k-33/visual-ci:<version>` instead of building it, which saves about 45 s per job. It takes the image only if (1) it was built from exactly the same files as the action (a source hash in the image's label), so `@main` or a commit after a release builds its own image, as does `uses: ./` in this repository, and (2) its **build provenance attestation** verifies: `gh attestation verify` must show that this repository's `release.yml` built it from the tag `v<version>`. It then pulls and runs that exact digest (`ghcr.io/abhishek-k-33/visual-ci@sha256:...`), so the image checked is the image run. If any check fails (or `gh` is missing), it builds, and a notice says why. `image: build` always builds.
|
|
626
626
|
>
|
|
@@ -724,7 +724,7 @@ All paths are absolute paths on the runner. The outputs are set even when the jo
|
|
|
724
724
|
|
|
725
725
|
In every mode only the folder of **this** run is uploaded (`<storage>/runs/<run-id>`), and only if the result names it, it really lies inside the workspace (also once symlinks are resolved), it contains no symlinks, and it holds at least one file. Never the whole `storage/`. When the run stopped before its first screenshot (invalid config, image build failed, the first page could not load) there is nothing to upload, and the `artifact-*` outputs stay empty.
|
|
726
726
|
|
|
727
|
-
**Which artifacts can be imported:** a run that finished comparing (exit `0` or `1`) has `run.json` at the root of the zip, so the downloaded artifact imports as is: `npx -y visual-regression-ci@0.9.
|
|
727
|
+
**Which artifacts can be imported:** a run that finished comparing (exit `0` or `1`) has `run.json` at the root of the zip, so the downloaded artifact imports as is: `npx -y visual-regression-ci@0.9.1 import visual-regression-diffs.zip` (or `node src/cli/index.js import ...` from a checkout) or **Import CI run** in the dashboard (see [Review a CI Run Locally](#6-review-a-ci-run-locally-dashboard-upload-or-visual-ci-import)). An artifact from an **error run (exit `2`)** holds only the raw screenshots taken before the error, for debugging: it has no `run.json` and is **not importable** (the import refuses partial runs on purpose).
|
|
728
728
|
|
|
729
729
|
### Pull request comment
|
|
730
730
|
|
|
@@ -744,7 +744,7 @@ On `pull_request` events the action keeps **one comment** on the pull request wi
|
|
|
744
744
|
> Review it in your local dashboard:
|
|
745
745
|
>
|
|
746
746
|
> ```sh
|
|
747
|
-
> gh run download 4242 -R owner/repo -n 'visual-regression-diffs' -D vrt-4242 && npx -y visual-regression-ci@0.9.
|
|
747
|
+
> gh run download 4242 -R owner/repo -n 'visual-regression-diffs' -D vrt-4242 && npx -y visual-regression-ci@0.9.1 import vrt-4242
|
|
748
748
|
> ```
|
|
749
749
|
>
|
|
750
750
|
> <sub>visual-ci · commit `0637412` · updated 2026-11-26 10:41 UTC</sub>
|
|
@@ -790,11 +790,11 @@ On `pull_request` events the action keeps **one comment** on the pull request wi
|
|
|
790
790
|
|
|
791
791
|
Baselines are PNGs in `<working-directory>/storage/baselines/` (or your `storageDir`), committed to git. They must be rendered by **the same Docker image** the action uses, or fonts and anti-aliasing will differ. Two ways to create or update them:
|
|
792
792
|
|
|
793
|
-
- **Locally, with the image:** pull the published image of the version your workflow uses (or build it from this repository: `docker build -t visual-ci https://github.com/abhishek-k-33/Visual_Regression_Testing.git#v0.9.
|
|
793
|
+
- **Locally, with the image:** pull the published image of the version your workflow uses (or build it from this repository: `docker build -t visual-ci https://github.com/abhishek-k-33/Visual_Regression_Testing.git#v0.9.1`) and run it against your app from your project folder:
|
|
794
794
|
```bash
|
|
795
|
-
docker pull ghcr.io/abhishek-k-33/visual-ci:0.9.
|
|
795
|
+
docker pull ghcr.io/abhishek-k-33/visual-ci:0.9.1
|
|
796
796
|
docker run --rm --network host --user "$(id -u):$(id -g)" -e HOME=/tmp \
|
|
797
|
-
-v "$PWD:/work" -w /work ghcr.io/abhishek-k-33/visual-ci:0.9.
|
|
797
|
+
-v "$PWD:/work" -w /work ghcr.io/abhishek-k-33/visual-ci:0.9.1 \
|
|
798
798
|
node /app/src/cli/index.js test --update-baselines -u http://127.0.0.1:3000
|
|
799
799
|
git add storage/baselines && git commit -m "test: update visual baselines"
|
|
800
800
|
```
|
package/package.json
CHANGED
package/src/server/importRuns.js
CHANGED
|
@@ -649,13 +649,15 @@ function moveIntoRuns(out, finalDir, runsDir) {
|
|
|
649
649
|
} catch (err) {
|
|
650
650
|
if (err.code !== 'EXDEV') throw err;
|
|
651
651
|
}
|
|
652
|
+
// Copy into a new folder INSIDE the temp folder: copying onto the (existing) temp folder
|
|
653
|
+
// itself fails with EEXIST on Node.js 24 when errorOnExist is set.
|
|
652
654
|
const tmp = fs.mkdtempSync(path.join(runsDir, STAGING_PREFIX));
|
|
655
|
+
const copy = path.join(tmp, 'run');
|
|
653
656
|
try {
|
|
654
|
-
fs.cpSync(out,
|
|
655
|
-
fs.renameSync(
|
|
656
|
-
}
|
|
657
|
+
fs.cpSync(out, copy, { recursive: true, errorOnExist: true, force: false });
|
|
658
|
+
fs.renameSync(copy, finalDir);
|
|
659
|
+
} finally {
|
|
657
660
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
658
|
-
throw err;
|
|
659
661
|
}
|
|
660
662
|
}
|
|
661
663
|
|