简化Fabric-sdk-go的测试案例

Fabric-sdk-go文档表明的测试案例有:make unit-test、make integration-test。这些测试案例检查、配置环境耗费很长时间,而且每次测试都重复这些检查。对这些测试案例进行简化,加快测试进度。
1、简化unit-test
在Makefile中找到unit-test, 用#取消掉unit-test的依赖项。
在这里插入图片描述
执行make crypto-gen,根据cryptogen.yaml生成组织的数字证书。该文件的位置如下图。
在这里插入图片描述
在这里插入图片描述
执行make channel-config-gen,产生创世纪块、通道等环境。用到的配置文件是configtx.yaml。
在这里插入图片描述
执行make unit-test,略过诸多检查、配置,直接调用unit.sh脚本。
在这里插入图片描述
2、简化integration-test
在Makefile中找到integration-test, 用#取消掉integration-test的依赖项。
在这里插入图片描述
integration-test可以调用多个版本的集成测试,例如integration-tests-stable。在Makefile中找到integration-tests-stable, 用#取消掉integration-tests-stable的依赖项。
在这里插入图片描述
如果没有执行make crypto-gen和make channel-config-gen,则执行并产生环境和配置。
执行make integration-test,这时会略过很多检查、下载,进度加快。

在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_18807043/article/details/105652526