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

Fixing test issues and R4 fixes #42

Merged
merged 9 commits into from
Jul 15, 2020
Merged

Conversation

lazycipher
Copy link
Collaborator

@lazycipher lazycipher commented Jul 9, 2020

Fixed:

  • knitr import issue
  • removed redundant examples
  • use new grid::unitType() to determine unit type
  • stringsAsFactors=TRUE in Inf test

All tests passing on forked one: https://travis-ci.org/github/lazycipher/animint2

@lazycipher
Copy link
Collaborator Author

@tdhock, Can you check if GITHUB_PAT has correct input, please?

@tdhock
Copy link
Collaborator

tdhock commented Jul 9, 2020

that is great thanks @lazycipher !
glad to see that the diff is small (not many changes required to fix all those problems).
it is normal that the gist test fails using PRS from another user (that is why we try to keep all PRs under tdhock).
So do you want to merge this with tdhock:r4-fixes? and then you will merge it into master after that?
that is fine with me, go ahead.

@lazycipher
Copy link
Collaborator Author

Thank you!
I'll add a test for #40 and then we can merge this to tdhock:r4-fixes then to master.

@tdhock
Copy link
Collaborator

tdhock commented Jul 9, 2020 via email

@tdhock
Copy link
Collaborator

tdhock commented Jul 9, 2020

also make sure to update the NEWS/DESCRIPTION file with a new version number, and what you changed.

@lazycipher
Copy link
Collaborator Author

Okay! Sure thing!

@lazycipher
Copy link
Collaborator Author

@tdhock, Can we merge this with tdhock:r4-fixes?

@tdhock
Copy link
Collaborator

tdhock commented Jul 10, 2020

yes please merge.
also please can you re-write this wiki page https://github.com/tdhock/animint2/wiki/Testing describing your new methods for testing. what would I need to install? how to run the tests in firefox? how to run the tests in another headless browser? (is phantomjs still supported)

theme.pars <- plot_theme(viz)
panel_margin_lines <- pt.to.lines(theme.pars$panel.margin)

if(grid::unitType(theme.pars$panel.margin) == "pt" || grid::unitType(theme.pars$panel.margin) == "points") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do you need this if????
would be easier to understand (less repetitive) using %in% rather than ||,

if(something %in% c(val1, val2))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got you! I'll rectify it!

panel_margin_lines <- pt.to.lines(theme.pars$panel.margin)

if(grid::unitType(theme.pars$panel.margin) == "pt" || grid::unitType(theme.pars$panel.margin) == "points") {
test_that("after conversion values unequal", {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add a comment to explain why we want to values to be unequal after conversion? not easy to understand the context of where this test comes from ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure thing!

@lazycipher
Copy link
Collaborator Author

yes please merge.
also please can you re-write this wiki page https://github.com/tdhock/animint2/wiki/Testing describing your new methods for testing. what would I need to install? how to run the tests in firefox? how to run the tests in another headless browser? (is phantomjs still supported)

Sure thing! I'll update asap!

Comment on lines 17 to 28
#' Check if character is an RGB hexadecimal color value
#' @param x character
#' @return True/False value
#' @export
is.rgb <- function(x){
if(is.null(x)) {
TRUE
} else {
(grepl("#", x) & nchar(x)==7)
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

hey @lazycipher did you edit this is.rgb function at all? I dont see any changes. (did the line endings change or something?)
if there are no significant changes (white space etc) then please do NOT commit, because it makes it more difficult to code review.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made changes in the pt.to.lines function.
It looks like there's some issue with the line endings!
I really don't understand why whole file shows as edited while I do change just few lines.
Even on VS Code, It was showing 1 line change before committing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

you should always review the output of the "git diff" command before you do a "git commit" and make sure to remove any parts of the diff which are not relevant to the intended change you are trying to make.
In terms of editors I would recommend using Emacs for this project because there is good support for both R (via ESS) and JavaScript editing. Or try Rstudio if Emacs is too complicated for you to learn right now (but if you want to become a good programmer you should learn at least one of the two classic editors, emacs and vim)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll make sure to follow this up from now on. I'll use Emacs from now on for this project.

Copy link
Collaborator

Choose a reason for hiding this comment

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

here are some videos I made about emacs + ess https://www.youtube.com/playlist?list=PLwc48KSH3D1Onsed66FPLywMSIQmAhUYJ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you so much! I'll go through this.

@lazycipher
Copy link
Collaborator Author

lazycipher commented Jul 13, 2020

@tdhock, Can I go ahead to merge lazycipher:r4-fixes to tdhock:r4fixes?
Also please have a look on the testing wiki page and let me know the neede changes so that I can rectify asap.

@tdhock
Copy link
Collaborator

tdhock commented Jul 13, 2020

yes please merge.
wiki Tests page looks good so you use docker for firefox but not for phantomjs?
I see you recommend using VNC to see the firefox window, that is ok but I am wondering, shouldn't it be possible, and maybe simpler (at least on linux), to just have the firefox window pop up on your screen / x server? If you know of a way to do that, please add that to the docs (in addition to the VNC description which is helpful).
I agree that VNC is simpler on platforms like windows which do not run an x server by default.

@lazycipher
Copy link
Collaborator Author

Yes, I used docker for firefox because the needed firefox version and the latest firefox versions had too much difference. Any user who will already be a firefox user would've faced this version issues. So I thought it was best to do.
I didn't use docker for phantomjs because of the least chance of version issues. We're already using the latest version of phantomjs.
I haven't tried anything like that but I'll make sure to add this x server screen thing in docs asap.

@lazycipher lazycipher merged commit 14475cf into animint:r4-fixes Jul 15, 2020
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