Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions internal/build/cmd/generate/commands/genexamples/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func init() {
}

// EnabledFiles contains a list of files where documentation should be generated.
//
var EnabledFiles = []string{
"aggregations/bucket/datehistogram-aggregation.asciidoc",
"aggregations/bucket/filter-aggregation.asciidoc",
Expand Down Expand Up @@ -103,7 +102,6 @@ var (
// Example represents the code example in documentation.
//
// See: https://github.com/elastic/built-docs/blob/master/raw/en/elasticsearch/reference/master/alternatives_report.json
//
type Example struct {
SourceLocation struct {
File string
Expand All @@ -115,7 +113,6 @@ type Example struct {
}

// IsEnabled returns true when the example should be processed.
//
func (e Example) IsEnabled() bool {
// TODO(karmi): Use "filepatch.Match()" to support glob patterns

Expand All @@ -129,38 +126,32 @@ func (e Example) IsEnabled() bool {
}

// IsExecutable returns true when the example contains a request.
//
func (e Example) IsExecutable() bool {
return reHTTPMethod.MatchString(e.Source)
}

// IsTranslated returns true when the example can be converted to Go source code.
//
func (e Example) IsTranslated() bool {
return Translator{Example: e}.IsTranslated()
}

// ID returns example identifier.
//
func (e Example) ID() string {
return fmt.Sprintf("%s:%d", e.SourceLocation.File, e.SourceLocation.Line)
}

// Chapter returns the example chapter.
//
func (e Example) Chapter() string {
r := strings.NewReplacer("/", "_", "-", "_", ".asciidoc", "")
return r.Replace(e.SourceLocation.File)
}

// GithubURL returns a link for the example source.
//
func (e Example) GithubURL() string {
return fmt.Sprintf("https://github.com/elastic/elasticsearch/blob/master/docs/reference/%s#L%d", e.SourceLocation.File, e.SourceLocation.Line)
}

// Commands returns the list of commands from source.
//
func (e Example) Commands() ([]string, error) {
var (
buf strings.Builder
Expand Down Expand Up @@ -200,7 +191,6 @@ func (e Example) Commands() ([]string, error) {
}

// Translated returns the code translated from Console to Go.
//
func (e Example) Translated() (string, error) {
return Translator{Example: e}.Translate()
}
4 changes: 0 additions & 4 deletions internal/build/cmd/generate/commands/gensource/overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,15 @@ var (
)

// OverrideFunc defines a function to override generated code for endpoint.
//
type OverrideFunc func(*Endpoint, ...interface{}) string

// OverrideRule represents an override rule.
//
type OverrideRule struct {
Func OverrideFunc
Matching []string
}

// GetOverride returns an override function for id and API name.
//
func (g *Generator) GetOverride(id, apiName string) OverrideFunc {
if rr, ok := overrideRules[id]; ok {
for _, r := range rr {
Expand All @@ -46,7 +43,6 @@ func (g *Generator) GetOverride(id, apiName string) OverrideFunc {
}

// Match returns true when API name matches a rule.
//
func (r OverrideRule) Match(apiName string) bool {
for _, v := range r.Matching {
if v == "*" {
Expand Down
1 change: 0 additions & 1 deletion internal/build/cmd/generate/commands/gentests/patches.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var (
)

// PatchTestSource performs a regex based patching of the input.
//
func PatchTestSource(fpath string, r io.Reader) (io.Reader, error) {
c, err := ioutil.ReadAll(r)
if err != nil {
Expand Down
38 changes: 31 additions & 7 deletions internal/build/cmd/generate/commands/gentests/skips.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package gentests

import (
"fmt"
"gopkg.in/yaml.v2"
"strings"

"gopkg.in/yaml.v2"
)

var skipTests map[string][]string
Expand Down Expand Up @@ -80,8 +81,12 @@ var skipFiles = []string{
"update/100_synthetic_source.yml",
"tsdb/160_nested_fields.yml",
"tsdb/90_unsupported_operations.yml",
"cluster.component_template/.*.yml",
"indices.put_index_template/.*.yml",
"ml/forecast.yml",
".*inference/.*.yml", // incompatible inference tests
".*mustache/.*.yml", // incompatible mustache tests
"data_stream/240_data_stream_settings.yml",
}

// TODO: Comments into descriptions for `Skip()`
Expand Down Expand Up @@ -466,12 +471,6 @@ data_streams/10_data_stream_resolvability.yml:
data_stream/230_data_stream_options.yml:
- Test partially resetting failure store options in template composition

data_stream/240_data_stream_settings.yml:
- Test single data stream
- Test dry run
- Test null out settings
- Test null out settings component templates only

# Error: constant 9223372036854775808 overflows int (https://play.golang.org/p/7pUdz-_Pdom)
unsigned_long/10_basic.yml:
unsigned_long/20_null_value.yml:
Expand Down Expand Up @@ -662,4 +661,29 @@ search.vectors/41_knn_search_half_byte_quantized.yml:
tsdb/25_id_generation.yml:
- delete over _bulk

# Data stream mappings tests failing in Go test suite
data_stream/250_data_stream_mappings.yml:
- "Test single data stream"
- "Test mappings component templates only"

# Data streams stats failing for multiple data streams scenario
data_stream/120_data_streams_stats.yml:
- "Multiple data stream"

# Search vectors synthetic dense vectors failures (include and update cases)
search.vectors/240_source_synthetic_dense_vectors.yml:
- "include synthetic vectors"
- "Bulk partial update with synthetic vectors"
- "Partial update with synthetic vectors"

# Search vectors synthetic sparse vectors failures (include and update cases)
search.vectors/250_source_synthetic_sparse_vectors.yml:
- "include synthetic vectors"
- "Bulk partial update with synthetic vectors"
- "Partial update with synthetic vectors"

rank_vectors/rank_vectors_synthetic_vectors.yml:
- "include synthetic vectors"
- "Bulk partial update with synthetic vectors"
- "Partial update with synthetic vectors"
`
Loading