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

More informative output when tests fail in summarize_system_checks #46

Open
annakrystalli opened this issue May 8, 2019 · 3 comments
Open
Labels

Comments

@annakrystalli
Copy link

Is your feature request related to a problem? Please describe.

When running:

ropsec::summarize_system_checks()
#> Registered S3 method overwritten by 'openssl':
#>   method      from
#>   print.bytes Rcpp
#> ✔ |  OK F W S | Context
#> |   0       | SSH Configuration - existence|   1       | SSH Configuration - existence
#> |   0       | SSH Configuration - keys|   2       | SSH Configuration - keys
#> |   0       | SSH Configuration - key size|   1       | SSH Configuration - key size
#> |   0       | GPG Existence|   1       | GPG Existence
#> |   0       | macOS requires password after sleep or screen saver kicks in|   0 1 1   | macOS requires password after sleep or screen saver kicks in
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> macos-simple-test.R:32: warning: macOS requires password after sleep or screen saver kicks in
#> running command 'defaults read com.apple.screensaver askForPassword' had status 1
#> 
#> macos-simple-test.R:33: failure: macOS requires password after sleep or screen saver kicks in
#> x == 1 isn't true.
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> |   0       | Firewall is enabled|   1       | Firewall is enabled
#> |   0       | Gatekeeper is enabled|   1       | Gatekeeper is enabled
#> |   0       | ~/.Rprofile permissions are sane (if ~/.Rprofile exists)
✖ |   0 1     | ~/.Rprofile permissions are sane (if ~/.Rprofile exists)
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> macos-simple-test.R:52: failure: ~/.Rprofile permissions are sane
#> ==... isn't true.
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> |   0       | ~/.Renviron permissions are sane (if ~/.Renviron exists)
✖ |   0 1     | ~/.Renviron permissions are sane (if ~/.Renviron exists)
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> macos-simple-test.R:59: failure: ~/.Renviron permissions are sane
#> ==... isn't true.
#> ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> 
#> ══ Results ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
#> Duration: 0.3 s
#> 
#> OK:       7
#> Failed:   3
#> Warnings: 1
#> Skipped:  0

Created on 2019-05-08 by the reprex package (v0.2.1)

both .Renviron and .Rprofile checks fail. However, the output of the test and documentation doesn't have much information on what the test failure means and what to do about it, at least for someone like me who is not very knowledgable on this stuff. By looking at the source code for the check I figured out it's something to do with file write permissions? But still not sure what the best approach to solve it is and why.

Describe the solution you'd like
A more informative message during test failure and potentially more detail in the function documentation on what to do to resolve identified issues. Importantly, it's a great opportunity to educate folks like me about the why of all this too.

Session info

sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Mojave 10.14.3
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] compiler_3.6.0  magrittr_1.5    tools_3.6.0     htmltools_0.3.6
#>  [5] yaml_2.2.0      Rcpp_1.0.1      stringi_1.4.3   rmarkdown_1.12 
#>  [9] highr_0.8       knitr_1.22      stringr_1.4.0   xfun_0.6       
#> [13] digest_0.6.18   evaluate_0.13

Created on 2019-05-08 by the reprex package (v0.2.1)

@czeildi czeildi added discussion 💬 system checks ✔️ check your local system settings labels May 19, 2019
@czeildi
Copy link
Owner

czeildi commented May 19, 2019

Thanks, great idea! For context, this functionality of the package is not planned yet at all, it is just some vague ideas (at least in my head). This means that potential contributing is not only about fixing bugs and implementing planned features but also figuring out what functionality would be useful, how to organise it into functions, creating solvable issues, etc. So any additional comment here with ideas would be very welcome.

@annakrystalli
Copy link
Author

Sure thing! A first suggestion (cc @maelle ) would be an action checklist output to the console for each failed test, much like the ones in usethis functions

@maelle
Copy link
Contributor

maelle commented May 22, 2019

Unrelated contribution: the new issue labels with emojis in this repo are awesome. 😍

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

No branches or pull requests

3 participants