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.
[English Template / 英文模板]
🤔 这个变动的性质是?
🔗 相关 Issue
#2140
💡 需求背景和解决方案
由于 vite 对 yarn workspace 支持并不好,再加上 L7 用了一些 rollup plugin,因此暂时仍然使用 dumi 做为开发服务器。
在 CI 截图测试开始前,启动该服务器,使用 Playwright 访问示例 URL 并截图,后续每次都和基准图片进行像素级 diff,确保渲染效果的稳定性。
添加一个新的测试用例步骤如下:
在
__tests__/e2e/tests.ts
中添加测试用例名称到 URL 的映射关系。由于目前 L7 使用的是 dumi,测试用例写在 tsx 中通过 md 引用,暂时没法像 G2、G6 使用的 vite 那样直接获取,因此需要手动维护:然后 dumi 示例中需要修改,CI 环境使用不带底图的 Map。这是由于高德地图每次渲染都会有微小差别(见下方评论):
同时如果有动画也需要根据
process.env.CI
决定是否禁用,否则截图也会不稳定。例如 citybuilding layer:CI 执行后,从 github workflow artifacts 上下载截图,作为后续的基准图片,可以参考这个 CI 任务:
https://github.com/antvis/L7/actions/runs/7217389172
最后从 CI 运行时间上看,由于目前测试用例较少,执行时间约 2min,主要还是安装依赖、构建以及启动 dumi 开发服务器时间较长。
📝 更新日志
☑️ 请求合并前的自查清单