From 7ba79eea9df02918e3a0a31012641414f0f8fbef Mon Sep 17 00:00:00 2001 From: xueyanli Date: Wed, 28 Jun 2023 14:59:51 +0800 Subject: [PATCH] update Makefile and others --- .github/workflows/python-app.yml | 15 +++++---- Makefile | 16 ++++++++++ README.md | 53 ++++++++++++++++---------------- 3 files changed, 51 insertions(+), 33 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 392e35c..327ed5c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -28,15 +28,18 @@ jobs: python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest - run: | - pwd - python -m download - sh prepare.sh - python -m pytest - + - name: Install dependencies + run: make prepare + + - name: Run tests + run: make test + - name: Publish reports if: failure() uses: actions/upload-artifact@v2 with: name: jfoa-build-reports-${{ runner.os }} path: /home/runner/work/ckb-py-integration-test/ckb-py-integration-test/report + + - name: Cleanup + run: make clean \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..115896c --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +prepare: + python -m pip install --upgrade pip + pip install -r requirements.txt + echo "install ckb" + python -m download + echo "install ckb cli" + sh prepare.sh + +test: + python -m pytest + +clean: + rm -rf tmp + rm -rf download + rm -rf report + rm -rf source/ckb-cli \ No newline at end of file diff --git a/README.md b/README.md index 57dc717..abff415 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,31 @@ -## CKB Test - -### prepare -download ckb -```shell -pip install -r requirements.txt -python -m download -sh prepare.sh -``` -### run -run single test -```shell -python -m pytest test_cases/framework/test_01_node.py ``` +# ckb-py-integration-test -### debug -[pytest.ini](pytest.ini) add pytest debug log -```angular2html -addopts = -s -``` +ckb-py-integration-test 是一个使用 Python 进行集成测试的项目,目标是自动化 CKB 链上操作的测试。 + +## 依赖 + +此项目需要在系统上安装 Python 和 pip。此项目所需的 Python 库在 `requirements.txt` 中列出,可以通过运行以下命令来安装: + +make prepare + +这条 `prepare` 命令将执行以下操作: -### add new test -- test_cases/example/test_01_demo.py -- test_cases/example/test_02_fixture_demo.py +1. 安装在 `requirements.txt` 中列出的 Python 库。 +2. 下载并安装 ckb 二进制文件。 +3. 下载并安装 ckb-cli。 +此外,我们还提供了以下命令: -## todo -- ckb-cli support -- test with ckb build -- ckb rpc support -- ckb contract support -- etc.. +- 执行项目的测试: + + make test + +- 清理临时文件和其他生成的项目文件: + + make clean + +## 参与贡献 + +如果你想为此项目贡献代码,你可以 fork 这个仓库,创建特性分支,并向我们发送拉取请求(Pull Request)。有关详细信息,请查看 CONTRIBUTING.md 文件。 +```