Skip to content

convert libbeat system pprof tests to go#49505

Merged
leehinman merged 1 commit intoelastic:mainfrom
leehinman:48850_convert_libbeat_http_pprof_tests_to_go
Mar 17, 2026
Merged

convert libbeat system pprof tests to go#49505
leehinman merged 1 commit intoelastic:mainfrom
leehinman:48850_convert_libbeat_http_pprof_tests_to_go

Conversation

@leehinman
Copy link
Contributor

Proposed commit message

  • Converts the Python system tests in libbeat/tests/system/test_http_pprof.py to Go integration tests in libbeat/tests/integration/pprof_test.go
  • Deletes the original Python test file
  • New tests follow the established patterns in libbeat/tests/integration/http_test.go using the BeatProc framework

The following test cases are preserved 1:1 from the Python originals:

Test Endpoint Expected
TestHttpPProfIndex GET /debug/pprof/ 200
TestHttpPProfCmdline GET /debug/pprof/cmdline 200
TestHttpPProfNotFound GET /debug/pprof/not-exist 404

This will eventually allow us to remove Python from test env.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

None. Test code

Author's Checklist

How to test this PR locally

cd libbeat
mage goIntegTest

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 16, 2026
@github-actions
Copy link
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@leehinman leehinman added backport-skip Skip notification from the automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team skip-changelog and removed needs_team Indicates that the issue/PR needs a Team:* label labels Mar 16, 2026
@leehinman leehinman marked this pull request as ready for review March 17, 2026 01:52
@leehinman leehinman requested a review from a team as a code owner March 17, 2026 01:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 730bb517-63bd-4457-bbdc-f0563b76be41

📥 Commits

Reviewing files that changed from the base of the PR and between 882c812 and 9012903.

📒 Files selected for processing (2)
  • libbeat/tests/integration/pprof_test.go
  • libbeat/tests/system/test_http_pprof.py
💤 Files with no reviewable changes (1)
  • libbeat/tests/system/test_http_pprof.py

📝 Walkthrough

Walkthrough

The pull request migrates HTTP pprof endpoint tests from a Python-based system test to Go-based integration tests. The Python system test file is removed, and a new Go integration test file is added with three tests that verify pprof endpoint behavior: testing successful responses on /debug/pprof/ and /debug/pprof/cmdline endpoints, and verifying 404 responses for non-existent endpoints. Both old and new tests follow the same validation approach with mockbeat instance startup and HTTP status code assertions.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use your project's `golangci-lint` configuration to improve the quality of Go code reviews.

Add a configuration file to your project to customize how CodeRabbit runs golangci-lint.

Copy link
Contributor

@orestisfl orestisfl left a comment

Choose a reason for hiding this comment

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

Fine to merge as is but all three tests could be merged into one test with 3 subtests and share the same mockbeat process.

@leehinman leehinman merged commit e9a3df1 into elastic:main Mar 17, 2026
214 of 215 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip Skip notification from the automated backport with mergify skip-changelog Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants