Repository navigation
Conversation
internal/guest 的 *_sh_test.go(dldisk、gles32、installerx、libfix、playstore、quietnotifs、reswatch、vkmode)、 internal/emu 的 appproxy、bridge 和 game_import 里用真 sh 的几个测试,测的都是只在安卓客体里跑的脚本。 Windows 的 CI 上它们用 Git 自带的 sh,起子进程极慢(internal/guest 375 秒),Linux 和 macOS 的 portable 作业已经在跑同一批且很快。加 testutil.SkipGuestShellOnWindows,在这些测试开头跳过。 ci.yml:checks 作业不再把 Git 的 usr\bin 放进 PATH、不再设 MODAVD_REQUIRE_INSTALLERX_SH;这条「不许因缺工具而跳过」 的保护改到 portable 的 ubuntu 上。两处 setup-go 打开编译缓存(没有 go.sum,按 go.mod 作缓存键)。 Refs ModAVD/ModAVD#403
Collaborator
总体结论:可以合并以下仅供参考 这次省的是 Windows 上用 Git Shell 模拟安卓的时间,不是把安卓脚本的测试删掉。Ubuntu 仍会在 InstallerX 缺工具时直接失败,Windows 的纯 Go 路径和引号断言也没动。这个取舍 dot酱赞成,合并前等当前 Windows 作业跑完就好。 标题里的「打开 Go 编译缓存」可以删掉啦,实际配置还是 dot酱敬上 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
testutil.SkipGuestShellOnWindows,在 Windows 上跳过「用真 sh 跑客体脚本」的测试。用到的地方:internal/guest:dldisk、gles32、installerx、libfix、playstore、quietnotifs、reswatch、vkmode 的*_sh_test.go。internal/emu:appproxy、bridge 的*_sh_test.go,以及game_import*_test.go里用真 sh 的TestImportQuoteWithRealShell、TestRemoveStaleImportDirsOnDisk和posixShell辅助函数。ci.yml:actions/setup-go的cache仍是false:起初打开过,zizmor 判了缓存投毒风险(cache-poisoning),省的时间也只有半分钟到一分钟,已撤回。checks的go test不再把 Git 的usr\bin放进 PATH,也不再设MODAVD_REQUIRE_INSTALLERX_SH(Windows 上这些测试已跳过)。这条「不许因缺工具而跳过」的保护移到portable的 ubuntu 上继续生效。为什么
Windows 作业约 10 分钟,
go test ./...占约 7 分钟。其中internal/guest375 秒,原因是 CI 的 Windows 机器上exec.LookPath("sh")找到 Git 自带的 sh,起子进程极慢;macOS、Linux 的portable作业在跑同一批测试,而且快(guest 42 秒,Linux 同样很快)。跳过后本机(没有 sh)internal/guest为 0.75 秒。注意:
internal/emu在 CI 上 391 秒,但本机无 sh(这些测试本来就跳过)时它也要 358 秒,单个测试最长约 20 秒、超过 0.5 秒的有 130 多个,所以 emu 包的耗时主要不是 sh 造成的,这个 PR 对它预期收益很小,另开 PR 处理。测试
在
E:\private\tmp下的 worktree 里(GOCACHE指向本机缓存):go vet ./...:通过。go test ./...:全部 ok(internal/guest0.754 s,internal/emu357.9 s)。GOOS=linux GOARCH=amd64 go vet ./...、GOOS=darwin GOARCH=arm64 go vet ./...:通过。gofmt -l .:无输出。不涉及实例,没有上机测试。没有加
changelog.d(只动测试和 CI)。Refs ModAVD/ModAVD#403