From 8eeff150a1f1b5b6b45c1a4d68f9c58678772968 Mon Sep 17 00:00:00 2001 From: camilabustos Date: Tue, 28 Oct 2025 17:51:06 +0000 Subject: [PATCH] test: Create namespace "proxy-test" first --- e2e/testcases/proxy_test.go | 8 ++++++-- .../proxy/{ => configs}/proxy-enabled.yaml | 0 .../proxy/{ => configs}/tinyproxy.yaml | 5 ----- e2e/testdata/proxy/namespace.yaml | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 7 deletions(-) rename e2e/testdata/proxy/{ => configs}/proxy-enabled.yaml (100%) rename e2e/testdata/proxy/{ => configs}/tinyproxy.yaml (96%) create mode 100644 e2e/testdata/proxy/namespace.yaml diff --git a/e2e/testcases/proxy_test.go b/e2e/testcases/proxy_test.go index 01df4d19e6..b9b98aa5e0 100644 --- a/e2e/testcases/proxy_test.go +++ b/e2e/testcases/proxy_test.go @@ -38,10 +38,14 @@ func TestSyncingThroughAProxy(t *testing.T) { nt := nomostest.New(t, nomostesting.SyncSourceGit) nt.T.Logf("Set up the tiny proxy service and Override the RootSync object with proxy setting") - nt.MustKubectl("apply", "-f", "../testdata/proxy") + nt.MustKubectl("apply", "-f", "../testdata/proxy/namespace.yaml") + nt.Must(nt.Watcher.WatchForCurrentStatus(kinds.Namespace(), "proxy-test", "")) + nt.MustKubectl("apply", "-f", "../testdata/proxy/configs") nt.T.Cleanup(func() { - nt.MustKubectl("delete", "-f", "../testdata/proxy") + nt.MustKubectl("delete", "-f", "../testdata/proxy/configs") nt.Must(nt.Watcher.WatchForNotFound(kinds.Deployment(), "tinyproxy-deployment", "proxy-test")) + nt.MustKubectl("delete", "-f", "../testdata/proxy/namespace.yaml") + nt.Must(nt.Watcher.WatchForNotFound(kinds.Namespace(), "proxy-test", "")) }) nt.Must(nt.Watcher.WatchObject(kinds.Deployment(), "tinyproxy-deployment", "proxy-test", testwatcher.WatchPredicates(hasReadyReplicas(1)))) diff --git a/e2e/testdata/proxy/proxy-enabled.yaml b/e2e/testdata/proxy/configs/proxy-enabled.yaml similarity index 100% rename from e2e/testdata/proxy/proxy-enabled.yaml rename to e2e/testdata/proxy/configs/proxy-enabled.yaml diff --git a/e2e/testdata/proxy/tinyproxy.yaml b/e2e/testdata/proxy/configs/tinyproxy.yaml similarity index 96% rename from e2e/testdata/proxy/tinyproxy.yaml rename to e2e/testdata/proxy/configs/tinyproxy.yaml index 99aa840b7a..a84c7465df 100644 --- a/e2e/testdata/proxy/tinyproxy.yaml +++ b/e2e/testdata/proxy/configs/tinyproxy.yaml @@ -12,11 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: v1 -kind: Namespace -metadata: - name: proxy-test ---- apiVersion: v1 kind: ServiceAccount metadata: diff --git a/e2e/testdata/proxy/namespace.yaml b/e2e/testdata/proxy/namespace.yaml new file mode 100644 index 0000000000..42a15bea95 --- /dev/null +++ b/e2e/testdata/proxy/namespace.yaml @@ -0,0 +1,18 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Namespace +metadata: + name: proxy-test