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

Rework of many parts for speed and CI reporting #259

Merged
merged 46 commits into from
Aug 30, 2016
Merged

Rework of many parts for speed and CI reporting #259

merged 46 commits into from
Aug 30, 2016

Conversation

onigoetz
Copy link
Contributor

@onigoetz onigoetz commented Aug 18, 2016

Hello,

first, I'm really sorry for the size of this pull request I know it will be difficult to code review it. We made this changes in a single sprint at our company and couldn't afford to keep everything to separate branches because we needed to push it to our central Jenkins.

Highlights

  • Completely removed gulp, rely only on fs to move files around
  • Added a modal to show the images in big, with a slider to compare images in place.
  • The report doesn't need a server to be seen
  • To see the report, the files are copied in the project (previously the images were copied into Backstop)
  • Backstop relies on process.cwd() to generate its path, not ./node_modules/backstopjs
  • Add a --filter option to filter scenarii by label in test and reference

Variants

  • You can add "variants" to a scenario, they have the same options as a scenario, but are checked against the main scenario
  • no reference is created

Browser reporting

  • Removed resemblejs, use images generated by the CLI reporter. (we have more than 500 tests, running them in the browser just breaks the browser)
  • Copy the reporter files to the project.
  • The reporter required to disable the CSP rules of our Jenkins server, not longer the case
  • Added a way to toggle the summary of scenarii
  • Added a modal on click on reference or test image with a comparison slider
  • Tweaked the styles a bit
    • Removed custom "circles" to show the number of passed and failed tests : replaced with Bootstrap's "label" because with more than 100 tests, the circle is broken
    • Made a more compact "Report" section : removed analysisTime and dimensionDifference (if isSameDimensions is true)
    • Changed the font stack (there was a typo)

CLI Reporting

  • Reporting is always run in the CLI and results added to an object
  • You can easily add multiple new report types with this new object
  • junit report was moved to a separate code block to not clutter the main one

Internal changes

  • paths are made from the current working directory, not backstopjs.
  • removed the need for an internal hash of the configuration.
  • the list of comparisons to create is stored in a special temp file.
  • commands no longer have a before and after this makes the code very complicated to understand and can be replaced by promises inside the main execute
  • removed "start" and "stop" commands as the server is not needed anymore.

Bugfixes / Regressions

  • If the tests failed, the return code was still 0
  • You could not use a JavaScript configuration anymore
  • Errors in Promises were swallowed

Code Style

  • Replaced jshint/jscs with eslint
  • Linted with "semistandard"

Tests

  • Run tests on travis on more node versions (0.12, 4, 5, 6)

Stéphane Goetz and others added 17 commits August 13, 2016 10:19
…ages to backstop.

- Do not use resemble-js in the angular part, use images directly
- Store configuration hash separately
- move compare to a util
- create a Report utility to abstract the report writing.
- openReport doesn't copy files anymore
- remove unneeded utils
…ackstopJS into fix_js_config_loading

* 'fix_js_config_loading' of https://github.com/onigoetz/BackstopJS:
  Apply new configurations
Handle return code correctly
…placed "circle" with Bootstrap badges (circles didn't work with more than 100 tests)
if (lastIndex !== -1 && lastIndex === position) {
__dirname = arg.replace(fs.separator + 'genBitmaps.js', '');
}
});

Choose a reason for hiding this comment

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

this looks like duplicated code from 'echoFiles.js', maybe extract it to separate helper file?

@garris garris mentioned this pull request Aug 19, 2016
@garris garris closed this Aug 19, 2016
@onigoetz
Copy link
Contributor Author

I'm not sure that closing the pull request was you goal, or was it ? :)

@garris
Copy link
Owner

garris commented Aug 19, 2016

@onigoetz
Copy link
Contributor Author

Oh great, I didn't see that one.
But how will I be able to push more changes to it ? I have still some changes to make before this PR is completely ready for merge.

And what is your intention with the three branches version_2_0, version_2_0_onigoetz and version_2_0_pradet ?

My work being based on what Julien Pradet made in #241 I don't think this should be reviewed separately.

@garris
Copy link
Owner

garris commented Aug 19, 2016

Ok. It's merged now.

This is an epic PR! This is an overwhelmingly positive direction for BackstopJS. Thank you for the contribution!

Thanks for clarifying re: #241 -- Sorry I was having trouble deciding how to manage the PR. I guess I will leave 2_0 as is and wait till you are ready to have me pull the PR. In the meantime I am also tracking your public changes so I can test them locally. Sound good?

I am intrigued by scenario.variants.

Is it your intention to abandon change detection of the config?

I am already thinking about the various online resources and tutorials that need to be rewritten with this new, much cleaner interface.

@garris garris reopened this Aug 19, 2016
@onigoetz
Copy link
Contributor Author

I made a quick check to see if this PR fixes any issues that are already referenced here is the result:

Some PR's as well

And bonus ones

@onigoetz
Copy link
Contributor Author

By the way, the other people to credit for this work are : @borys-rudenko, @Ksushik and @dmitriyilchgmailcom

@onigoetz onigoetz changed the title [WIP] Rework of many parts for speed and CI reporting Rework of many parts for speed and CI reporting Aug 29, 2016
@onigoetz
Copy link
Contributor Author

Sooo, it seems we're finally there :D

We made all the changes we wanted and feel confident this pull request is robust and good to merge :D

Here is a small screenshot of the comparison modal:

capture d ecran 2016-08-29 a 18 23 48

@garris
Copy link
Owner

garris commented Aug 29, 2016

Super. I will check this out tonight. Thank you!

@garris garris merged commit 0ba2693 into garris:version_2_0 Aug 30, 2016
@garris
Copy link
Owner

garris commented Aug 30, 2016

Awesome -- thank you! I will be adding some readme info about the 2.0 version soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants