如何对锯齿超级账本交易处理器进行单元测试 [英] How to unit test a sawtooth hyperledger transaction processor
问题描述
我很难弄清楚如何运行锯齿超级账本交易处理器的单元测试.我正在关注他们关于这个主题的文档:
I having hard time figuring out how to run the unit tests of a sawtooth hyperledger transaction processor. I am following their documentation on this topic:
https://sawtooth.hyperledger.org/docs/core/releases/1.0/app_developers_guide/testing.html
但是,它没有解释设置必要环境等和实际运行单元测试的操作方法.我尝试构建 docker compose 文件,该文件似乎试图构建和运行测试:
However, it does not explain the modus operandi of setting up the necessary environment, etc and actually running the unit tests. I have tried building the docker compose file which seemingly tries to build and run tests:
docker-compose -f sawtooth-core/sdk/examples/xo_python/tests/test_tp_xo_python.yaml up
docker-compose 文件似乎包含一些环境变量,例如
The docker-compose file seems to contain some environment vars such as
- $SAWTOOTH_CORE
- $INSTALL_TYPE
- $ISOLATION_ID
不确定需要为上述环境变量设置什么值,在我的情况下它失败了,因为它无法获取这些变量的值..
Not sure what value needs to be set to the above environment variables and in my case it fails because it fails to get the values for these vars..
有关如何为处理器运行测试的任何想法、指示或方向都会非常有帮助.
Any thoughts, pointers or direction on how to run the tests for the processor would be very helpful.
非常感谢!
推荐答案
您可以浏览 Sawtooth 核心存储库并找到值:https://github.com/hyperledger/sawtooth-core
You can poke around the Sawtooth core repo and find the values: https://github.com/hyperledger/sawtooth-core
SAWTOOTH_CORE
是您克隆锯齿核心 git 存储库的根目录(默认为您的当前目录)INSTALL_TYPE
是local
(可能还有其他值,但我不知道)ISOLATION_ID
是锯齿版.例如,1.1
.它用于标识要下载的 Docker 容器.
SAWTOOTH_CORE
is the root directory of where you cloned the sawtooth-core git repository (default is your current directory)INSTALL_TYPE
islocal
(there may be other values, but I do not know them)ISOLATION_ID
is the Sawtooth Version. For example,1.1
. It is used to identify the Docker container to download.
您可以通过 Docker 运行测试bin/run_tests
You can run the tests through Docker with
bin/run_tests
锯齿波测试目前使用 Jenkins CI 完成.从 Jenkinsfile
开始,看看测试是如何完成的.
Sawtooth testing is currently done with Jenkins CI. Start at Jenkinsfile
to see how testing is done.
这篇关于如何对锯齿超级账本交易处理器进行单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!