Skip to content

tests: Add make-mirror test implementation - #20908

Open
ronaldngounou wants to merge 1 commit into
etcd-io:mainfrom
ronaldngounou:ronald/ctl_v3_make_mirror_test_clean
Open

tests: Add make-mirror test implementation#20908
ronaldngounou wants to merge 1 commit into
etcd-io:mainfrom
ronaldngounou:ronald/ctl_v3_make_mirror_test_clean

Conversation

@ronaldngounou

@ronaldngounou ronaldngounou commented Nov 8, 2025

Copy link
Copy Markdown
Member

Context

This PR contributes to #20612 . The goal is to migrate tests/e2e/ctl_v3_make_mirror_test.go to the common testing framework

co-author: @yagikota

While we were able to migrate the e2e tests, we would like to have a discussion with the maintenairs on how we can migrate the integration tests as providing guidance would require more context about the source code.
cc @ahrtr @serathius

Testing

go test -v -count=1 -tags=e2e . -run TestMakeMirror

@ronaldngounou
ronaldngounou force-pushed the ronald/ctl_v3_make_mirror_test_clean branch 2 times, most recently from d97e51b to 983fee2 Compare November 9, 2025 00:02
@codecov

codecov Bot commented Nov 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.40%. Comparing base (efaebe0) to head (293f8f6).
⚠️ Report is 397 commits behind head on main.

Additional details and impacted files

see 19 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #20908      +/-   ##
==========================================
- Coverage   68.43%   68.40%   -0.04%     
==========================================
  Files         428      428              
  Lines       35256    35256              
==========================================
- Hits        24127    24116      -11     
- Misses       9733     9745      +12     
+ Partials     1396     1395       -1     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efaebe0...293f8f6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@serathius

Copy link
Copy Markdown
Member

Please fix

common/make_mirror_test.go:130:2: undefined: configureMirrorDestTLS

@ronaldngounou
ronaldngounou force-pushed the ronald/ctl_v3_make_mirror_test_clean branch from 983fee2 to fa0b8f9 Compare November 16, 2025 07:27
@ronaldngounou

Copy link
Copy Markdown
Member Author

Fixed, thanks.

@serathius

Copy link
Copy Markdown
Member

Can you fix pull-etcd-verify? Just run make fix.

../tests/framework/e2e/config.go:44:1: File is not properly formatted (gci)
	Version ClusterVersion
^
../tests/common/make_mirror_test.go:134:10: testMirror$1 - opts is unused (unparam)
	go func(opts config.MakeMirrorOptions) {
	        ^
../tests/common/make_mirror_test.go:32:96: unnecessary leading newline (whitespace)
			t.Run(fmt.Sprintf("Source=%s/Destination=%s", srcTC.name, destTC.name), func(t *testing.T) {
			                                                                                            ^
../tests/common/make_mirror_test.go:51:46: unnecessary leading newline (whitespace)
		for _, destTC := range clusterTestCases() {
		                                           ^
../tests/common/make_mirror_test.go:82:4: unnecessary trailing newline (whitespace)
			})
			^
../tests/common/make_mirror_test.go:102:4: unnecessary trailing newline (whitespace)
			})
			^
