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

fix R environment at Travis #230

Merged
merged 3 commits into from
Aug 23, 2018
Merged

fix R environment at Travis #230

merged 3 commits into from
Aug 23, 2018

Conversation

StrikerRUS
Copy link
Member

@StrikerRUS StrikerRUS commented Aug 22, 2018

While preparing #228 I've noticed that code coverage value was extremely small:
image

I've dig deeper and it turned out that all this time tests hadn't been run due to this function:

skip_test_if_no_module <- function(MODULE) { # MODULE is of type character string ( length(MODULE) >= 1 )

The reason was in that even after applying all my hotfixes in #208 scipy (or numpy) failed because of hard linking to conda's library, which conflicts with system-wide one. So, this PR solves this problem by installing PyPI versions of all packages.

While R CMD check is not verbose, but I needed any info why rgf module is not available, I managed to get useful logs by running Rscript -e 'testthat::test_dir("./tests")'.

In addition, even in this new clean environment and after improving the code coverage test_dir yields the following error/warning (I don't know what it is):

✔ | OK F W S | Context
Error in x[[method]](...) : attempt to apply non-function
Calls: <Anonymous> ... <Anonymous> -> o_apply -> lapply -> FUN -> <Anonymous>
══ Results ═════════════════════════════════════════════════════════════════════
OK:       0
Failed:   2
Warnings: 0
Skipped:  0
Execution halted
Warning: unknown option ‘--with-keep.parse.data’

My assumption is that RGF suffers from the following bug: r-lib/testthat#700 . Ping @mlampros for the future investigation.

@mlampros
Copy link
Collaborator

@StrikerRUS the attempt to apply non-function is a known issue when there is a problem with either the python configuration or when python packages are not installed properly. There are similar issues for packages that I ported from python like the fuzzywuzzyR package.

However, based on the web-link you've mentioned it seems that we should add

context("tests for RGF")

in the first line of the tests file so that this issue can be resolved.

@StrikerRUS
Copy link
Member Author

StrikerRUS commented Aug 22, 2018

Thank you for your prompt response, @mlampros !

Yeah, I've observed errors, that you've mentioned, before I switched to PyPI packages. With those errors the coverage was ~17% what indicates real problems.

However, the exact error message

Error in x[[method]](...) : attempt to apply non-function
Calls: <Anonymous> ... <Anonymous> -> o_apply -> lapply -> FUN -> <Anonymous>

didn't appeared in issue reports for your other packages and seems to be a different error. Also please note that the coverage is OK now with this PR. So, I'm a little bit confused... Have you ever got this error locally on your machine (by Rscript -e 'testthat::test_dir("./tests")', for instance)?

I tried to set contex as it suggested here but it didn't solve the issue. However, I think that context should be set anyway. Please create a PR for this.

@mlampros
Copy link
Collaborator

@StrikerRUS this error case is new to me. I don't know if it's related with the conda environment set-up. In all of my packages (Github repositories) I add the usual .travis.yml file. I don't know if the related testing documentation could be of any help here.
I'll open the PR as you suggested.

Copy link
Collaborator

@mlampros mlampros left a comment

Choose a reason for hiding this comment

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

I'll open a PR to address the error case : 'attempt to apply non-function

Copy link
Member

@fukatani fukatani left a comment

Choose a reason for hiding this comment

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

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants