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/22 01:38:15 UTC
(texera) branch gh-readonly-queue/main/pr-6699-f90d5294588dd9297e696f8dfec6ff12b3c4fbeb created (now 9b1cef609d)
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-6699-f90d5294588dd9297e696f8dfec6ff12b3c4fbeb
in repository https://gitbox.apache.org/repos/asf/texera.git
at 9b1cef609d test(workflow-core): cover isFileResolved and parse owner (#6699)
This branch includes the following new commits:
new 9b1cef609d test(workflow-core): cover isFileResolved and parse owner (#6699)
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(workflow-core): cover isFileResolved and parse owner (#6699)
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-6699-f90d5294588dd9297e696f8dfec6ff12b3c4fbeb
in repository https://gitbox.apache.org/repos/asf/texera.git
commit 9b1cef609da97973b3728fb4d0ac282984e7cbce
Author: Matthew B. <mg...@uci.edu>
AuthorDate: Tue Jul 21 18:38:01 2026 -0700
test(workflow-core): cover isFileResolved and parse owner (#6699)
### What changes were proposed in this PR?
- Add unit tests for FileResolver.isFileResolved covering non-empty
scheme, missing scheme, and malformed URI cases.
- Add unit tests for FileResolver.parseDatasetOwnerAndName covering
valid paths, too few segments, and a null path.
### Any related issues, documentation, discussions?
Closes: #6698
### How was this PR tested?
- Run: `sbt "WorkflowCore/testOnly *FileResolverSpec"`, expect all 9
tests passing.
- Test-only change; no production code is modified.
### Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF
---
.../texera/amber/storage/FileResolverSpec.scala | 38 ++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/common/workflow-core/src/test/scala/org/apache/texera/amber/storage/FileResolverSpec.scala b/common/workflow-core/src/test/scala/org/apache/texera/amber/storage/FileResolverSpec.scala
index 593ac8d347..62daa811d3 100644
--- a/common/workflow-core/src/test/scala/org/apache/texera/amber/storage/FileResolverSpec.scala
+++ b/common/workflow-core/src/test/scala/org/apache/texera/amber/storage/FileResolverSpec.scala
@@ -124,6 +124,44 @@ class FileResolverSpec
}
}
+ "isFileResolved" should "return true when the path has a non-empty scheme" in {
+ assert(FileResolver.isFileResolved("s3://bucket/key"))
+ assert(
+ FileResolver.isFileResolved(s"${FileResolver.DATASET_FILE_URI_SCHEME}:///repo/hash/file.csv")
+ )
+ }
+
+ it should "return false when the path has no scheme" in {
+ assert(!FileResolver.isFileResolved("some/random/path"))
+ assert(!FileResolver.isFileResolved("/test_user@test.com/test_dataset/v1/1.txt"))
+ }
+
+ it should "return false for a malformed URI" in {
+ // a space is illegal in a URI and makes the java.net.URI constructor throw
+ assert(!FileResolver.isFileResolved("has a space"))
+ }
+
+ "parseDatasetOwnerAndName" should "extract owner email and dataset name from a valid path" in {
+ assert(
+ FileResolver.parseDatasetOwnerAndName("/test_user@test.com/test_dataset/v1/1.txt")
+ == Some(("test_user@test.com", "test_dataset"))
+ )
+ // extra segments beyond the file-relative path are ignored
+ assert(
+ FileResolver.parseDatasetOwnerAndName("/owner@x.com/ds/v2/directory/nested/a.csv")
+ == Some(("owner@x.com", "ds"))
+ )
+ }
+
+ it should "return None when the path has fewer than four segments" in {
+ assert(FileResolver.parseDatasetOwnerAndName("/owner@x.com/ds/v1").isEmpty)
+ assert(FileResolver.parseDatasetOwnerAndName("owner/dataset").isEmpty)
+ }
+
+ it should "return None for a null path" in {
+ assert(FileResolver.parseDatasetOwnerAndName(null).isEmpty)
+ }
+
override protected def afterAll(): Unit = {
shutdownDB()
}