../tests/framework/e2e/etcdctl.go:749:115: unnecessary leading newline (whitespace)
func (ctl *EtcdctlV3) MakeMirror(ctx context.Context, destEndpoints string, opts config.MakeMirrorOptions) error {
                                                                                                                  ^
../tests/framework/e2e/etcdctl.go:794:1: unnecessary trailing newline (whitespace)

@ronaldngounou
ronaldngounou force-pushed the ronald/ctl_v3_make_mirror_test_clean branch from fa0b8f9 to dd829df Compare November 16, 2025 09:07
@serathius

Copy link
Copy Markdown
Member

/retest

Comment thread tests/common/make_mirror_test.go
@ronaldngounou
ronaldngounou force-pushed the ronald/ctl_v3_make_mirror_test_clean branch from dd829df to 952c177 Compare November 17, 2025 09:44
@ronaldngounou

Copy link
Copy Markdown
Member Author

/retest

@k8s-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ronaldngounou, serathius

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@serathius

Copy link
Copy Markdown
Member

/cc @fuweid @ahrtr

@k8s-ci-robot
k8s-ci-robot requested review from ahrtr and fuweid November 17, 2025 17:26

@fuweid fuweid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This test case only works for e2e. I think we should move that into e2e folder instead of common.

Comment thread tests/common/e2e_test.go Outdated
Comment thread tests/common/integration_test.go Outdated
Comment thread tests/common/make_mirror_test.go Outdated
Comment thread tests/common/e2e_test.go
@yagikota

yagikota commented Nov 22, 2025

Copy link
Copy Markdown
Contributor

@fuweid @ronaldngounou

This test case only works for e2e. I think we should move that into e2e folder instead of common.

The motivation of this PR is to migrate the following tests to common

As you say, the current tests only work for e2e since MakeMirror implementation for integration test is just a mock.

https://github.com/etcd-io/etcd/blob/952c177c6f288deb1945d29da1a85b538a6bec57/tests/framework/integration/integration.go#L480-L482

To make the tests work for integration, we need to complete the MakeMirror function.
The logic to be implemented is here:

https://github.com/etcd-io/etcd/blob/952c177c6f288deb1945d29da1a85b538a6bec57/etcdctl/ctlv3/command/make_mirror_command.go#L142-L240

But I'm not sure whether this approach is good or not...

@fuweid

fuweid commented Nov 24, 2025

Copy link
Copy Markdown
Member

Hi @yagikota yeah. It's ok to move that into common. But that change on option doesn't make senses to me, like WithTCPClient. I think we revert that change. Other than that, It looks good.

@yagikota

Copy link
Copy Markdown
Contributor

Hi @yagikota yeah. It's ok to move that into common. But that change on option doesn't make senses to me, like WithTCPClient. I think we revert that change. Other than that, It looks good.

Thanks for sharing your thoughts. Let's wait for updates from @ronaldngounou.

@ronaldngounou
ronaldngounou force-pushed the ronald/ctl_v3_make_mirror_test_clean branch from 952c177 to bc6f293 Compare November 24, 2025 23:37
@ronaldngounou

Copy link
Copy Markdown
Member Author

/test pull-etcd-e2e-386

Comment thread tests/common/e2e_test.go Outdated
@ronaldngounou
ronaldngounou force-pushed the ronald/ctl_v3_make_mirror_test_clean branch from bc6f293 to 87ec3f0 Compare December 5, 2025 06:04
@ronaldngounou

Copy link
Copy Markdown
Member Author

/retest

@ronaldngounou

Copy link
Copy Markdown
Member Author

@fuweid, the remaining comments are addressed. Waiting for a review please

@ronaldngounou

Copy link
Copy Markdown
Member Author

/retest

@ronaldngounou

Copy link
Copy Markdown
Member Author

@fuweid Could you please review? I addressed the comments.

Comment thread tests/common/e2e_test.go Outdated
@ronaldngounou

ronaldngounou commented Feb 11, 2026

Copy link
Copy Markdown
Member Author

Sorry for the delay of my response on this PR. I have let it sleep 👎🏽 Sorry again.
Raised a new revision.
@fuweid

@ronaldngounou
ronaldngounou force-pushed the ronald/ctl_v3_make_mirror_test_clean branch 2 times, most recently from cc8b0fb to 07a5670 Compare February 11, 2026 07:02
@ronaldngounou

Copy link
Copy Markdown
Member Author

/retest-required

@fuweid

fuweid commented Feb 12, 2026

Copy link
Copy Markdown
Member

=== Failed
=== FAIL: go.etcd.io/etcd/tests/v3/common (0.00s)
FAIL go.etcd.io/etcd/tests/v3/common [build failed]
=== Errors
tests/common/make_mirror_test.go:140:22: multiple-value srcClient.Put(ctx, sourcekvs[i].Key, sourcekvs[i].Val, config.PutOptions{}) (value of type (*clientv3.PutResponse, error)) in single-value context

It failed to build

    - Implement mirror test structure
    - Add test/common functionality
    - Create ctl_v3_make_mirror_test

Signed-off-by: Ronald Ngounou <ronald.ngounou@yahoo.com>
Signed-off-by: ronaldngounou <ronald.ngounou@yahoo.com>
@ronaldngounou
ronaldngounou force-pushed the ronald/ctl_v3_make_mirror_test_clean branch from 07a5670 to 293f8f6 Compare February 12, 2026 05:15
@k8s-ci-robot

k8s-ci-robot commented Feb 12, 2026

Copy link
Copy Markdown

@ronaldngounou: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-integration-1-cpu-arm64 293f8f6 link true /test pull-etcd-integration-1-cpu-arm64
pull-etcd-integration-2-cpu-arm64 293f8f6 link true /test pull-etcd-integration-2-cpu-arm64
pull-etcd-integration-4-cpu-amd64 293f8f6 link true /test pull-etcd-integration-4-cpu-amd64
pull-etcd-integration-4-cpu-arm64 293f8f6 link true /test pull-etcd-integration-4-cpu-arm64
pull-etcd-integration-2-cpu-amd64 293f8f6 link true /test pull-etcd-integration-2-cpu-amd64
pull-etcd-integration-1-cpu-amd64 293f8f6 link true /test pull-etcd-integration-1-cpu-amd64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions 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.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added stale and removed stale labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants