Skip to content

Commit

Permalink
update Makefile and others
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaJames95 committed Jun 28, 2023
1 parent 9df5cf0 commit 7ba79ee
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 33 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
53 changes: 26 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 文件。
```

0 comments on commit 7ba79ee

Please sign in to comment.