Documentation ¶
Index ¶
- type Shot
- func (shot Shot) GetQuery(query string, testName string, params []bigquery.QueryParameter) (string, error)
- func (shot Shot) RunQuery(query string, testName string, params []bigquery.QueryParameter, ...) ([]interface{}, error)
- func (shot Shot) RunTest(query string, testName string, params []bigquery.QueryParameter, ...) (interface{}, interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Shot ¶
type Shot struct {
// contains filtered or unexported fields
}
Shot is used to load queries and run tests for them
func NewShotWithClient ¶ added in v0.0.19
func (Shot) GetQuery ¶ added in v0.0.18
func (shot Shot) GetQuery(query string, testName string, params []bigquery.QueryParameter) (string, error)
GetQuery returns the SQL query query is the name of the query. There must be a correponding yaml definition file and an SQL template in the filesystem. testName is the name of the test to run, it must appear in the yaml definition file params are BigQuery paramaters
func (Shot) RunQuery ¶ added in v0.0.16
func (shot Shot) RunQuery(query string, testName string, params []bigquery.QueryParameter, row interface{}) ([]interface{}, error)
RunQuery runs a single SQL query against BigQuery query is the name of the query. There must be a correponding yaml definition file and an SQL template in the filesystem. testName is the name of the test to run, it must appear in the yaml definition file params are BigQuery paramaters row is a variable of type to be read from the table (must adhere to https://pkg.go.dev/cloud.google.com/go/bigquery#RowIterator.Next requirements) The result will be a slice of the same type of 'row' with the result of the query
func (Shot) RunTest ¶
func (shot Shot) RunTest(query string, testName string, params []bigquery.QueryParameter, row interface{}) (interface{}, interface{}, error)
RunTest performs a test by running two SQL queries: one for the test itself and another for the exptected result query is the name of the query. There must be a correponding yaml definition file and an SQL template in the filesystem. testName is the name of the test to run, it must appear in the yaml definition file params are BigQuery paramaters row is a variable of type to be read from the table (must adhere to https://pkg.go.dev/cloud.google.com/go/bigquery#RowIterator.Next requirements) The result will be a slice of the same type of 'row' with the result of the query