query

package
v0.0.0-...-71fd8da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 15 Imported by: 1

README

wpt.fyi Search queries

wpt.fyi supports a structured search syntax, allowing the user to filter specific results.

wpt.fyi search syntax

As outlined below, the /api/search endpoint takes a structured query object. wpt.fyi's UI contains a search-box that converts a search syntax into the required structured query. Listed below are the "atoms" that can be used in a search.

Root queries

By default, a search query will be implicitly treated as an exists query (a disjunction across each of the runs separately). However, there are several other root query types that can be invoked by wrapping the query(s), including explicitly wrapping with exists.

If multiple root queries are used, they are implicitly combined with AND, i.e. each query must separately be true. e.g.

count>1(status:!pass) none(status:missing)

Requires that more than one non-pass result is present, and none of the results are missing. You can also explicitly combine the root queries with and, e.g.

count<3(status:pass) and none(status:missing)

Alternatively, root queries can be combined using or, e.g.

none(status:pass) or all(status:pass)

Note that the and conjunction takes precedence over the or conjunction.

Exists

As stated above, exists is the implicit default.

exists([query1] [query2])

Combines the filters such that there exists some result in the row that satisfies each query.

All and None
all([query1] [query2])

Combines filters such that they must all apply to all runs.

none([query1] [query2])

Combines filters such that they must not all apply to any single run.

Sequential
seq([query1] [query2] [...])

Combines filters such that they must apply to runs sequentially. This is mainly useful when there are multiple runs with the same product, e.g. to find a regression

seq(status:pass status:fail)
Count
count:[number]([query1] [query2])

Requires that the number of results matching the given query/queries is precisely the given count. For example, this search atom can be used to find cases where exactly one result is a failure:

count:1(status:fail)

Note that there are some special keywords for count:1, count:2, and count:3 (one, two and three respectively). For example, to find results where Safari is the only one missing a result:

three(status:!missing) safari:missing
Count inequality
count[inequality][number]([query1])

Requires that the number of results matching the given query satisfies the given inequality comparator.

count=1(status:PASS)
count>1(status:PASS)
count<3(status:!FAIL)
count<=1(status:FAIL)
count>=1(status:MISSING)

NOTE: The colon after the count is optional for inequalities. Queries like count:>1(status:missing), with a syntax similar to GitHub's search, will work.

Query atoms

Within a root query, there are several search atoms that can be used to filter the results (according to the root query).

Path
path:[path]

Filters results to a specific path prefix. For example, this search atom can be used to list only results for the /dom/ directory:

path:/dom/

Note that without the trailing /, the /domparsing/ and /domxpath directories would also be included.

Status

Filters to results with a specific status (or, not a specific status).

Valid statuses are:

  • unknown (a.k.a. missing)
  • pass
  • ok
  • error
  • timeout
  • notrun
  • fail
  • crash
  • skip
  • assert

NOTE: ok is the status of the test harness setup. Individual subtests will have a status of pass - it may be necessary to search for both.

There are a couple of different ways to filter by status.

Status for any product
status:[status]

or, negation,

status:![status]
Status for a specific product
[product]:[status]

Where [product] is a product specification (e.g. safari, chrome-69).

Meta qualities

Filters the results to values which possess/exhibit a given quality.

is:[quality]
is:different

Filters to rows where there is more than one resulting status for a test across the runs.

is:tentative

Filters to tests that are marked as tentative (currently based on file name).

is:optional

Filters to tests that are marked as optional (currently based on file name).

Note: At this time, the may and should metadata flags are not supported.

And-conjuction
[query1] and [query2] [and ...]

Combines filters, such that they must all apply, e.g.

chrome:pass and firefox:!pass
Or-conjuction
[query1] or [query2] [or ...]

Combines filters, such that any must apply, e.g.

chrome:pass or chrome:ok

NOTE: Or-conjuction takes less precedence than and. Precedence can be modified using parens, e.g. chrome:pass and (firefox:!pass or safari:!pass)

The /api/search endpoint takes an HTTP POST method, where the body is of the format

{
  "run_ids": [123, 456, ...],
  "query": {
    [Structured query]
  }
}
Structured query objects

Structured query objects are produced by the syntax parser on wpt.fyi.

The easiest way to build the query you need is to use the syntax above, and inspect the outgoing HTTP POST body.

exists

exists query objects perform a disjunction of all of the runs, in order to ensure that each of its queries is satisfied by the same run. This matters for the case that there are multiple runs with the same product.

{"exists": [query1, query2, ...]}
all

all query objects perform a conjunction of all of the runs, in order to ensure that each of its queries is satisfied by all of the runs.

{"all": [query1, query2, ...]}
none

none query objects perform a disjunction of all of the runs, in order to ensure that no single run satisfies all of its queries. none queries are a simplification for {"not": {"exists": [...] }} queries.

{"none": [query1, query2, ...]}
sequential

sequential query objects perform an ordered disjunction of all of the runs. Like exists, the queries must be satisfied by the same run, but in addition, the order of the queries must be satisfied by the runs, in order.

{"sequential": [query1, query2, ...]}
count

count query objects perform a count across all the runs, returning rows which have a count of exactly the given number.

{
    "count": 2,
    "where": {
        // query object
    }
}
moreThan and lessThan

moreThan and lessThan are similar to count, but perform an inequality instead of equality (exact count).

{
    "moreThan": 2,
    "where": {
        // query object
    }
}
and
{"and": [query1, query2, ...]}
or
{"or": [query1, query2, ...]}
path

Takes a string of the path prefix to match.

{"path": "/dom/"}
status

Takes a string of the status to match.

{"status": "ok"}
status not

A not-clause for the given status.

{"status": {"not": "fail"} }
product status

Same as satuts, but with a specific product-spec.

{
  "product": "chrome-69",
  "status": "ok",
}

link query atoms perform a search for tests that have some matching link metadata.

{"link": pattern}

E.g.

Search untriaged issues -

chrome:fail and !link:bugs.chromium.org

Search triaged issues -

chrome:pass and link:bugs.chromium.org
triaged

triaged query atoms perform a search for tests of a specific browser that have link metadata.

{"triaged": [browsername]}

Where [browsername] is a browser specification (e.g. safari, chrome).

E.g.

Search untriaged Chrome failures -

chrome:fail and none(triaged:chrome)

Search triaged Chrome tests -

chrome:pass and triaged:chrome
label

label query atoms perform a search for tests that have a matching metadata label, regardless of browsers.

{"label": label}

Where label is a string and case-insensitive.

E.g.

Search triaged tests with a label interop-2022:

label:interop-2022
is

is query atoms perform a search for tests that possess some meta quality.

{"is": "different"}

See Meta qualities above for more information on other meta qualities than "different".

feature

feature query atoms perform a search for tests that have a matching feature label, regardless of browsers.

{"feature": [web-feature-name]}

Where web-feature-name is a string, case-insensitive and matches the filename base for any of the .yml files in the feature-group-definitions directory.

E.g.

Search the nesting feature:

feature:nesting

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadSummaryVersion = errors.New("invalid/unsupported summary version")

ErrBadSummaryVersion occurs when the summary file URL is not the correct version.

View Source
var MetadataMapCached map[string][]byte // nolint:gochecknoglobals // TODO: Fix gochecknoglobals lint error

MetadataMapCached is the local cache of Metadata in searchcache. Zero value is nil.

Functions

func GetWebFeaturesDataCache

func GetWebFeaturesDataCache() shared.WebFeaturesData

GetWebFeaturesDataCache safely retrieves the data cache.

func RegisterRoutes

func RegisterRoutes()

RegisterRoutes binds query API handlers to URL routes.

func SetWebFeaturesDataCache

func SetWebFeaturesDataCache(newData shared.WebFeaturesData)

SetWebFeaturesDataCache safely swaps the data cache. Currently, the separate goroutine in the poll folder will use this.

Types

type AbstractAll

type AbstractAll struct {
	Args []AbstractQuery
}

AbstractAll represents an array of abstract queries, each of which must be satifisfied by all runs. It represents the root of a structured query.

func (AbstractAll) BindToRuns

func (e AbstractAll) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns binds each abstract query to an and-combo of that query against each specific/individual run. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractAll) UnmarshalJSON

func (e *AbstractAll) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractAll attempts to interpret a query atom as {"all": [<abstract query>]}.

type AbstractAnd

type AbstractAnd struct {
	Args []AbstractQuery
}

AbstractAnd is the AbstractQuery for conjunction.

func (AbstractAnd) BindToRuns

func (a AbstractAnd) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns for AbstractAnd produces an And with bound arguments. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractAnd) UnmarshalJSON

func (a *AbstractAnd) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractAnd attempts to interpret a query atom as {"and": [<abstract queries>]}.

type AbstractCount

type AbstractCount struct {
	Count int
	Where AbstractQuery
}

AbstractCount represents the root of a count query, where the exact number of runs that satisfy the query must match the expected count.

func (AbstractCount) BindToRuns

func (c AbstractCount) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns binds each count query to all of the runs, so that it can count the number of runs that match the criteria. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractCount) UnmarshalJSON

func (c *AbstractCount) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON for AbstractCount attempts to interpret a query atom as {"count": int, "where": query}.

type AbstractExists

type AbstractExists struct {
	Args []AbstractQuery
}

AbstractExists represents an array of abstract queries, each of which must be satifisfied by some run. It represents the root of a structured query.

func (AbstractExists) BindToRuns

func (e AbstractExists) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns binds each abstract query to an or-combo of that query against each specific/individual run. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractExists) UnmarshalJSON

func (e *AbstractExists) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractExists attempts to interpret a query atom as {"exists": [<abstract queries>]}.

type AbstractLessThan

type AbstractLessThan struct {
	AbstractCount
}

AbstractLessThan is the root of a lessThan query, where the number of runs that satisfy the query must be less than the given count.

func (AbstractLessThan) BindToRuns

func (l AbstractLessThan) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns binds each count query to all of the runs, so that it can count the number of runs that match the criteria. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractLessThan) UnmarshalJSON

func (l *AbstractLessThan) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractLessThan attempts to interpret a query atom as {"count": int, "where": query}.

type AbstractLink struct {
	Pattern string
	// contains filtered or unexported fields
}

AbstractLink is represents the root of a link query, which matches Metadata URLs to a pattern string.

func (AbstractLink) BindToRuns

func (l AbstractLink) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns for AbstractLink fetches metadata for either test-level issues or issues associated with the given runs. It does not filter the metadata by the pattern yet. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractLink) UnmarshalJSON

func (l *AbstractLink) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractLink attempts to interpret a query atom as {"link":<metadata url pattern string>}.

type AbstractMoreThan

type AbstractMoreThan struct {
	AbstractCount
}

AbstractMoreThan is the root of a moreThan query, where the number of runs that satisfy the query must be more than the given count.

func (AbstractMoreThan) BindToRuns

func (m AbstractMoreThan) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns binds each count query to all of the runs, so that it can count the number of runs that match the criteria. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractMoreThan) UnmarshalJSON

func (m *AbstractMoreThan) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON for AbstractMoreThan attempts to interpret a query atom as {"count": int, "where": query}.

type AbstractNone

type AbstractNone struct {
	Args []AbstractQuery
}

AbstractNone represents an array of abstract queries, each of which must not be satifisfied by any run. It represents the root of a structured query.

func (AbstractNone) BindToRuns

func (e AbstractNone) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns binds to a not-exists for the same query(s). nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractNone) UnmarshalJSON

func (e *AbstractNone) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractNone attempts to interpret a query atom as {"none": [<abstract query>]}.

type AbstractNot

type AbstractNot struct {
	Arg AbstractQuery
}

AbstractNot is the AbstractQuery for negation.

func (AbstractNot) BindToRuns

func (n AbstractNot) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns for AbstractNot produces a Not with a bound argument. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractNot) UnmarshalJSON

func (n *AbstractNot) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractNot attempts to interpret a query atom as {"not": <abstract query>}.

type AbstractOr

type AbstractOr struct {
	Args []AbstractQuery
}

AbstractOr is the AbstractQuery for disjunction.

func (AbstractOr) BindToRuns

func (o AbstractOr) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns for AbstractOr produces an Or with bound arguments. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractOr) UnmarshalJSON

func (o *AbstractOr) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractOr attempts to interpret a query atom as {"or": [<abstract queries>]}.

type AbstractQuery

type AbstractQuery interface {
	BindToRuns(runs ...shared.TestRun) ConcreteQuery
}

AbstractQuery is an intermetidate representation of a test results query that has not been bound to specific shared.TestRun specs for processing.

type AbstractSequential

type AbstractSequential struct {
	Args []AbstractQuery
}

AbstractSequential represents the root of a sequential queries, where the first query must be satisfied by some run such that the next run, sequentially, also satisfies the next query, and so on.

func (AbstractSequential) BindToRuns

func (e AbstractSequential) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns binds each sequential query to an and-combo of those queries against specific sequential runs, for each combination of sequential runs. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractSequential) UnmarshalJSON

func (e *AbstractSequential) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractSequential attempts to interpret a query atom as {"exists": [<abstract queries>]}.

type AbstractTestLabel

type AbstractTestLabel struct {
	Label string
	// contains filtered or unexported fields
}

AbstractTestLabel represents the root of a testlabel query, which matches test-level metadata labels to a searched label.

func (AbstractTestLabel) BindToRuns

func (t AbstractTestLabel) BindToRuns(_ ...shared.TestRun) ConcreteQuery

BindToRuns for AbstractTestLabel fetches test-level metadata; it is independent of test runs. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractTestLabel) UnmarshalJSON

func (t *AbstractTestLabel) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractTestLabel attempts to interpret a query atom as {"label":<label string>}.

type AbstractTestWebFeature

type AbstractTestWebFeature struct {
	TestWebFeatureAtom
	// contains filtered or unexported fields
}

AbstractTestWebFeature represents the root of a web_feature query, which matches test-level metadata to a searched web feature.

func (AbstractTestWebFeature) BindToRuns

BindToRuns for AbstractTestWebFeature fetches test-level metadata; it is independent of test runs. nolint:ireturn // TODO: Fix ireturn lint error

type AbstractTriaged

type AbstractTriaged struct {
	Product *shared.ProductSpec
	// contains filtered or unexported fields
}

AbstractTriaged represents the root of a triaged query that matches tests where the test of a specific browser has been triaged through Metadata.

func (AbstractTriaged) BindToRuns

func (t AbstractTriaged) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns for AbstractTriaged binds each run matching the AbstractTriaged ProductSpec to a triaged object. nolint:ireturn // TODO: Fix ireturn lint error

func (*AbstractTriaged) UnmarshalJSON

func (t *AbstractTriaged) UnmarshalJSON(b []byte) error

UnmarshalJSON for AbstractTriaged attempts to interpret a query atom as {"triaged":<browser name>}.

type AggregationOpts

type AggregationOpts struct {
	IncludeSubtests         bool
	InteropFormat           bool
	IncludeDiff             bool
	IgnoreTestHarnessResult bool // Don't +1 the "OK" status for testharness tests.
	DiffFilter              shared.DiffFilterParam
}

AggregationOpts are options for the aggregation format used when collecting the results.

type And

type And struct {
	Args []ConcreteQuery
}

And is a logical conjunction of ConcreteQuery instances.

func (And) Size

func (a And) Size() int

Size of And is the sum of the sizes of its constituent ConcretQuery instances.

type Binder

type Binder interface {
	// Bind produces an query execution Plan and/or error after binding its inputs
	// to a query service mechanism. E.g., an in-memory cache may verify that the
	// given runs are in the cache and extract results data subsets that pertain
	// to the runs before producing a Plan implementation that can operate over
	// the subsets directly.
	Bind([]shared.TestRun, ConcreteQuery) (Plan, error)
}

Binder is a mechanism for binding a query over a slice of test runs to a particular query service mechanism.

type ConcreteQuery

type ConcreteQuery interface {
	Size() int
}

ConcreteQuery is an AbstractQuery that has been bound to specific test runs.

type Count

type Count struct {
	Count int
	Args  []ConcreteQuery
}

Count constrains search results to include only test results where the number of runs that match the given criteria is exactly the expected count.

func (Count) Size

func (c Count) Size() int

Size of Count is the sum of the sizes of its constituent ConcretQuery instances.

type False

type False struct{}

False is a false-valued ConcreteQuery.

func (False) BindToRuns

func (f False) BindToRuns(_ ...shared.TestRun) ConcreteQuery

BindToRuns for False is a no-op; it is independent of test runs. nolint:ireturn // TODO: Fix ireturn lint error

func (False) Size

func (False) Size() int

Size of False is 0: It should be optimized out of queries in practice.

type LessThan

type LessThan struct {
	Count
}

LessThan constrains search results to include only test results where the number of runs that match the given criteria is less than the given count.

type Link struct {
	Pattern  string
	Metadata map[string][]string
}

Link is a ConcreteQuery of AbstractLink.

func (Link) Size

func (Link) Size() int

Size of Link has a size of 1: servicing such a query requires a substring match per Metadata Link Node.

type MetadataQuality

type MetadataQuality int

MetadataQuality represents the root of an "is" query, which asserts known metadata qualities to the results.

const (
	// MetadataQualityUnknown is a placeholder for unrecognized values.
	MetadataQualityUnknown MetadataQuality = iota
	// MetadataQualityDifferent represents an is:different atom.
	// "different" ensures that one or more results differs from the other results.
	MetadataQualityDifferent
	// MetadataQualityTentative represents an is:tentative atom.
	// "tentative" ensures that the results are from a tentative test.
	MetadataQualityTentative
	// MetadataQualityOptional represents an is:optional atom.
	// "optional" ensures that the results are from an optional test.
	MetadataQualityOptional
)

func MetadataQualityFromString

func MetadataQualityFromString(quality string) (MetadataQuality, error)

MetadataQualityFromString returns the enum value for the given string.

func (MetadataQuality) BindToRuns

func (q MetadataQuality) BindToRuns(_ ...shared.TestRun) ConcreteQuery

BindToRuns for MetadataQuality is a no-op; it is independent of test runs. nolint:ireturn // TODO: Fix ireturn lint error

func (MetadataQuality) Size

func (q MetadataQuality) Size() int

Size of Is depends on the quality.

func (*MetadataQuality) UnmarshalJSON

func (q *MetadataQuality) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON for MetadataQuality attempts to interpret a query atom as {"is":<metadata quality>}.

type MoreThan

type MoreThan struct {
	Count
}

MoreThan constrains search results to include only test results where the number of runs that match the given criteria is more than the given count.

type Not

type Not struct {
	Arg ConcreteQuery
}

Not is a logical negation of ConcreteQuery instances.

func (Not) Size

func (n Not) Size() int

Size of Not is one unit greater than the size of its ConcreteQuery argument.

type Or

type Or struct {
	Args []ConcreteQuery
}

Or is a logical disjunction of ConcreteQuery instances.

func (Or) Size

func (o Or) Size() int

Size of Or is the sum of the sizes of its constituent ConcretQuery instances.

type Plan

type Plan interface {
	// Execute runs the query execution plan. The result set type depends on the
	// underlying query service mechanism that the Plan was bound with.
	Execute([]shared.TestRun, AggregationOpts) interface{}
}

Plan a query execution plan that returns results.

type RunQuery

type RunQuery struct {
	RunIDs []int64
	AbstractQuery
}

RunQuery is the internal representation of a query received from an HTTP client, including the IDs of the test runs to query, and the structured query to run.

func (*RunQuery) UnmarshalJSON

func (rq *RunQuery) UnmarshalJSON(b []byte) error

UnmarshalJSON interprets the JSON representation of a RunQuery, instantiating (an) appropriate Query implementation(s) according to the JSON structure.

type RunTestStatusEq

type RunTestStatusEq struct {
	Run    int64
	Status shared.TestStatus
}

RunTestStatusEq constrains search results to include only test results from a particular run that have a particular test status value. Run IDs are those values automatically assigned to shared.TestRun instances by Datastore. Status IDs are those codified in shared.TestStatus* symbols.

func (RunTestStatusEq) Size

func (RunTestStatusEq) Size() int

Size of RunTestStatusEq is 1: servicing such a query requires a single lookup in a test run result mapping per test.

type RunTestStatusNeq

type RunTestStatusNeq struct {
	Run    int64
	Status shared.TestStatus
}

RunTestStatusNeq constrains search results to include only test results from a particular run that do not have a particular test status value. Run IDs are those values automatically assigned to shared.TestRun instances by Datastore. Status IDs are those codified in shared.TestStatus* symbols.

func (RunTestStatusNeq) Size

func (RunTestStatusNeq) Size() int

Size of RunTestStatusNeq is 1: servicing such a query requires a single lookup in a test run result mapping per test.

type SubtestNamePattern

type SubtestNamePattern struct {
	Subtest string
}

SubtestNamePattern is a query atom that matches subtest names to a pattern string.

func (SubtestNamePattern) BindToRuns

func (tnp SubtestNamePattern) BindToRuns(_ ...shared.TestRun) ConcreteQuery

BindToRuns for SubtestNamePattern is a no-op; it is independent of test runs. nolint:ireturn // TODO: Fix ireturn lint error

func (SubtestNamePattern) Size

func (SubtestNamePattern) Size() int

Size of SubtestNamePattern has a size of 1: servicing such a query requires a substring match per subtest.

func (*SubtestNamePattern) UnmarshalJSON

func (tnp *SubtestNamePattern) UnmarshalJSON(b []byte) error

UnmarshalJSON for SubtestNamePattern attempts to interpret a query atom as {"subtest":<subtest name pattern string>}.

type SummaryResult

type SummaryResult struct {
	// Status represents the 1-2 character abbreviation for the status of the test.
	Status string `json:"s"`
	// Counts represents the subtest counts (passes and total).
	Counts []int `json:"c"`
}

SummaryResult is the format of the data from summary files generated with the newest aggregation method.

type TestLabel

type TestLabel struct {
	Label    string
	Metadata map[string][]string
}

TestLabel is a ConcreteQuery of AbstractTestLabel.

func (TestLabel) Size

func (TestLabel) Size() int

Size of TestLabel has a size of 1: servicing such a query requires a label match per Metadata Link Node.

type TestNamePattern

type TestNamePattern struct {
	Pattern string
}

TestNamePattern is a query atom that matches test names to a pattern string.

func (TestNamePattern) BindToRuns

func (tnp TestNamePattern) BindToRuns(_ ...shared.TestRun) ConcreteQuery

BindToRuns for TestNamePattern is a no-op; it is independent of test runs. nolint:ireturn // TODO: Fix ireturn lint error

func (TestNamePattern) Size

func (TestNamePattern) Size() int

Size of TestNamePattern has a size of 1: servicing such a query requires a substring match per test.

func (*TestNamePattern) UnmarshalJSON

func (tnp *TestNamePattern) UnmarshalJSON(b []byte) error

UnmarshalJSON for TestNamePattern attempts to interpret a query atom as {"pattern":<test name pattern string>}.

type TestPath

type TestPath struct {
	Path string
}

TestPath is a query atom that matches exact test path prefixes. It is an inflexible equivalent of TestNamePattern.

