nmfs-fish-tools / ghactions4r

Reusable github actions workflows for R packages
https://nmfs-fish-tools.github.io/ghactions4r/
12 stars 1 forks source link

[Bug]: devtools::check() fails on codespace #80

Closed Bai-Li-NOAA closed 1 year ago

Bai-Li-NOAA commented 1 year ago

Describe the bug

devtools::check() fails when running it on codespace. See error message below. Need to install Pandoc to run R Markdown vignettes.

E  creating vignettes (2.7s)
   --- re-building ‘dependency_graph.Rmd’ using rmarkdown
   Error: processing vignette 'dependency_graph.Rmd' failed with diagnostics:
   Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
   --- failed re-building ‘dependency_graph.Rmd’

   SUMMARY: processing the following file failed:
     ‘dependency_graph.Rmd’

   Error: Vignette re-building failed.
   Execution halted
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'R' failed

To Reproduce

  1. Open codespace
  2. git checkout connect-deploy
  3. Open an R session and run devtools::check()

Expected behavior

devtools::check() passes

Screenshots

No response

Which OS are you seeing the problem on?

Linux

Which browser are you seeing the problem on?

Chrome

Which version of ghactions4r are you seeing the problem on?

commit id: 7ab8b9c80801f90cea541357e2c3d2f6b6c3f09a

Additional Context

Feel free to assign me the task.

k-doering-NOAA commented 1 year ago

THanks, I saw that too. I think we need to update to a more modern devcontainer config, e.g.,

https://github.com/NSAWTraining/RpkgsCodespace/blob/main/.devcontainer/devcontainer.json

k-doering-NOAA commented 1 year ago

@Bai-Li-NOAA does this branch's codespace config work with devtools::check()? If it looks good, I'll open a PR.

Bai-Li-NOAA commented 1 year ago

Do you mean the update-codespaces branch? I do not see the rmarkdown error anymore, but there is a testthat error. Maybe it will pass after merging into main?

[ FAIL 1 | WARN 0 | SKIP 0 | PASS 40 ]

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-use_r_workflows.R:99:1'): (code run outside of `test_that()`) ──
<usethis_error/error/condition>
Error: Path '/tmp/RtmpS3XbzS/file11a2219ad3a2/ghactions4r.Rcheck/tests/testthat/' does not appear to be inside a project or package.
Read more in the help for `proj_get()`.
Backtrace:
    ▆
 1. └─usethis::proj_set() at test-use_r_workflows.R:99:0
 2.   └─usethis::ui_stop("\n      Path {ui_path(path)} does not appear to be inside a project or package.\n      Read more in the help for {ui_code(\"proj_get()\")}.")

[ FAIL 1 | WARN 0 | SKIP 0 | PASS 40 ]
Error: Test failures
Execution halted
k-doering-NOAA commented 1 year ago

I did mean the update-codespaces branch, sorry for the very unclear message!

Hmm, ok. thanks for pointing out the testthat error! I'll try to fix it.

k-doering-NOAA commented 1 year ago

This error is interesting - I tried merging main into the branch on my codespace and it didn't fix the issue.

I also noticed that the test pasts when using devtools::test() so there is something different about how the tests are being run during devtools::check(). Not sure what the issue is still, unfortunately!

k-doering-NOAA commented 1 year ago

@Bai-Li-NOAA, I think I figured it out! Would you mind trying out the update-codespaces branch again to confirm?

Bai-Li-NOAA commented 1 year ago

@k-doering-NOAA Nice job! It works now.

k-doering-NOAA commented 1 year ago

Thanks, @Bai-Li-NOAA !