Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Disk Manager] Refactoring: use testing client for dm integration tests #2894

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

gy2411
Copy link
Collaborator

@gy2411 gy2411 commented Jan 21, 2025

#892

Added TestingClient interface and used it in tests where needed.

@gy2411 gy2411 changed the title Use testing client for dm integration tests [Disk Manager] Refactoring: use testing client for dm integration tests Jan 21, 2025
"github.com/ydb-platform/nbs/cloud/disk_manager/internal/pkg/types"
"github.com/ydb-platform/nbs/cloud/tasks/logging"
"golang.org/x/sync/errgroup"
)

////////////////////////////////////////////////////////////////////////////////

func (c *client) FillDisk(
type testingClient struct {
client *client
Copy link
Collaborator Author

@gy2411 gy2411 Jan 21, 2025

Choose a reason for hiding this comment

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

Тут нужно использовать именно тип client, а не интерфейс Client, так как в методах нужно будет иметь доступ к полю nbs структуры client.

Чтобы иметь возможность положить сюда client, пришлось чуть подрефакторить код фабрики. А именно, рядом с методом factory.GetClient добавил неэкспортированный метод factory.getClient, который возвращает client вместо Client.

@gy2411 gy2411 added the large-tests Launch large tests for PR label Jan 21, 2025
type partitionInfo struct {
Checkpoints []checkpoint `json:"Checkpoints"`
// We don't need other partitionInfo fields.
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Эти две структуры нигде не использовались. Не знаю, для чего они тут были)


////////////////////////////////////////////////////////////////////////////////

func (c *testingClient) Ping(ctx context.Context) (err error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Все методы, которые есть в интерфейсе Client, полностью делегируются.

Реализации остальных методов в точности перенесены из client, за тем исключением, что где-то вметсо c.nbs стало c.client.nbs.

@gy2411 gy2411 force-pushed the users/gayurgin/use_testing_client_for_dm_integration_tests branch from 0cf268a to b1db1fe Compare January 21, 2025 14:06
Copy link
Contributor

Note

This is an automated comment that will be appended during run.

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit e188074.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
6721 6708 0 7 6 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large-tests Launch large tests for PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant