Copilot commented on code in PR #7656:
URL: https://github.com/apache/texera/pull/7656#discussion_r3780809211


##########
amber/src/test/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveResourceSpec.scala:
##########
@@ -453,6 +453,27 @@ class PveResourceSpec
     pves.map(_.get("pveName")) should contain(testPveName)
   }
 
+  it should "return an empty list for a computing unit with no environments" 
in {
+    val resp = new PveResource().fetchPVEs(Int.box(testCuid + 1))
+
+    resp.getStatus shouldBe Response.Status.OK.getStatusCode
+    resp.getEntity.asInstanceOf[java.util.List[_]].asScala shouldBe empty
+  }

Review Comment:
   This test uses `testCuid + 1` without ensuring the 
`/tmp/texera-pve/venvs/<cuid>` directory is clean. Because 
`PveManager.getEnvironments` reads directly from the filesystem, stale 
environments from previous local runs can make this test flaky (it will return 
a non-empty list). Clean the directory (or use a uniquely generated cuid) 
before asserting the result is empty.
   
   This issue also appears on line 473 of the same file.



##########
amber/src/test/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveResourceSpec.scala:
##########
@@ -469,4 +490,45 @@ class PveResourceSpec
     val resp = new PveResource().deletePackage(testCuid, testPveName, 
"pyarrow")
     resp.getStatus shouldBe Response.Status.BAD_REQUEST.getStatusCode
   }
+
+  // ─── conflict and error branches 
───────────────────────────────────────────
+  // The unique index on (uid, name) is what surfaces a duplicate as SQLSTATE 
23505,
+  // so these drive real constraint violations rather than mocking the DAO.

Review Comment:
   The section header says "conflict and error branches", but the tests added 
below only cover conflict (409) and empty-result behavior; they don’t exercise 
any of the 500/exception-handler branches in `PveResource`. Consider renaming 
the header to avoid implying error paths are covered (or add dedicated tests 
for the exception branches if they’re expected to be covered as part of this 
PR/linked issue).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to