Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add visual snapshots and comparison #104

Merged
merged 22 commits into from
Dec 7, 2023
Merged

Conversation

leanmendoza
Copy link
Collaborator

@leanmendoza leanmendoza commented Nov 23, 2023

This PR introduces a method in the ~system/Testing API to generate a visual snapshot of the Scene and compare it with the existing one (if it applies).
The current method for comparison is to compute the grayscale from the NTSC standard of each image (the stored snapshot and the just taken one), calculate the absolute difference, and then compute a standard deviation.
The similarity is 1.0, completely similar to 0.0, completely different.

branch test/snapshot
https://github.com/sdilauro/dae-unit-tests

@leanmendoza leanmendoza marked this pull request as draft November 23, 2023 18:27
@leanmendoza leanmendoza changed the title test: add visuial snapshot and comparison test: add visual snapshots and comparison Nov 23, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2023

Codecov Report

Attention: 261 lines in your changes are missing coverage. Please review.

Comparison is base (c854e25) 13.03% compared to head (e8495c7) 12.82%.

Files Patch % Lines
rust/decentraland-godot-lib/src/dcl/js/testing.rs 0.00% 83 Missing ⚠️
...raland-godot-lib/src/scene_runner/scene_manager.rs 0.00% 53 Missing ⚠️
...traland-godot-lib/src/test_runner/testing_tools.rs 4.54% 42 Missing ⚠️
...s/rpc_sender/take_and_compare_snapshot_response.rs 0.00% 20 Missing ⚠️
rust/decentraland-godot-lib/src/dcl/js/mod.rs 0.00% 19 Missing ⚠️
...lib/src/godot_classes/rpc_sender/dcl_rpc_sender.rs 9.52% 19 Missing ⚠️
...st/decentraland-godot-lib/src/godot_classes/mod.rs 0.00% 11 Missing ⚠️
...raland-godot-lib/src/scene_runner/rpc_calls/mod.rs 0.00% 9 Missing ⚠️
rust/decentraland-godot-lib/src/dcl/mod.rs 0.00% 3 Missing ⚠️
...t/decentraland-godot-lib/src/scene_runner/scene.rs 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
- Coverage   13.03%   12.82%   -0.22%     
==========================================
  Files         111      116       +5     
  Lines       13874    14149     +275     
==========================================
+ Hits         1808     1814       +6     
- Misses      12066    12335     +269     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robtfm
Copy link

robtfm commented Nov 24, 2023

looks good, although the path being user:// is unix-centric.

if we had user agent in engine info (or some other way to determine the client) we could have the screenshots as scene content.

@leanmendoza leanmendoza marked this pull request as ready for review December 6, 2023 12:10
Copy link
Member

@kuruk-mm kuruk-mm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, minor reviews

godot/src/logic/scene_fetcher.gd Show resolved Hide resolved
godot/src/logic/scene_fetcher.gd Show resolved Hide resolved
rust/decentraland-godot-lib/src/dcl/js/testing.rs Outdated Show resolved Hide resolved
add billboard BM_Y mode, BM_XY forward to ALL for now
fix raycast origin_offset, and tick_number
change FORCE_TEST_REALM to gh pages
fix warnings
@leanmendoza leanmendoza merged commit 278cefa into main Dec 7, 2023
3 checks passed
@leanmendoza leanmendoza deleted the test/add-snapshot branch December 7, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants