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

Dealing with warnings in tests on Windows #1161

Closed
2 tasks done
IndrajeetPatil opened this issue Dec 3, 2023 · 4 comments · Fixed by #1169
Closed
2 tasks done

Dealing with warnings in tests on Windows #1161

IndrajeetPatil opened this issue Dec 3, 2023 · 4 comments · Fixed by #1169

Comments

@IndrajeetPatil
Copy link
Collaborator

IndrajeetPatil commented Dec 3, 2023

cf. https://github.com/r-lib/styler/actions/runs/7078474055/job/19263996467

══ Warnings ════════════════════════════════════════════════════════════════════
── Warning ('test-io.R:11:3'): non-ASCII characters are handled properly for file styling ──
using locale code page other than 65001 ("UTF-8") may cause problems
Backtrace:1. └─withr::with_locale(...) at test-io.R:11:3
 2.   └─withr::local_locale(new)
 3.     └─withr:::set_locale(cats)
 4.       └─base::mapply(Sys.setlocale, names(cats), cats)
 5.         └─base (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
── Warning ('test-parsing.R:21:3'): repreated parsing solves wrong parent assignment ──
'R -q -e "styler::cache_deactivate(); styler::style_file(\"C:\Users\RUNNER~1\AppData\Local\Temp\RtmpQnZB6B/working_dir\RtmpoJN3xq\styler161c67386af4/repeated_parsing-in.R\")"' execution failed with error code 1
Backtrace:1. └─styler:::calls_sys(...) at test-parsing.R:21:3
 2.   └─base::shell(sys_call, ...) at styler/R/utils.R:105:5

  • test-io.R
  • test-parsing.R
@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Dec 3, 2023

the wrong parent assignment bug was fixed long time ago and we don’t even support R versions that old with styler, so I guess the test can be deleted. Context; #187

@IndrajeetPatil
Copy link
Collaborator Author

I am not really sure how to get rid of this warning:

using locale code page other than 65001 ("UTF-8") may cause problems

Using the specified locale code instead leads to a different warning about the OS not honouring the requested locale.

@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Dec 7, 2023

A web search yields many (apparently relevant) results, e.g. also Rdatatable/data.table#5696. Maybe these can help?

@IndrajeetPatil
Copy link
Collaborator Author

Maybe these can help?

Only if suppressWarnings() is an option. That's what {data.table} seems to be doing 🙈

But maybe we can do the same thing. I agree with what Michael says in the PR you mentioned:

Probably we should just suppressWarnings() since this is in tests, any "problems" would be detected by a test failure. Alternatively, we might check if the "new" (4.2.0) Sys.setlanguage() will work for those tests.

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 a pull request may close this issue.

2 participants