test: add e2e test for OpenCensus to OpenTelemetry metrics migration#2811
test: add e2e test for OpenCensus to OpenTelemetry metrics migration#2811khrm wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new end-to-end test (test/metrics_otel_test.go) to verify the OpenCensus-to-OpenTelemetry metrics migration in Pipelines-as-Code by scraping the controller and watcher pods' metrics endpoints. The review feedback focuses on improving test robustness and efficiency: it recommends refactoring the metrics scraping helper to return errors instead of calling t.Fatalf (which would prematurely abort the test on transient errors during polling), reusing a single pre-initialized Kubernetes client across helper functions, and adding the necessary fmt import.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2811 +/- ##
=======================================
Coverage 60.12% 60.12%
=======================================
Files 210 210
Lines 21151 21151
=======================================
Hits 12716 12716
Misses 7642 7642
Partials 793 793 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
d4ec0f5 to
7c391cc
Compare
|
//gemini help |
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new E2E test file test/metrics_otel_test.go to verify the OpenCensus-to-OpenTelemetry metrics migration in Pipelines-as-Code by scraping and asserting metrics from the controller and watcher pods. The feedback recommends parameterizing the waitForPACMetric helper function with a labelSelector parameter. This allows reusing the helper to poll and wait for the watcher pod's metrics, resolving potential test flakiness caused by scraping the watcher metrics only once without retries.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
7c391cc to
16c8b75
Compare
|
|
||
| // ========== Infrastructure metric assertions (OTel renames) ========== | ||
|
|
||
| t.Run("Renames/k8s_client_uses_http_client_prefix", func(t *testing.T) { |
There was a problem hiding this comment.
plesae use testcase as per convention on this repo insteda of t.Run...
317d87a to
da6459d
Compare
da6459d to
3337cc1
Compare
402786c to
44bfe89
Compare
Adds TestOTelMetrics, a consolidated e2e test for the OC→OTel metrics migration in Pipelines-as-Code (PR tektoncd#2567). The test scrapes two pods: Controller (app.kubernetes.io/name=controller): - Asserts http_client_* metrics from knative k8s client OTel instrumentation - Asserts go_* runtime metrics - Checks PAC application metrics (pipelines_as_code_*) are absent/present - Asserts old OC metric names are absent Watcher (app.kubernetes.io/name=watcher): - Asserts kn_workqueue_* metrics (watcher uses knative reconciler) - Asserts go_* runtime metrics Verified locally with PAC controller and watcher deployed to kind via ko. Relates to tektoncd#2567 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
44bfe89 to
b6ca870
Compare
Adds TestOTelMetrics, a consolidated e2e test for the OC→OTel metrics migration in Pipelines-as-Code (PR #2567). The test scrapes two pods:
Controller (app.kubernetes.io/name=controller):
Watcher (app.kubernetes.io/name=watcher):
Verified locally with PAC controller and watcher deployed to kind via ko.
Relates to #2567
📝 Description of the Change
🔗 Linked GitHub Issue
Fixes #
🧪 Testing Strategy
🤖 AI Assistance
AI assistance can be used for various tasks, such as code generation,
documentation, or testing.
Please indicate whether you have used AI assistance
for this PR and provide details if applicable.
Important
Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message.For example:
Co-authored-by: Claude noreply@anthropic.com
✅ Submitter Checklist
fix:,feat:) matches the "Type of Change" I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.