Fix SchemaDir for internal server integration test
@@ -184,11 +184,16 @@ func (s *TestCluster) SetupTestDatabase(options *persistencetests.TestBaseOption
s.CreateSession(options)
s.CreateDatabase(1, options.DropDatabase)
+ schemaDir := options.SchemaDir + "/"
+
+ if !strings.HasPrefix(schemaDir, "/") && !strings.HasPrefix(schemaDir, "../") {
cadencePackageDir, err := getCadencePackageDir()
if err != nil {
log.Fatal(err)
}
- schemaDir := cadencePackageDir + options.SchemaDir + "/"
+ schemaDir = cadencePackageDir + schemaDir
+ }
+
s.LoadSchema([]string{"schema.cql"}, schemaDir)
s.LoadVisibilitySchema([]string{"schema.cql"}, schemaDir)
}
