Skip to Content
微服务与事件驱动架构
book

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
206
15
15.5
 事件驱动型微服务的集成测试
微服务集成测试有两种主要形式:
本地
集成测试和
远程
集成测试。本地集成测试指在生产
环境的本地化副本上执行的测试,远程集成测试指在本地系统外部的环境中执行的微服
务。这两种形式都有许多优点和缺点,稍后将对此进行探讨。
第三种形式是一种混合选项,其中微服务及其测试环境的某些部分在本地托管或执行,其
他部分在远程执行。由于技术上不可能评估这种混合模式的所有组合和排列,因此本书只
关注两种主要情况,如果有不同的需求,则由你自己决定。
在本章的剩余部分,你应该记住以下几个首要问题。
你希望从集成测试中得到什么?是不是验证“这个能运行吗”?抑或这是生产数据的冒
烟测试吗?还是有更多复杂的工作流需要测试和验证?
你的微服务是否需要支持从输入流时间的最开始位置重新启动,例如由于错误而导致的
数据完全丢失或再处理?如果是这样,那么为测试这个功能是否按预期工作,你需要知
道些什么?你可能还需要验证输入事件流是否能够支持此需求。
你需要什么数据来确定成功或失败?手动编制的事件数据是否足够?需要以编程方式创
建吗?需要真实的生产数据吗?如果是,需要多少?
你是否有任何性能、负载、吞吐量或伸缩方面的问题需要测试?
你将如何确保构建的每个微服务不需要一个完整的自建集成测试解决方案?
接下来的内容将有助于你了解一些可用的选项,以便对这些问题给出自己的答案。
15.6
 本地集成测试
本地集成测试允许进行大范围的功能性测试和非功能性测试。测试的形式是使用生产环境
的本地副本,其中微服务会部署在上面。这意味着至少要创建一个事件代理、 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

监控运维实践:原则与策略

监控运维实践:原则与策略

Mike Julian
Kafka权威指南

Kafka权威指南

Neha Narkhede, Gwen Shapira, Todd Palino
Web容量规划之美

Web容量规划之美

Arun Kejariwal, John Allspaw

Publisher Resources

ISBN: 9787115571106