Skip to content

Commit 07f5b3b

Browse files
committed
add debug docs
1 parent 9616d5c commit 07f5b3b

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [Configuration](./framework/configuration.md)
1818
- [Test Configuration](./framework/test_configuration_overrides.md)
1919
- [Exposing Components](framework/components/state.md)
20+
- [Debugging Tests](framework/components/debug.md)
2021
- [Components Cleanup](framework/components/cleanup.md)
2122
- [Components Caching](framework/components/caching.md)
2223
- [Mocking Services](framework/components/mocking.md)
@@ -28,7 +29,6 @@
2829
- [Logs](framework/observability/logs.md)
2930
- [Profiling](framework/observability/profiling.md)
3031
- [Traces]()
31-
- [Debugger]()
3232
- [Blockscout](framework/observability/blockscout.md)
3333
- [Components](framework/components/overview.md)
3434
- [Blockchains](framework/components/blockchains/overview.md)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Debugging Tests
2+
3+
All container logs are saved in a directory named `logs`, which will appear in the same directory where you ran the test after the test is completed.
4+
5+
For verifying your on-chain components, refer to the [Blockscout documentation](https://docs.blockscout.com/devs/verification/foundry-verification) on smart contract verification. This guide provides detailed instructions on uploading your ABI and verifying your contracts.
6+
7+
Use `CTF_LOG_LEVEL=trace|debug|info|warn` to debug the framework.
8+
9+
Use `RESTY_DEBUG=true` to debug any API calls.
10+
11+
Use `SETH_LOG_LEVEL=trace|debug|info|warn` to debug [Seth](../../libs/seth.md).
12+
13+
## Using Delve (TBD)
14+
15+
You can use [Delve]() inside your containers to debug aplications.
16+
17+
Build them with `go build -gcflags="all=-N -l" -o myapp` and use an example `Dockerfile`:
18+
```
19+
FROM golang:1.20
20+
21+
# Install Delve
22+
RUN go install github.com/go-delve/delve/cmd/dlv@latest
23+
24+
# Set working directory
25+
WORKDIR /app
26+
27+
# Copy the application binary and source code (if needed for debugging)
28+
COPY myapp /app/myapp
29+
COPY . /app
30+
31+
# Expose the port for Delve
32+
EXPOSE 40000
33+
34+
# Start Delve in headless mode for remote debugging
35+
ENTRYPOINT ["dlv", "exec", "./myapp", "--headless", "--listen=:40000", "--api-version=2", "--accept-multiclient"]
36+
37+
```
38+
39+
Adding `Delve` to all our components is WIP right now.
40+
41+
To expose `Delve` port follow this [guide](state.md).
42+
43+
44+

book/src/framework/observability/debugger.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

framework/.changeset/v0.2.11.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
- Save all containers logs by default
1+
- Save all containers logs by default
2+
- Add more docs about debug

0 commit comments

Comments
 (0)