Skip to content

feat: added new helper function to allow debugging e2e tests#3836

Merged
mapno merged 5 commits intografana:mainfrom
javiermolinar:allow-debug-e2e-tests
Jul 4, 2024
Merged

feat: added new helper function to allow debugging e2e tests#3836
mapno merged 5 commits intografana:mainfrom
javiermolinar:allow-debug-e2e-tests

Conversation

@javiermolinar
Copy link
Copy Markdown
Contributor

What this PR does:

It can be handy to debug Tempo code when running an e2e test. This can be done in different ways. This PR aims to ease this task by providing a new function to spin a Tempo docker container based on the tempo-debug image, without modifying any aspect of the test so it can be run in the same way either locally or in the CI.

Limitations:
I haven't found a way to expose the docker host port locally ie: -p 2345:2345.
This could be enhanced to allow that:

https://github.com/grafana/e2e/blob/db90b84177fccb4f023ea9f71ec0e8dcd2d3bdad/service.go#L328

How to use it:
The debug process is a bit cumbersome right now:

  1. In our e2e test use the new function NewTempoAllInOnDebug to spin the debug container
  2. Set a breakpoint before the action we want to test
  3. Start debugging the tests and wait till the breakpoint
  4. Get the docker container endpoint, this can be done by running this:
docker ps --format '{{.Ports}}'  
0.0.0.0:53467->2345
  1. From a different instance of the IDE or directly from the console
 dlv connect localhost:53467

Checklist

  • [X ] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Copy Markdown
Contributor

@mapno mapno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to include the user guide in the /integration readme?

@javiermolinar javiermolinar requested a review from mapno July 4, 2024 08:59
Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
Contributor

@mapno mapno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mapno mapno enabled auto-merge (squash) July 4, 2024 13:55
@mapno mapno merged commit df5180d into grafana:main Jul 4, 2024
@javiermolinar javiermolinar deleted the allow-debug-e2e-tests branch July 16, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants