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

Continuous build support #15

Open
babuenir opened this issue Nov 19, 2014 · 8 comments
Open

Continuous build support #15

babuenir opened this issue Nov 19, 2014 · 8 comments

Comments

@babuenir
Copy link

I wish to contribute in continuous build support for Shaape using Travis CI.

@christiangoltz
Copy link
Owner

You are welcome to do so. Fork the repository, create your changes and make a pull request if you want to have your changes in the mainline repo.

Be aware that your code should be shaape specific, not travis ci specific and should not include intrusive changes into shaape just for make travis ci builds working. Normally continuous building of the project should not need any changes as you can use make and setup utils which can be called from all continuous build systems. Even the test case results can be exported as xunit, so that should be no problem too.

@babuenir
Copy link
Author

I have setup the Travis CI.
It is failing due to unavailability of 'Verdana' and 'Courier New' fonts.

This is the build log - https://travis-ci.org/babuenir/shaape/builds/41723811

Am I missing something while running the tests?

@babuenir
Copy link
Author

babuenir commented Dec 9, 2014

The font issues were installed. Now there are failures when comparing certain images. These are the failures while running the test in local machine also.

The build log - https://travis-ci.org/babuenir/shaape/builds/43172853

@christiangoltz
Copy link
Owner

The test results look quite good. The remaining errors are somewhat strange but I already encountered this on different machines. Depending on toolchain versions that are used for drawing the text and also depending on the exact font version, the images rendered during the unit tests may differ slightly.

You have 2 possibilities to continue:

  1. adapt the acceptable_rms value in utils.py to be higher than it is now. This will fix the errors and tell the test system that it is okay to deviate somehow more from the originally rendered images from my machine. However that will increase the probability of false-positive recognitions.
  2. you copy the images that the unit test creates under generated_images to the expected_images folder an commit them into your git branch. You can use the "cp ..." lines from the error message for that. I used to do this some times when I changed the way stuff looked and this is why these lines are already printed our there ready to be executed.

I personally would do the second option. Whatever way you chose, make sure that the images in the generated_images folder that the system complains about look decently okay, you can compare them side by side with the images in the expected_images folder that have the same names. If there are not matching at all or there are parts missing in the images, then there may be a different toolchain problem.

@christiangoltz
Copy link
Owner

By the way, something else, I saw you made travis ci install the ms ttf fonts to get rid of the error complaining about "Courier New" not being available. Instead of doing this, it would be more convenient to change the example that uses the font to use something more standard, which would be okay for me. The example is shaape/tests/input/feature_advanced_fonts.shaape and it references the Courier New font, if you change this reference to something that is available on a modern linux distribution by default, then I would pull in the change.

@babuenir
Copy link
Author

Actually the comparison fails due to deviations in the letter-width. I have compared the expected_images with that of generated_images in my machine. I have noticed that there are variations in the width of each letter in these images. Other than text content, the generated_images are matching expected_images.

And regarding the ms ttf fonts, I am working on the changes for referring more standard fonts, supported in modern linux distribution.

@babuenir
Copy link
Author

I have copied the generated images to expected images directory and the references to MS fonts are replaced with standard fonts from modern linux system. But there are still the same errors in Travis CI. I am having a Debian system where I see the tests passing.

@babuenir
Copy link
Author

Even if the generated images are copied to expected images, the tests machines are different any way. So anyway it will fail.

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

No branches or pull requests

2 participants