-
Notifications
You must be signed in to change notification settings - Fork 92
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
Transmit R session's LANG to the child process for the test runner #2488
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -533,7 +533,7 @@ | |
}, | ||
"positron": { | ||
"binaryDependencies": { | ||
"ark": "0.1.66" | ||
"ark": "0.1.67" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import * as path from 'path'; | |
import { spawn } from 'child_process'; | ||
import * as split2 from 'split2'; | ||
import { LOGGER } from '../extension'; | ||
import { checkInstalled } from '../session'; | ||
import { checkInstalled, getLocale } from '../session'; | ||
import { EXTENSION_ROOT_DIR } from '../constants'; | ||
import { ItemType, TestingTools, encodeNodeId } from './util-testing'; | ||
import { TestResult } from './reporter'; | ||
|
@@ -97,24 +97,20 @@ export async function runThatTest( | |
|
||
const wd = testingTools.packageRoot.fsPath; | ||
LOGGER.info(`Running devtools call in working directory ${wd}`); | ||
const locale = await getLocale(); | ||
LOGGER.info(`Locale info from active R session: ${JSON.stringify(locale, null, 2)}`); | ||
let hostFile = ''; | ||
// TODO @jennybc: if this code stays, figure this out | ||
// eslint-disable-next-line no-async-promise-executor | ||
return new Promise<string>(async (resolve, reject) => { | ||
// FIXME (@jennybc): once I can ask the current runtime for its LC_CTYPE (and possibly | ||
// other locale categories or even LANG), use something like this to make the child | ||
// process better match the runtime. Learned this from reprex's UTF-8 test which currently | ||
// fails in the test explorer because the reprex is being rendered in the C locale. | ||
// Also affects the tests for glue. | ||
// const childProcess = spawn(command, { | ||
// cwd: wd, | ||
// shell: true, | ||
// env: { | ||
// ...process.env, | ||
// LC_CTYPE: 'en_US.UTF-8' | ||
// } | ||
// }); | ||
const childProcess = spawn(command, { cwd: wd, shell: true }); | ||
const childProcess = spawn(command, { | ||
cwd: wd, | ||
shell: true, | ||
env: { | ||
...process.env, | ||
LANG: locale['LANG'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I originally thought I would set individual components, such as |
||
} | ||
}); | ||
let stdout = ''; | ||
const testStartDates = new WeakMap<vscode.TestItem, number>(); | ||
childProcess.stdout! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typical value for
locale
on macOS;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here's how it looks in my Windows VM:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, here is what I see: