Skip to content

Commit

Permalink
update Makefile and others (#8)
Browse files Browse the repository at this point in the history
* update Makefile and others

* update README.md

---------

Co-authored-by: xueyanli <[email protected]>
  • Loading branch information
15168316096 and nikaJames95 authored Jun 28, 2023
1 parent 1cbfa4f commit 1e541ff
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 32 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
57 changes: 31 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 1e541ff

Please sign in to comment.