test(go): run the suites without a Go toolchain and on Windows (#550)

Keep the program output test out of the Unix-only attribute it landed under,
skip the Go process tests when no toolchain is installed, and list Go variable
names and placeholder values as untranslated text instead of identical
translations.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-10-31 14:31:29 +08:00
1 джерело 1e8551ad0b
коміт 8f85f35ebe
4 files changed
+24 -19

No files matched your search

+2 -2
Переглянути файл
@@ -574,8 +574,6 @@ async fn connect_with_retries(
mod tests {
use super::*;
/// Managed tools win over `PATH`, and debugpy falls back to the private copy.
#[cfg(unix)]
#[tokio::test]
async fn program_output_is_forwarded_without_the_adapter_banner() {
let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel();
@@ -588,6 +586,8 @@ mod tests {
assert_eq!(sink.lock().len(), 3);
}
/// Managed tools win over `PATH`, and debugpy falls back to the private copy.
#[cfg(unix)]
#[tokio::test]
async fn managed_tools_and_private_debugpy() {
use std::os::unix::fs::PermissionsExt;
+8 -4
Переглянути файл
@@ -510,8 +510,10 @@ fn cmake_configure_discovers_builds_and_runs_a_multifile_target() {
#[test]
fn go_build_runs_with_separate_arguments_environment_and_working_directory() {
let h = harness();
let go =
ide_run::which::find_executable("go", &std::env::var_os("PATH").unwrap_or_default()).expect("Go toolchain");
let Some(go) = ide_run::which::find_executable("go", &std::env::var_os("PATH").unwrap_or_default()) else {
eprintln!("skipped: no Go toolchain");
return;
};
let module = h.root.path().join("module");
std::fs::create_dir_all(&module).unwrap();
std::fs::write(module.join("go.mod"), "module example.com/demo\ngo 1.22\n").unwrap();
@@ -550,8 +552,10 @@ fn go_build_runs_with_separate_arguments_environment_and_working_directory() {
#[test]
fn go_file_tests_use_build_selected_sources_and_only_the_selected_test_file() {
let h = harness();
let go =
ide_run::which::find_executable("go", &std::env::var_os("PATH").unwrap_or_default()).expect("Go toolchain");
let Some(go) = ide_run::which::find_executable("go", &std::env::var_os("PATH").unwrap_or_default()) else {
eprintln!("skipped: no Go toolchain");
return;
};
std::fs::write(h.root.path().join("go.mod"), "module example.com/filetests\ngo 1.22\n").unwrap();
std::fs::write(h.root.path().join("main.go"), "package filetests\nfunc value() int { return 2 }\n").unwrap();
std::fs::write(h.root.path().join("generate.go"), "//go:build ignore\n\npackage main\nfunc main() {}\n").unwrap();
-13
Переглянути файл
@@ -5269,7 +5269,6 @@
"Create Patch from Shelved Changes…": "从搁置更改创建补丁…",
"Build Tags": "构建标签",
"Go Version": "Go 版本",
"CGO": "CGO",
"Custom Tags": "自定义标签",
"Experiments": "实验功能",
"Open a project to configure Go build tags.": "打开项目以配置 Go 构建标签。",
@@ -5303,23 +5302,11 @@
"Module directory": "模块目录",
"Path relative to go.work, or an absolute directory containing go.mod": "相对于 go.work 的路径,或包含 go.mod 的目录的绝对路径",
"Reload External Libraries": "重新加载外部库",
"GOPROXY": "GOPROXY",
"GOPRIVATE": "GOPRIVATE",
"GOFLAGS": "GOFLAGS",
"GONOPROXY": "GONOPROXY",
"GONOSUMDB": "GONOSUMDB",
"GOSUMDB": "GOSUMDB",
"GOMODCACHE": "GOMODCACHE",
"GOTOOLCHAIN": "GOTOOLCHAIN",
"GOWORK": "GOWORK",
"Run Go Generate": "运行 Go Generate",
"Go Generate File": "为文件运行 Go Generate",
"Go Generate Package": "为包运行 Go Generate",
"Architecture": "架构",
"Compiler": "编译器",
"go1.22": "go1.22",
"integration debug": "integration debug",
"loopvar,rangefunc": "loopvar,rangefunc",
"No CMake executable target for this file": "此文件没有对应的 CMake 可执行目标",
"Run CMake Configure from the Run selector, then choose the executable target. Files in a CMake project are built with their target.": "请从运行选择器执行 CMake Configure,然后选择可执行目标。CMake 项目中的文件由所属目标构建,不会单独编译。"
}
+14
Переглянути файл
@@ -79,6 +79,20 @@ const BUILT_AT_RUNTIME = new Set<string>([]);
/** Text that stays as written in every locale: names, code, formats, shortcuts. */
const UNTRANSLATED = new Set<string>([
// Go environment variables and placeholder values
"CGO",
"GOPROXY",
"GOPRIVATE",
"GOFLAGS",
"GONOPROXY",
"GONOSUMDB",
"GOSUMDB",
"GOMODCACHE",
"GOTOOLCHAIN",
"GOWORK",
"go1.22",
"integration debug",
"loopvar,rangefunc",
// SSH and run-target placeholders
"SSH",
"example.com",