From 16107b30341cfd0c2286d6c157881d9417abd5c3 Mon Sep 17 00:00:00 2001 From: William Saakyan Date: Wed, 18 Dec 2024 17:18:02 +0100 Subject: [PATCH] Fix yql test --- docs/api.md | 2 ++ pkg/components/yql_agent.go | 2 +- test/e2e/ytsaurus_controller_test.go | 17 ++++------------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/docs/api.md b/docs/api.md index 255ba065..951184a1 100644 --- a/docs/api.md +++ b/docs/api.md @@ -2089,6 +2089,8 @@ _Appears in:_ | `WaitingForOpArchiveUpdate` | | | `WaitingForQTStateUpdatingPrepare` | | | `WaitingForQTStateUpdate` | | +| `WaitingForYqlaUpdatingPrepare` | | +| `WaitingForYqlaUpdate` | | | `WaitingForSafeModeDisabled` | | diff --git a/pkg/components/yql_agent.go b/pkg/components/yql_agent.go index c3d2e71f..ef4109b9 100644 --- a/pkg/components/yql_agent.go +++ b/pkg/components/yql_agent.go @@ -68,7 +68,7 @@ func NewYQLAgent(cfgen *ytconfig.Generator, ytsaurus *apiproxy.Ytsaurus, master getNodeSelectorWithDefault(resource.Spec.YQLAgents.NodeSelector, resource.Spec.NodeSelector), ), updateEnvironment: NewInitJob( - &l, + l, ytsaurus.APIProxy(), ytsaurus, resource.Spec.ImagePullSecrets, diff --git a/test/e2e/ytsaurus_controller_test.go b/test/e2e/ytsaurus_controller_test.go index 314f3745..73718895 100644 --- a/test/e2e/ytsaurus_controller_test.go +++ b/test/e2e/ytsaurus_controller_test.go @@ -600,23 +600,14 @@ var _ = Describe("Basic e2e test for Ytsaurus controller", Label("e2e"), func() }) // update query-tracker Context("With yql agent", Label("yql-agent"), func() { - - It("Should run with yql agent and check that yql agent channel options set up correctly", Label("basic"), func(ctx context.Context) { - By("Creating a Ytsaurus resource") - - namespace := "yqlagentchannel" - - ytsaurus := testutil.CreateBaseYtsaurusResource(namespace) + BeforeEach(func() { ytsaurus = testutil.WithQueryTracker(ytsaurus) ytsaurus = testutil.WithYqlAgent(ytsaurus) + }) - g := ytconfig.NewGenerator(ytsaurus, "local") - - DeferCleanup(deleteYtsaurus, ytsaurus) - runYtsaurus(ytsaurus) - + It("Should run with yql agent and check that yql agent channel options set up correctly", Label("basic"), func(ctx context.Context) { By("Creating ytsaurus client") - ytClient := getYtClient(g, namespace) + ytClient := createYtsaurusClient(ytsaurus, namespace) By("Check that yql agent channel exists in cluster_connection") Expect(ytClient.NodeExists(ctx, ypath.Path("//sys/@cluster_connection/yql_agent/stages/production/channel"), nil)).Should(BeTrue())