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

implement end-to-end-tests #21

Open
a-maldet opened this issue May 23, 2019 · 4 comments
Open

implement end-to-end-tests #21

a-maldet opened this issue May 23, 2019 · 4 comments
Assignees
Labels
CI continuous integration enhancement New feature or request

Comments

@a-maldet
Copy link
Contributor

It would be great to have End-To-End-Tests for the package.
The results could be compared by a image distance measurement in order to classify success or failure.

@a-maldet a-maldet added the enhancement New feature or request label May 23, 2019
@a-maldet a-maldet added this to the CRAN release milestone May 23, 2019
@GregorDeCillia
Copy link
Member

GregorDeCillia commented May 23, 2019

After some googling, these packages could be useful for measuring image similarity

It should be enough to test the outputs of write_png as a first step.

For xlsx files, we could go down the rabbit hole with the headless version of libreoffice. However, the headless testing can wait until after the CRAN release.

@GregorDeCillia
Copy link
Member

Seems like we can even make a bitwise comparison with png files. This doesn't work with pdf though.

library(styledTables)

st <- styled_table(mtcars)
write_png(st, "ex1.png")
write_png(st, "ex2.png")

tools::md5sum("ex1.png")
#>                            ex1.png 
#> "d6611369188488028b862cda981136ca"
tools::md5sum("ex2.png")
#>                            ex2.png 
#> "d6611369188488028b862cda981136ca"

Testing against hashes would be nice since

  • it avoids a repository bloat and
  • it doesn't create any additional dependencies.

On the other hand, this test is very strict and could lead to incorrect failures

@GregorDeCillia GregorDeCillia added the CI continuous integration label May 24, 2019
@GregorDeCillia GregorDeCillia self-assigned this May 24, 2019
@GregorDeCillia
Copy link
Member

Update: Bitwise comparison fails if the testing environment is not the same as the environment generating the checksums. I get different checksums for ubuntu 16.04 and ubuntu 18.04.

In other words, we need a similarity measure for png files in order to run the checks on travis.

@GregorDeCillia
Copy link
Member

I am not sure if it makes sense to put much effort into this for the CRAN release since it is currently not clear how they deal with the CTAN dependencies. Therefore, I'll remove the CRAN label for this issue for now. @a-maldet feel free to disagree.

@GregorDeCillia GregorDeCillia removed this from the CRAN release milestone Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI continuous integration enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants