Skip to content

Commit

Permalink
Move static registry to new file (#506)
Browse files Browse the repository at this point in the history
We exclude some tests when we run race which leads to compilation
failure. This is present only on main, but not in PR.
  • Loading branch information
jakozaur authored Jul 9, 2024
1 parent cfc8cef commit e45386e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
17 changes: 0 additions & 17 deletions quesma/quesma/search_norace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,6 @@ import (
"time"
)

type staticRegistry struct {
tables map[schema.TableName]schema.Schema
}

func (e staticRegistry) AllSchemas() map[schema.TableName]schema.Schema {
if e.tables != nil {
return e.tables
} else {
return map[schema.TableName]schema.Schema{}
}
}

func (e staticRegistry) FindSchema(name schema.TableName) (schema.Schema, bool) {
s, found := e.tables[name]
return s, found
}

// TestAllUnsupportedQueryTypesAreProperlyRecorded tests if all unsupported query types are properly recorded.
// It runs |testdata.UnsupportedAggregationsTests| tests, each of them sends one query of unsupported type.
// It ensures that this query type is recorded in the management console, and that all other query types are not.
Expand Down
23 changes: 23 additions & 0 deletions quesma/quesma/static_registry_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright Quesma, licensed under the Elastic License 2.0.
// SPDX-License-Identifier: Elastic-2.0

package quesma

import "quesma/schema"

type staticRegistry struct {
tables map[schema.TableName]schema.Schema
}

func (e staticRegistry) AllSchemas() map[schema.TableName]schema.Schema {
if e.tables != nil {
return e.tables
} else {
return map[schema.TableName]schema.Schema{}
}
}

func (e staticRegistry) FindSchema(name schema.TableName) (schema.Schema, bool) {
s, found := e.tables[name]
return s, found
}

0 comments on commit e45386e

Please sign in to comment.