lighthouse_如何为CI / CD设置自动Lighthouse测试

lighthouse

Lighthouse by Google has become increasingly more popular in recent years — even to the point where companies start seeing measurable increase in profit when their performance is improved.

近年来,Google的Lighthouse变得越来越流行-甚至当公司的业绩提高时,公司开始看到利润的可衡量的增长。

Some colleagues and I thought to ourselves — why not have a way for our developers to see how their projects perform in Lighthouse. Preferably we wanted the test to run in our CI environment Azure Pipelines. We set some goals for the project, and I went to work:

我和一些同事对自己进行了思考-为什么不让开发人员了解他们的项目在Lighthouse中的表现。 最好我们希望该测试在我们的CI环境Azure管道中运行。 我们为该项目设定了一些目标,然后我开始工作:

  1. A continuous measurement of several Lighthouse categories every time the code changes

    每次代码更改时,连续测量几个Lighthouse类别
  2. Each project should be able to define their own goals and have them measured

    每个项目都应该能够定义自己的目标并进行衡量
  3. The Lighthouse score should be tracked on a timeline to see the historic trends

    应该在时间轴上跟踪Lighthouse分数,以查看历史趋势

完美的工具 (The perfect tool)

The Google Chrome team already published a CLI for Node, that can run the tests, generate a report, and upload that report to a reporting server.

Google Chrome团队已经发布了NodeCLI ,该CLI可以运行测试,生成报告并将该报告上传到报告服务器

We did some research and found an extension to Azure Pipelines that wraps the CLI from Google, including an article explaining how to use it, and I discovered a Docker container wrapper for the Lighthouse CI reporting server. That was pretty much everything I needed.

我们进行了一些研究,发现了Azure Pipelines扩展,扩展包装了Google的CLI,其中包括一篇介绍如何使用 CLI 的文章 ,我发现 Lighthouse CI报告服务器的Docker容器包装 。 那几乎就是我需要的一切。

The architecture for the Azure Pipelines build could then look like this:

然后,Azure Pipelines构建的体系结构应如下所示:

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值