Repository navigation
徽章和背景的测试不再做多余的事 - #343
Merged
Merged
徽章和背景的测试不再做多余的事#343
Conversation
机器一忙,这几个测试就超过 Vitest 的 5 秒,CI 和本地都碰到过。 - 读一个人的徽章不再顺带检查一遍:每次检查都要把 70 条规则全跑一遍,原来一个测试最多跑十遍,现在布置完跑一遍再读。收藏、层数的测试照文件里别的门槛测试,改成几个帖子对照,检查一遍就够。 - 背景测试的噪点动图只用两种颜色,生成快了四倍,转出的方形图仍有约 1MB,超过 800KB 的上限。
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.
机器一忙,徽章规则和背景的几个测试就超过 Vitest 的 5 秒:#341 第一次跑 CI 时有 3 个超时,本地负载高时也经常碰到。
改了什么(只改测试):
badges/rules.test.ts:读一个人的徽章不再顺带调checkBadges()。每次检查要把 70 条规则全跑一遍,「共建」原来跑 10 遍,「夜行鼠」跑 9 遍;现在布置完跑一遍再读。收藏、层数、精华的测试照文件里别的门槛测试,改成几个帖子对照,检查一遍就够。users/backgrounds.test.ts:噪点动图只用两种颜色,生成从约 670ms 降到约 170ms,转出的方形图仍有约 1MB,超过 800KB 的上限。验证:
pnpm check全部通过。