Skip to content

Commit

Permalink
file system hack in Inferencer Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yliuuuu committed Nov 4, 2023
1 parent d6adc32 commit a7d04f8
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ import org.partiql.types.StaticType.Companion.STRING
import org.partiql.types.StaticType.Companion.unionOf
import org.partiql.types.StructType
import org.partiql.types.TupleConstraint
import java.net.URI
import java.nio.file.FileSystem
import java.nio.file.FileSystems
import java.time.Instant
import java.util.stream.Stream
import kotlin.io.path.pathString
import kotlin.io.path.toPath
import kotlin.reflect.KClass
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
Expand Down Expand Up @@ -131,7 +133,16 @@ class PartiQLSchemaInferencerTests {
fun testCaseWhens(tc: TestCase) = runTest(tc)

companion object {
private val root = PartiQLTestProvider().javaClass.getResource("/catalogs/default")!!.toURI().toPath().pathString
private val root = run {
// Github build attempted to retrieve the resource from
// jar:file:/home/runner/work/partiql-lang-kotlin/partiql-lang-kotlin/partiql-planner/build/libs/partiql-planner-0.14.1-alpha.1-test-fixtures.jar!/catalogs/default,
val URI = this::class.java.getResource("/catalogs/default")!!.toURI()
val env: Map<String, String> = HashMap()
val parts = URI.toString().split("!")
val fs: FileSystem = FileSystems.newFileSystem(URI(parts[0]), env)
val path = fs.getPath(parts[1])
path.pathString
}

private val PLUGINS = listOf(LocalPlugin())

Expand Down

0 comments on commit a7d04f8

Please sign in to comment.