Repository navigation
fetch 项:主体挪进 fetch-lib.ps1,补单测(有无批处理、LOCALAPPDATA 隔离) - #14
Merged
Merged
Conversation
Invoke-FetchItem 的命令行和批处理可以换成假的,tests\fetch-item.ps1 用它测:没有「补全组件.bat」的包只跑命令行,有的两遍都跑,不是组包目录、工作目录已经有了就一开始停;两遍跑的时候 LOCALAPPDATA 都指到工作目录里的空目录,跑完(出错也一样)换回原值,本机的 LOCALAPPDATA 一个文件都不变。 测试里「本机的」LOCALAPPDATA 也是临时目录造的,真的命令行、批处理换成一调就报错的,不跑任何程序。CI 加上这一步。 Refs ModAVD/ModAVD#45
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.
ModAVDE2E#13 让
fetch项在没有「补全组件.bat」的包(0.39 起,ModAVD/ModAVD#119)上只跑命令行,命令行和批处理两遍都把LOCALAPPDATA指到工作目录里的空目录。这两条当时只实跑过,没有单测。这个 PR 补上单测。改了什么
fetch项的主体挪进items\fetch-lib.ps1(Invoke-FetchItem),命令行和批处理可以换成假的;items\fetch.ps1只剩参数和守卫,行为不变。tests\fetch-item.ps1,CI(.github/workflows/check.yml)加一步跑它,别的步骤和权限不动。tests\tooling-guards.ps1查「两条语句并成一行」时,把fetch-lib.ps1里的函数也算上。测过什么
tests\fetch-item.ps1(152 项检查):命令行和批处理都换成假的,不跑程序、不联网;「本机的」LOCALAPPDATA 也是临时目录里造的,真的%LOCALAPPDATA%\ModAVD碰不到。核对的是:-Cache的)两个 zip,喂「y、回车」。-Keep时留着。tools\modavd.exe、核对时绕过假的去调真的命令行、喂错输入、不删工作目录、批处理那遍不放 zip、fetch.ps1不调Invoke-FetchItem。root-guards、tooling-guards、created-disk-usage、m9a-verdict、root-sdk、upgrade-version、qemu-ownership;所有.ps1、.psd1解析 0 错。-Cache用本地缓存的两个 zip,工作目录在临时目录,跑完删掉):tools\(ModAVDManager main 编的modavd.exe)和sdk\emulator两个文件的包(模拟 0.39,没有批处理):命令行 19 秒装好两样,再跑都跳过,批处理那遍跳过,pass。localappdata都是空的;本机%LOCALAPPDATA%\ModAVD的文件跑前跑后一样。Refs ModAVD/ModAVD#45