ci(ticdc): add legacy safepoint integration tests#4661
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
I have already done a preliminary review for you, and I hope to help you do a better job.
Summary
This PR introduces integration tests for legacy safepoint functionality across different data pipelines (Kafka, MySQL, Pulsar, Storage) in the ticdc repository. The approach involves defining Jenkins pipeline configurations and Kubernetes pod templates for each integration test type, with corresponding presubmit job configurations added to the Prow job definitions. The code is well-structured and adheres to Jenkins DSL conventions, but there are areas for improvement in error handling, resource allocation, and testing coverage.
Critical Issues
None identified.
Code Improvements
-
Unnecessary duplication in pipeline definitions:
- The
pipeline.groovyfiles for each integration type (Kafka, MySQL, Pulsar, Storage) share significant portions of logic, such as binary preparation, workspace stashing, and testing steps. This duplication makes maintenance harder. - File(s): All
pipeline.groovyfiles. - Suggestion: Refactor common logic into shared helper methods or scripts. For example:
Call this method in each pipeline to avoid redundancy.
void prepareWorkspace(def refs) { prow.checkoutRefsWithCacheLock(refs, timeout = 5, credentialsId = 'github-sre-bot-ssh') cdc.prepareIntegrationTestCommonBinariesWithCacheLock(refs, 'ng-binary') }
- The
-
Hard-coded retry values:
- The retry count (e.g.,
retry(2)) is hardcoded in multiple places for artifact downloads and workspace preparation. - File(s): Multiple pipeline files.
- Why it's an issue: Hardcoding these values makes them harder to adjust globally if needed.
- Suggestion: Define retry counts as constants at the top of each file or in a shared library.
- The retry count (e.g.,
-
Resource allocation inconsistencies:
- Kubernetes pod templates specify varying CPU/memory limits across different jobs (
golangcontainer in Pulsar pipeline uses24Gi, while others use16Gi). - File(s):
pod.yamlfiles for Kafka, MySQL, Pulsar, and Storage pipelines. - Why it's an issue: It may lead to resource contention or inefficient resource usage.
- Suggestion: Standardize resource allocation across all pipelines unless explicitly required for specific integrations.
- Kubernetes pod templates specify varying CPU/memory limits across different jobs (
Best Practices
-
Missing comments for environment variables:
- Environment variables like
NEXT_GEN,LEGACY_SAFEPOINT, andOCI_TAG_*are defined but lack documentation explaining their purpose. - File(s): All
pipeline.groovyfiles. - Why it's an issue: Future developers may struggle to understand these variables' roles without context.
- Suggestion: Add comments explaining the purpose of each variable:
environment { NEXT_GEN = 1 // Enables next-gen features in integration tests. LEGACY_SAFEPOINT = 1 // Enables legacy safepoint functionality for testing. }
- Environment variables like
-
Testing coverage gaps:
- Integration tests rely on matrix configurations (
TEST_GROUPvalues), but there is no verification of whether all critical test cases are covered. - File(s): All
pipeline.groovyfiles. - Why it's an issue: Missing test cases could lead to untested edge cases.
- Suggestion: Add validation scripts or checks to ensure comprehensive test coverage. For example:
assert TEST_GROUP.values.containsAll(['G00', 'G01', 'G02', 'G03', 'G04']) : "Some test groups are missing!"
- Integration tests rely on matrix configurations (
-
Trigger patterns in Prow jobs:
- The trigger regex patterns for presubmit jobs are verbose and repetitive.
- File(s):
latest-presubmits-next-gen.yaml. - Why it's an issue: Regex patterns are prone to errors and hard to maintain.
- Suggestion: Use a standardized naming convention to simplify regex:
trigger: "(?m)^/test (?:.*? )?(pull-cdc-${JOB_NAME})(?: .*?)?$"
Suggested Follow-Up Actions
- Refactor duplicated code across pipeline files into shared libraries or functions.
- Standardize resource allocations in Kubernetes pod templates.
- Add detailed comments for environment variables and improve documentation for test groups.
- Validate test group coverage programmatically.
- Simplify Prow job regex patterns using a consistent naming convention.
|
@wk989898: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
No description provided.