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

[tests] Setup JS Visual Regression Testing #387

Merged

Conversation

apsdehal
Copy link
Contributor

  • Use jest-image-snapshot to generate and compare snapshots
  • Use puppeteer to launch chromium browser in headless mode
  • Use finalhandler and static-serve to finalize requests and serve
    static content easily
  • Update package.json with required packages and fix security audits

Motivation and Context

Visual Regression Testing is a good way to catch regressions in the code. In JS specifically, since we are rendering on browser side, things should be consistent. The PR aims to introduce first test that uses visual regression testing.

How Has This Been Tested

npm test

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

- Use jest-image-snapshot to generate and compare snapshots
- Use puppeteer to launch chromium browser in headless mode
- Use finalhandler and static-serve to finalize requests and serve
static content easily
- Update package.json with required packages
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Dec 18, 2019
Copy link
Contributor

@msbaines msbaines left a comment

Choose a reason for hiding this comment

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

One small nit.

await new Promise(resolve => server.close(resolve));
}

export async function generateImage(path) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this called?

Copy link
Collaborator

@mosra mosra left a comment

Choose a reason for hiding this comment

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

I'm afraid my JS knowledge is too minor to be able to provide any valuable feedback. Indentation looks okay, tho :D

await new Promise(resolve => server.close(resolve));
}

export async function generateImage(path) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Needed?

@codecov-io
Copy link

codecov-io commented Dec 20, 2019

Codecov Report

Merging #387 into master will increase coverage by 0.15%.
The diff coverage is 90.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #387      +/-   ##
==========================================
+ Coverage   53.86%   54.01%   +0.15%     
==========================================
  Files         164      165       +1     
  Lines        7719     7751      +32     
  Branches       82       84       +2     
==========================================
+ Hits         4158     4187      +29     
- Misses       3561     3564       +3
Flag Coverage Δ
#CPP 49.69% <ø> (ø) ⬆️
#JavaScript 10% <90.62%> (+4.46%) ⬆️
#Python 76.88% <ø> (ø) ⬆️
Impacted Files Coverage Δ
src/esp/bindings_js/tests/test_utils.js 90.62% <90.62%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21b18d1...3d6f016. Read the comment docs.

@apsdehal apsdehal merged commit 5f66335 into facebookresearch:master Dec 20, 2019
@apsdehal apsdehal deleted the regression_testing_js branch December 20, 2019 21:44
eundersander pushed a commit to eundersander/habitat-sim that referenced this pull request Aug 6, 2020
* added gibson large generation script

* ran black for formatting

* updated number of episodes, moved to ddppo directory

* updated license to include data generation

* added header

* changed const to upper case

* added separate function call

* Update README.md

Co-authored-by: dhruvbatra <dhruvbatra@users.noreply.github.com>

Co-authored-by: Santhosh K. Ramakrishnan <sramarki@fb.com>
Co-authored-by: dhruvbatra <dhruvbatra@users.noreply.github.com>
Ram81 pushed a commit to Ram81/habitat-web-sim that referenced this pull request Dec 10, 2020
- Use jest-image-snapshot to generate and compare snapshots
- Use puppeteer to launch chromium browser in headless mode
- Use finalhandler and static-serve to finalize requests and serve
static content easily
- Update package.json with required packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants