From 1e541fff7b9dcad4ce15a0987b2dd8656e255582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?iu=E5=B0=8F=E8=BF=B7=E5=BC=9F?= <45781590+15168316096@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:49:22 +0800 Subject: [PATCH] update Makefile and others (#8) * update Makefile and others * update README.md --------- Co-authored-by: xueyanli --- .github/workflows/python-app.yml | 15 +++++---- Makefile | 16 +++++++++ README.md | 57 +++++++++++++++++--------------- 3 files changed, 56 insertions(+), 32 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..379f548 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,37 @@ -## 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 + +ckb-py-integration-test is a project that uses Python for integrated testing. The goal is to automate the testing of operations on the CKB chain. + +## Dependencies + +This project requires Python and pip to be installed on your system. The Python libraries needed for this project are listed in `requirements.txt`. You can install them by running the following command: + +make prepare + +This `prepare` command will perform the following operations: + +1. Install the Python libraries listed in `requirements.txt`. +2. Download and install the ckb binary. +3. Download and install the ckb-cli. + +In addition, we also provide the following commands: + +- To run the tests for the project: + + make test + +- To clean up temporary files and other generated project files: + + make clean + +## Debugging + +You can add debug logging for pytest by modifying the [pytest.ini](pytest.ini) file: -### debug -[pytest.ini](pytest.ini) add pytest debug log ```angular2html addopts = -s ``` -### add new test -- test_cases/example/test_01_demo.py -- test_cases/example/test_02_fixture_demo.py - +## Contributing -## todo -- ckb-cli support -- test with ckb build -- ckb rpc support -- ckb contract support -- etc.. +If you want to contribute to this project, you can fork this repository, create a feature branch, and send us a Pull Request. For more information, please see the CONTRIBUTING.md file. \ No newline at end of file