简体   繁体   中英

R ShinyTest GitHub Actions failing on Windows but passing on Mac and Ubuntu

My Shinytest tests are failing on Windows but passing on Mac and Ubuntu on my GitHub Actions CI. They pass locally just fine on both my Windows and my Mac PC.

This is my error:

-- FAILURE (test-app.R:9:3): all modules work ----------------------------------
Not all shinytest scripts passed for apps/selector_app: selector_test

Diff output:
==== selector_test ====
diff "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\RtmpWYO0Oy/working_dir\\RtmpqmGvu2\\shinytest-diff-690eb816c1/selector_test-expected/001.json" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\RtmpWYO0Oy/working_dir\\RtmpqmGvu2\\shinytest-diff-690eb816c1/selector_test-current/001.json"
1,12c1,12
< {

<   "input": {

<     "selector-procedure": "",

<     "selector-subject: ""

<   },

<   "output": {

<     "text": "You have selected subjectID    and procedure   ."

<   },

<   "export": {

< 

<   }

< }

---
> {
>   "input": {
>     "selector-procedure": "",
>     "selector-subject": ""
>   },
>   "output": {
>     "text": "You have selected subjectID    and procedure   ."
>   },
>   "export": {
> 
>   }
> }

I can't figure out what is different between according to the diff or why this would pass on Mac and Ubuntu but not on Windows?

This is probably because of how Windows handles newlines, which are encoded as \\r\\n rather than \\n as on Linux and MacOS. If you're reading in text output with readBin , use readLines instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM