Skip to content

Commit 5100333

Browse files
authored
docs: update test manual (#497)
1 parent 3152b86 commit 5100333

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

DEVELOPMENT.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ docker compose -f docker/test_base/docker-compose_tests.yml build
2525
```
2626

2727
This `ota-test_base` image contains a copy of pre-build minimum `ota-image` under `/ota-image` folder, and pre-installed dependencies needed for running and testing OTA client.
28+
`tester` in the following commands is the service name of the test base container, which is defined in the `docker-compose_tests.yml`(e.g. `tester-ubuntu-22.04`).
2829

2930
### Run all tests at once
3031

@@ -38,22 +39,30 @@ Directly execute pytest is also possible by override the command:
3839

3940
```bash
4041
docker compose -f docker/test_base/docker-compose_tests.yml run --rm tester \
41-
python3 -m pytest /ota-client/tests/<specific_test_file> [<test_file_2> [...]]
42+
tests/<specific_test_file> [<test_file_2> [...]]
4243
```
4344
4445
### Run specific tests manually by dropping to bash shell
4546
4647
Directly drop to bash shell in the test base container as follow:
4748
4849
```bash
49-
docker compose -f docker/test_base/docker-compose_tests.yml run --rm tester bash
50+
docker compose -f docker/test_base/docker-compose_tests.yml run --entrypoint bash --rm tester
5051
```
5152
52-
And then run specific tests as you want:
53+
And then run specific tests as you want after copying the source code to the container based on the `entry_point.sh`:
5354
5455
```bash
56+
# copy the source code to the container
57+
cp -r /otaclient_src /test_root
58+
# change the working directory to the test_root
59+
cd /test_root
60+
# create the hatch environment
61+
hatch env create dev
62+
# enter the hatch environment
63+
hatch shell dev
5564
# inside the container
56-
python3 -m pytest /ota-client/tests/<specific_test_file> [<test_file_2> [...]]
65+
python3 -m pytest tests/<specific_test_file> [<test_file_2> [...]]
5766
```
5867
5968
## How to update protobuf

0 commit comments

Comments
 (0)