Skip to content

Commit

Permalink
Add section for Debugging in VSCode
Browse files Browse the repository at this point in the history
Added a section to show how developers can debug the code using VSCode Go tools.
This will help devs to debug faster and more efficiently while stepping through the code.

Signed off by: Rishikesh Nair <[email protected]>
  • Loading branch information
rishinair11 authored Mar 11, 2023
1 parent f6d64c9 commit 26d9a19
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,33 @@ After the correct controller-gen version is installed. All future builds will w

After running this command, CLI will be available in `bin/kubectl-kuttl` and you can invoke the command for example like this `bin/kubectl-kuttl version` (no need to install it as `kubectl` plugin).

### Debugging in VSCode

Click Run > Add Configuration... to open the `launch.json` file. Add below configuration objects to specify the necessary sample tests and assertions in the `args[]`.

```json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "KUTTL Debug",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd/kubectl-kuttl/main.go",
"args": [
"test",
"sample",
"--config=${workspaceFolder}/cmd/kubectl-kuttl/<sample_tests_dir_to_run_with_kuttl>"
]
}
]
}
```

### Testing

Use `make all` to run all available tests.
Expand Down

0 comments on commit 26d9a19

Please sign in to comment.