Repository navigation
ci: implement full client test matrix covering all compatible versions and modloaders - #401
Open
ZekerZhayard wants to merge 2 commits into
Open
ZekerZhayard wants to merge 2 commits into
ZekerZhayard wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
人写的:
看这大半年 AI 宣传得天花乱坠,本来以为 AI 能包办大部分代码了,结果不知道是我的提示词写得不好还是咋的,在浪费了一百块钱的 token 之后,还是回到了「先让 AI 拉一坨大的,然后人工屎上雕花」的开发模式上来。
在开发之前以为没什么难度的,只需要
写个启动器->把服务器开起来->让客户端进服->截图这么个流程就结束了,结果发现坑还不少,至少踩了以下的坑:com.mojang:patchy放进了 AppClassLoader 加载(因为 patchy 有单独的 log4j2 layout),但是把 patchy 依赖的com.mojang:blocklist放在了 KnotClassLoader 加载LP_NUM_THREADS为 0 或 1,尽管能降低发生的概率,然而仍无法完全避免),因此采用了卡死就重试(3 次以内)的原始方法--width和--height参数或者在 options.txt 里设定overrideWidth和overrideHeight也无法让部分版本的画面超出这个分辨率,导致 Tab 列表刚进服会被 "Chat message can't be verified" 挡住,所以采用了等 15 秒再截图的方案大肥鱼写的(单击展开):
概述
本 PR 为 CustomSkinLoader 引入完整的客户端自动化测试矩阵:在 PR / Beta 构建完成后,CI 会针对
build.info.json中列出的全部游戏版本(1.8 ~ 26.3),自动匹配可用的 Fabric / Forge / NeoForge / Quilt 加载器,启动真实服务端与客户端,验证皮肤与披风的加载及渲染结果。主要改动
CI 工作流
test.yml(workflow_call),由pull-request.yml与beta.yml在 build 之后调用。prepare作业在 windows-latest 上构建测试 installer 并生成测试矩阵;test作业最多 20 并发、fail-fast: false,单个版本失败不影响其他版本。CustomSkinLoader.log,并合并为all-test-diagnostics产物。矩阵生成与环境准备
Prepare-TestMatrix.ps1:从 Mojang version manifest、Fabric/Quilt meta、Forge/NeoForge Maven metadata 解析每个游戏版本可用的加载器及最新构建,输出version/json_url/json_sha1/loaders矩阵。Prepare-TestVersion.ps1:下载并 SHA-1 校验版本 JSON、Mojang 官方 Java 运行时与 Mesa3D 软件渲染;调用各加载器 installer(Forge 经测试 installer 驱动旧版 Swing GUI);解析inheritsFrom链并下载客户端/服务端/库/natives/资源/日志配置;为每个客户端生成自包含启动脚本(含 rules 求值、参数模板与 classpath 去重)。ExternalArgs.psd1:集中管理特定版本所需的 workaround(如 javaagent 与 Quilt 的 blocklist 依赖)。测试执行
Run-TestJob.ps1:启动本地服务端后依次启动客户端,通过日志标记('s profile loaded.等)判定皮肤加载成功;30 秒无输出视为卡死,失败自动重试最多 3 次;随后发送 F5 / Tab / F2 截图,覆盖第三人称皮肤与玩家列表头像渲染。测试侧代码(Test/)
customskinloader.test.installer.Main。options.txt、eula.txt、server.properties)。顺带修复
mapping.xml:PlayerTabOverlay的 SRG 类名按版本拆分——1.13.2 及以下为GuiPlayerTabOverlay,1.14.2 ~ 1.16.5 为PlayerTabOverlayGui。BytecodeRemapper:读取继承信息失败时捕获Exception而非仅IOException,避免非 IO 异常中断映射解析。Get-PublishInfo.ps1中冗余的产物存在性校验。验证方式
./gradlew.bat -p Test buildpull-request工作流会在 build 完成后自动运行全部版本矩阵;所有客户端应输出皮肤加载标记并成功生成截图。