Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jul 4, 2024

Conversation

javiermolinar
Copy link
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
Member

@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
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@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
14 checks passed
@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