Repository navigation
test: 单测不再读本机生产根目录 - #150
Merged
Merged
Conversation
TestMatchesProductionInstance compared against the installed mas_1 and broke once the bridge added hw.gltransport=asg; it now uses a 10-16 snapshot in a temp root. The real-adb tests no longer fall back to the installed root's adb.exe; they need MODAVD_TEST_SDK.
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.
改了什么
单测不再读本机的 ModAVD 根目录(
D:\ModAVD)。internal/avd的TestMatchesProductionInstance:原来只读打开本机根目录里的mas_1.ini、mas_1.avd\config.ini和mas-avd.json来比对。实例装过执行桥后多了hw.gltransport=asg,go test ./...因此失败;没有这台实例的机器上它又一直跳过。现在把 10-16 AUTO-MAS 建出来的那份mas_1写成测试里的快照,在临时目录里搭一个根目录再比,任何机器上都会跑。internal/adb的真 adb 测试:原来没设MODAVD_TEST_SDK时会退回去运行D:\ModAVD\sdk里的adb.exe。现在只认MODAVD_TEST_SDK,没设就跳过。其余
*_test.go里出现的D:\ModAVD都只是写进临时文件的字符串,不碰真实目录。测试
go vet ./internal/adb/ ./internal/avd/go test ./... -count=1(没设MODAVD_TEST_SDK):全部通过只改测试,不进安装包。