简体   繁体   English

如果消费者合同发生变化,如何自动触发生产者合同测试

[英]How to trigger producer contract test automatically if consumer contract changes

If the consumer makes a change which can break the contract test can only be identified if producer is also build but if we don't build the producer the wrong consumer will be released to production.如果消费者做出了可能违反合同的更改,则只能在生产者也构建时才能确定测试,但如果我们不构建生产者,错误的消费者将被释放到生产中。

Is there an approach which can be followed to overcome these type of scenarios.是否有可以遵循的方法来克服这些类型的场景。

Yes, there is definitely an approach!是的,绝对有办法! We go into length about this on our article how to build an effective Pact pipeline .我们 go 在我们的文章如何构建有效的 Pact 管道上长篇大论。

Some of the key tips described in the article:文章中描述的一些关键提示:

  • It is recommended to setup a Pact Broker ( https://github.com/pact-foundation/pact_broker/ ) or use a hosted service like pactflow.io to facilitate the contract exchange and CI/CD workflow建议设置一个 Pact Broker ( https://github.com/pact-foundation/pact_broker/ ) 或使用像pactflow.io这样的托管服务来促进合同交换和 CI/CD 工作流程
  • You should use can-i-deploy to prevent consumers/providers releasing a change that will break the integration您应该使用can-i-deploy来防止消费者/提供者发布会破坏集成的更改
  • You can use tags and pending pacts (relatively new feature) to manage the introduction of new contracts into the system safely.您可以使用标签待定协议(相对较新的功能)来管理将新合同安全地引入系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Pact - 合同测试 - 根据合同验证消费者和生产者 - Pact - contract testing - verify consumer and producer against contract 为什么消费者驱动的合同测试不起作用? - Why Consumer-driven Contract Test is not working? 契约使用者测试仅用于生成合同json文件吗? - Is pact consumer test for generating contract json files only? 消费者驱动的黄瓜合同测试 - Consumer driven contract testing with cucumber 如何在松露中测试具有多个帐户/地址的合同? - How to test contract with multiple accounts / addresses in truffle? 如何在不构建项目中的所有单元和合同测试的情况下生成和运行单个合同测试? Java Spring Cloud 合约验证器 - How to generate and run a single contract test without building all the unit and contract tests in the project? Java Spring Cloud Contract Verifier 消费者驱动的 C++ API 契约测试 - Consumer Driven Contract Tests for C++ APIs 如何为javascript / truffle中的每个测试创建新的以太坊/实体合约 - how to create new ethereum/solidity contract for each test in javascript/truffle 如何发送wei/eth到合约地址? (使用松露 javascript 测试) - How to send wei/eth to contract address? (using truffle javascript test) 在使用js的松露测试中,如何在`contract`之后设置参数? - In truffle test using js, how to set the parameters after the `contract `?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM