Skip to content

Commit

Permalink
Add more information on testing for devs
Browse files Browse the repository at this point in the history
  • Loading branch information
olethanh committed Jun 20, 2024
1 parent 7b89523 commit c99d67e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,30 @@ hatch env create testing
```shell
hatch run testing:test
```


## Debugging the tests
Some tricks and options that might help debugging problematic tests.

Only launch pytest with a test name and more verbose debugging
```shell
hatch run testing:pytest -vv --log-level=DEBUG --full-trace -o log_cli=true -k <TEST NAME>
```


Specify `--capture=no` to pytest so it launch. This way you get the full output, including firecracker logs

## Debugging runtimes
If the error is in the runtime:
Modify the #! to pass the -v option to python, which will print all the debugging info
`#!/usr/bin/python3 -vOO`

To have these modification take effect you need to rebuild the runtime file using `create_disk_image.sh` as _root_

```shell
sudo bash create_disk_image.sh
```

Don't forget to have the print system log option set `ALEPH_VM_PRINT_SYSTEM_LOGS=1`

`aleph-debian-12-python` is used in test_create_execution

0 comments on commit c99d67e

Please sign in to comment.