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

Improve image comparison in chart unit tests #317

Merged
merged 2 commits into from Jun 14, 2016
Merged

Improve image comparison in chart unit tests #317

merged 2 commits into from Jun 14, 2016

Conversation

serguei-actuate
Copy link
Contributor

Number of tests in /testsuites/org.eclipse.birt.report.tests.chart and /chart/org.eclipse.birt.chart.tests packages may fail on Linux due to actual-to-golden image (JPG, PNG, SVG) comparison is done using byte comparison. The files may look similar visually, but different internally. This is solved as:

  • New image comparison utility was implemented to compare image files by comparing average weighted brightness in corresponding blocks. It can also compare images of different sizes. Settings are parameterized. The default settings were confirmed to work in most tests. If the images are found to be different, a difference image is returned with blocks failed validation marked in red.
  • Updated failed regression and unit test cases to use the new image comparison where appropriate.
  • File comparison utility was updated to (optionally) ignore line breaks for comparing text files created on different platforms.

Signed-off-by: Serguei Krivtsov skrivtsov@actuate.com

Number of tests in /testsuites/org.eclipse.birt.report.tests.chart and
/chart/org.eclipse.birt.chart.tests packages may fail on Linux due to
actual-to-golden image (JPG, PNG, SVG) comparison is done using byte
comparison. The files may look similar visually, but different
internally. This is solved as:
* New image comparison utility was implemented to compare image files by
comparing average weighted brightness in corresponding blocks. It can
also compare images of different sizes. Settings are parameterized. The
default settings were confirmed to work in most tests. If the images are
found to be different, a difference image is returned with blocks failed
validation marked in red.
* Updated failed regression and unit test cases to use the new image
comparison where appropriate.
* File comparison utility was updated to (optionally) ignore line breaks
for comparing text files created on different platforms.

Signed-off-by: Serguei Krivtsov <skrivtsov@actuate.com>
Signed-off-by: Serguei Krivtsov <skrivtsov@actuate.com>
@yulinwang yulinwang merged commit e3cc14d into eclipse-birt:master Jun 14, 2016
bkiselka pushed a commit to bkiselka/birt that referenced this pull request Jun 12, 2019
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.

None yet

2 participants