chore(test): Remove cloudflare-astro e2e test#18567
Conversation
| } | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
Bug: The function metricAttributeToSerializedMetricAttribute is removed but is still called within _buildSerializedMetric, which will cause a ReferenceError when metrics are captured.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The function metricAttributeToSerializedMetricAttribute is removed in this pull request, but a call to it remains within the _buildSerializedMetric function in the same file. When _INTERNAL_captureMetric() is called, it triggers _buildSerializedMetric, which then attempts to execute the non-existent function. This will lead to a ReferenceError: metricAttributeToSerializedMetricAttribute is not defined, causing a crash whenever metrics are captured. Additionally, the test file packages/core/test/lib/metrics/internal.test.ts still attempts to import and test this deleted function.
💡 Suggested Fix
Either restore the metricAttributeToSerializedMetricAttribute function if its removal was unintentional, or remove the call to it from the _buildSerializedMetric function and update the logic accordingly. The corresponding import and tests for the deleted function in packages/core/test/lib/metrics/internal.test.ts must also be removed.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: packages/core/src/metrics/internal.ts#L17
Potential issue: The function `metricAttributeToSerializedMetricAttribute` is removed in
this pull request, but a call to it remains within the `_buildSerializedMetric` function
in the same file. When `_INTERNAL_captureMetric()` is called, it triggers
`_buildSerializedMetric`, which then attempts to execute the non-existent function. This
will lead to a `ReferenceError: metricAttributeToSerializedMetricAttribute is not
defined`, causing a crash whenever metrics are captured. Additionally, the test file
`packages/core/test/lib/metrics/internal.test.ts` still attempts to import and test this
deleted function.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 7712917
|
|
||
| const MAX_METRIC_BUFFER_SIZE = 1000; | ||
|
|
||
| /** |
There was a problem hiding this comment.
Bug: Production function deleted but still referenced elsewhere
The PR claims to only remove the cloudflare-astro e2e test, but it also deletes the metricAttributeToSerializedMetricAttribute function from production code. This function is still called in _buildSerializedMetric (line 132), which will cause a build failure. This appears to be an unintended change that was accidentally included with the e2e test removal.
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
This removes a test that only asserted on successful deployment of a static cloudflare app. No actual tests. I don't think there's much value in this but it required a repo-specific env secret we can now get rid of.
(fwiw, long-term we definitely want cloudflare-deployed e2e tests but we'll likely need a better test setup anyway)
Closes #18568 (added automatically)