#how do you folks debug the engine ?
1 messages · Page 1 of 1 (latest)
@red relic we generally write an integration test which aims to repro the issue that were seeing. The dagger repo has plenty of integration tests where a dev engine is spawned to run the pipelines
thank you so much for taking the time on a holiday ... that clarifies a lot !
https://github.com/dagger/dagger/blob/main/core/integration/services_test.go#L1244
I am trying to start this ☝️ integration test using vscode. It looks like its defaulting to using the dagger engine from the downloaded cli at this line https://github.com/dagger/dagger/blob/main/sdk/go/internal/engineconn/engineconn.go#L60
still trying to figure how to make sure it uses an engine i am debugging. There might be additional env variables i have to set for this integration test to use an engine that is already running
i maybe have to set DAGGER_SESSION_PORT , and DAGGER_SESSION_TOKEN to point to an engine that is being debugged so i can stop where i want in the engine code
here is my vscode test configuration
{
"name": "engine-test",
"type": "go",
"request": "launch",
"mode": "test",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/bin/.env",
"program": "${workspaceFolder}/core/integration",
"args": [
"-test.run",
"TestServiceHostToContainer"
]
},
hey @red relic! if you check this test for example: https://github.com/dagger/dagger/blob/main/core/integration/engine_test.go#L133-L168, you'll see it uses the devEngineContainer function here: https://github.com/dagger/dagger/blob/main/core/integration/engine_test.go#L138