-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] update image diff framework and update to node 20 (#13944)
* update image diff framework * upload diffs * change to 0.1 per pixel * add simple reporter * needed changes to package * update lock * update package lock * force greenyellow as background image for transparency * remove commented code
- Loading branch information
Showing
25 changed files
with
7,060 additions
and
18,858 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { setupJestScreenshot } from "jest-screenshot"; | ||
setupJestScreenshot(); | ||
const { configureToMatchImageSnapshot } = require("jest-image-snapshot"); | ||
|
||
const toMatchImageSnapshot = configureToMatchImageSnapshot({}); | ||
expect.extend({ toMatchImageSnapshot }); | ||
jest.setTimeout(12000000); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
canvas { | ||
width: 100%; | ||
height: 100%; | ||
background: greenyellow !important; | ||
} | ||
|
||
#inspector { | ||
|
This file contains 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
Binary file modified
BIN
-868 Bytes
(97%)
packages/tools/tests/test/visualization/ReferenceImages/anisotropic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-42.2 KB
(91%)
packages/tools/tests/test/visualization/ReferenceImages/defaultPipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-20.7 KB
(78%)
...ols/tests/test/visualization/ReferenceImages/gltfMaterialMetallicRoughness0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-14.5 KB
(82%)
...ls/tests/test/visualization/ReferenceImages/gltfMaterialSpecularGlossiness0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-23.1 KB
(86%)
...s/tools/tests/test/visualization/ReferenceImages/gltfMeshPrimitiveAttribute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-42.3 KB
(91%)
...ools/tests/test/visualization/ReferenceImages/prepass-ssao-default-pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-29 KB
(83%)
packages/tools/tests/test/visualization/ReferenceImages/prepass-ssao-dof.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-17 KB
(92%)
...ages/tools/tests/test/visualization/ReferenceImages/prepass-ssao-glow-layer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-14.7 KB
(85%)
...tools/tests/test/visualization/ReferenceImages/prepass-ssao-instanced-bones.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-10.5 KB
(97%)
packages/tools/tests/test/visualization/ReferenceImages/prepass-ssao-lod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-23.2 KB
(78%)
packages/tools/tests/test/visualization/ReferenceImages/prepass-ssao-on-off-pp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-113 KB
(51%)
...ges/tools/tests/test/visualization/ReferenceImages/prepass-ssao-point-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.74 KB
(83%)
...ges/tools/tests/test/visualization/ReferenceImages/prepass-ssao-shadow-only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-14 KB
(95%)
.../tools/tests/test/visualization/ReferenceImages/prepass-ssao-thin-instances.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-8.82 KB
(77%)
...ages/tools/tests/test/visualization/ReferenceImages/prepass-ssao-visibility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.98 KB
(85%)
packages/tools/tests/test/visualization/ReferenceImages/shadowOnlyMaterial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-50.2 KB
(79%)
packages/tools/tests/test/visualization/ReferenceImages/webp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const DIFF_DIRECTORY = path.join(__dirname, "..", "jest-screenshot-report"); | ||
|
||
class ImageDiffReporter { | ||
/* istanbul ignore next - test coverage in child process */ | ||
onRunStart() { | ||
try { | ||
fs.statSync(DIFF_DIRECTORY); | ||
} catch (e) { | ||
fs.mkdirSync(DIFF_DIRECTORY, { recursive: true }); | ||
} | ||
|
||
// cleanup | ||
const files = fs.readdirSync(DIFF_DIRECTORY); | ||
|
||
if (files.length > 0) { | ||
files.forEach(function (filename) { | ||
if (fs.statSync(DIFF_DIRECTORY + "/" + filename).isDirectory()) { | ||
this.removeDir(DIFF_DIRECTORY + "/" + filename); | ||
} else { | ||
fs.unlinkSync(DIFF_DIRECTORY + "/" + filename); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
/* istanbul ignore next - test coverage in child process */ | ||
onRunComplete() { | ||
const files = fs.readdirSync(DIFF_DIRECTORY); | ||
const imagesHtml = files.map((file) => `<h3>${file.replace("-diff.png", "")}</h3><img src="./${file}" />`).join("\n"); | ||
// write index.html | ||
const html = ` | ||
<html> | ||
<head> | ||
<title>Diff reporter</title> | ||
</head> | ||
<body> | ||
<h1>Diff reporter</h1> | ||
${imagesHtml} | ||
</body> | ||
</html> | ||
`; | ||
fs.writeFileSync(path.join(DIFF_DIRECTORY, "index.html"), html); | ||
} | ||
} | ||
|
||
module.exports = ImageDiffReporter; |