Skip to content

Commit

Permalink
Integrate object store configuration into test.
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Spörri <psp@zurich.ibm.com>
  • Loading branch information
pspoerri committed Apr 10, 2024
1 parent 9272d9e commit 41958bd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/test/scala/com/ibm/geds/hdfs/TestGEDSHDFS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestGEDSHDFS {

@Test
def createFilePrefix(): Unit = {
val stream = fs.create(new Path("/test/createFilePrefix/file"))
val stream = fs.create(new Path(f"/test/createFilePrefix/file"))
stream.close()
var ls = fs.listStatus(new Path("/test/createFilePrefix"))
assertEquals(1, ls.length)
Expand Down Expand Up @@ -81,13 +81,26 @@ object TestGEDSHDFS {

@BeforeAll
def setup(): Unit = {
val bucket = sys.env.get("TEST_BUCKET").getOrElse("test")
val conf = new Configuration()
conf.set("fs.default.name", "geds")
conf.set("fs.default.fs", "geds")
conf.set("fs.geds.impl", "com.ibm.geds.hdfs.GEDSHadoopFileSystem")
conf.set("fs.geds.path", "/tmp/geds")
conf.set(
f"fs.geds.${bucket}.accessKey",
sys.env.get("AWS_ACCESS_KEY_ID").getOrElse("minioadmin")
)
conf.set(
f"fs.geds.${bucket}.secretKey",
sys.env.get("AWS_SECRET_ACCESS_KEY").getOrElse("minioadmin")
)
conf.set(
f"fs.geds.${bucket}.endpoint",
sys.env.get("AWS_ENDPOINT_URL").getOrElse("http://localhost:9000")
)
conf.set("fs.geds.metadataserver", "localhost:4381")
fs = FileSystem.get(new java.net.URI("geds://test"), conf)
fs = FileSystem.get(new java.net.URI(f"geds://${bucket}"), conf)
System.out.println(
"@BeforeAll - executes once before all test methods in this class"
)
Expand Down

0 comments on commit 41958bd

Please sign in to comment.