func (TestPath) BindToRuns

func (tp TestPath) BindToRuns(_ ...shared.TestRun) ConcreteQuery

BindToRuns for TestNamePattern is a no-op; it is independent of test runs. nolint:ireturn // TODO: Fix ireturn lint error

func (TestPath) Size

func (TestPath) Size() int

Size of TestPath has a size of 1: servicing such a query requires a substring match per test.

func (*TestPath) UnmarshalJSON

func (tp *TestPath) UnmarshalJSON(b []byte) error

UnmarshalJSON for TestPath attempts to interpret a query atom as {"path":<test name pattern string>}.

type TestStatusEq

type TestStatusEq struct {
	Product *shared.ProductSpec
	Status  shared.TestStatus
}

TestStatusEq is a query atom that matches tests where the test status/result from at least one test run matches the given status value, optionally filtered to a specific browser name.

func (TestStatusEq) BindToRuns

func (tse TestStatusEq) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns for TestStatusEq expands to a disjunction of RunTestStatusEq values. nolint:ireturn // TODO: Fix ireturn lint error

func (*TestStatusEq) UnmarshalJSON

func (tse *TestStatusEq) UnmarshalJSON(b []byte) error

UnmarshalJSON for TestStatusEq attempts to interpret a query atom as {"product": <browser name>, "status": <status string>}.

type TestStatusNeq

type TestStatusNeq struct {
	Product *shared.ProductSpec
	Status  shared.TestStatus
}

TestStatusNeq is a query atom that matches tests where the test status/result from at least one test run does not match the given status value, optionally filtered to a specific browser name.

func (TestStatusNeq) BindToRuns

func (tsn TestStatusNeq) BindToRuns(runs ...shared.TestRun) ConcreteQuery

BindToRuns for TestStatusNeq expands to a disjunction of RunTestStatusNeq values. nolint:ireturn // TODO: Fix ireturn lint error

func (*TestStatusNeq) UnmarshalJSON

func (tsn *TestStatusNeq) UnmarshalJSON(b []byte) error

UnmarshalJSON for TestStatusNeq attempts to interpret a query atom as {"product": <browser name>, "status": {"not": <status string>}}.

type TestWebFeature

type TestWebFeature struct {
	WebFeature      string
	WebFeaturesData shared.WebFeaturesData
}

TestWebFeature is a ConcreteQuery of AbstractTestWebFeature.

func (TestWebFeature) Size

func (TestWebFeature) Size() int

Size of TestWebFeature has a size of 1: servicing such a query requires a web feature match per Web Features Node.

type TestWebFeatureAtom

type TestWebFeatureAtom struct {
	WebFeature string
}

TestWebFeatureAtom contains the parsed data from a "feature" query atom.

func (*TestWebFeatureAtom) UnmarshalJSON

func (t *TestWebFeatureAtom) UnmarshalJSON(b []byte) error

UnmarshalJSON for TestWebFeatureAtom attempts to interpret a query atom as {"feature":<web_feature_string>}.

type Triaged

type Triaged struct {
	Run      int64
	Metadata map[string][]string
}

Triaged is a ConcreteQuery of AbstractTriaged.

func (Triaged) Size

func (Triaged) Size() int

Size of Triaged is 1: servicing such a query requires a single lookup in a test run result mapping per test.

type True

type True struct{}

True is a true-valued ConcreteQuery.

func (True) BindToRuns

func (t True) BindToRuns(_ ...shared.TestRun) ConcreteQuery

BindToRuns for True is a no-op; it is independent of test runs. nolint:ireturn // TODO: Fix ireturn lint error

func (True) Size

func (True) Size() int

Size of True is 0: It should be optimized out of queries in practice.

Directories

Path Synopsis
cache
backfill/mock_backfill
Package mock_backfill is a generated GoMock package.
Package mock_backfill is a generated GoMock package.
index
Package index is a generated GoMock package.
Package index is a generated GoMock package.
lru
monitor
Package monitor is a generated GoMock package.
Package monitor is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL