You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by gi...@apache.org on 2026/07/11 06:28:43 UTC

(texera) branch gh-readonly-queue/main/pr-6329-9f9f85b88687ca398c48f7426cecbdc187f935b8 created (now d04ebc1f2e)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-6329-9f9f85b88687ca398c48f7426cecbdc187f935b8
in repository https://gitbox.apache.org/repos/asf/texera.git


      at d04ebc1f2e test(computing-unit-managing-service): add unit test coverage for KubernetesClient.generatePodName (#6329)

This branch includes the following new commits:

     new d04ebc1f2e test(computing-unit-managing-service): add unit test coverage for KubernetesClient.generatePodName (#6329)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(texera) 01/01: test(computing-unit-managing-service): add unit test coverage for KubernetesClient.generatePodName (#6329)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-6329-9f9f85b88687ca398c48f7426cecbdc187f935b8
in repository https://gitbox.apache.org/repos/asf/texera.git

commit d04ebc1f2eeea9711b1b8a91d55e433bfbdb7e87
Author: Meng Wang <me...@uci.edu>
AuthorDate: Fri Jul 10 23:28:22 2026 -0700

    test(computing-unit-managing-service): add unit test coverage for KubernetesClient.generatePodName (#6329)
    
    ### What changes were proposed in this PR?
    
    Add unit test coverage for `KubernetesClient.generatePodName`, a pure
    string helper (`computing-unit-<cuid>`) that needs no cluster. Covers
    the base case and the `cuid=0` boundary. No production-code changes.
    
    The client-backed methods (`getPodByName`, `createPod`, …) and
    `generatePodURI` (which embeds `KubernetesConfig` values) need a fabric8
    mock / config control and stay out of scope, per the issue.
    
    ### Any related issues, documentation, discussions?
    
    Closes #6327.
    
    ### How was this PR tested?
    
    ```
    sbt "ComputingUnitManagingService/testOnly *KubernetesClientSpec"
    ```
    
    All 2 pass. `scalafmt` and `scalafix --check` are clean. The spec
    touches no cluster — `generatePodName` is a pure string helper, and
    loading `object KubernetesClient` builds the fabric8 client offline
    (config resolved from the classpath, no connection).
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Code (Opus 4.8 [1M context])
---
 .../texera/service/util/KubernetesClientSpec.scala | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/KubernetesClientSpec.scala b/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/KubernetesClientSpec.scala
new file mode 100644
index 0000000000..8ce3b107ae
--- /dev/null
+++ b/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/KubernetesClientSpec.scala
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+package org.apache.texera.service.util
+
+import org.scalatest.flatspec.AnyFlatSpec
+import org.scalatest.matchers.should.Matchers
+
+class KubernetesClientSpec extends AnyFlatSpec with Matchers {
+
+  "generatePodName" should "prefix the cuid with computing-unit" in {
+    KubernetesClient.generatePodName(42) shouldBe "computing-unit-42"
+  }
+
+  it should "handle a cuid of 0" in {
+    KubernetesClient.generatePodName(0) shouldBe "computing-unit-0"
+  }
+}