framework

package
v0.131.1-alpha3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PackageFromFile = node.PackageFromFile
	NewConstraint   = semver.NewConstraint
)

Monkey patch functions to allow mocking during unit testing

Functions

func GitReleaseSegments added in v0.30.0

func GitReleaseSegments(m *Metadata) (org, repo, tag string, err error)

GitReleaseSegments segments GitRelease into separate parts of org, repo and tag. Returns an error if GitRelease is malformed. The expected GitRelease format is "org/repo:tag".

func HasPlatform added in v0.101.0

func HasPlatform(m Metadata, platform string) bool

HasPlatform returns true if the provided Metadata has a matching platform.

func PlatformNames added in v0.101.0

func PlatformNames(platforms []Platform) []string

PlatformNames extracts platform names from the given platforms and returns them.

Types

type ExactStrategy added in v0.90.0

type ExactStrategy struct {
}

ExactStrategy searches for the metadata of a framework by its exact version

func (ExactStrategy) Find added in v0.90.0

func (s ExactStrategy) Find(ctx context.Context, svc MetadataService, frameworkName string, frameworkVersion string) (Metadata, error)

type Framework

type Framework struct {
	Name    string
	Version string
}

Framework represents a test framework (e.g. cypress).

type Metadata added in v0.30.0

type Metadata struct {
	FrameworkName      string
	FrameworkVersion   string
	EOLDate            time.Time
	RemovalDate        time.Time
	DockerImage        string
	GitRelease         string
	Platforms          []Platform
	CloudRunnerVersion string
	BrowserDefaults    map[string]string
}

Metadata represents test runner metadata.

func (*Metadata) IsDeprecated added in v0.121.0

func (m *Metadata) IsDeprecated() bool

func (*Metadata) IsFlaggedForRemoval added in v0.121.0

func (m *Metadata) IsFlaggedForRemoval() bool

type MetadataSearchStrategy added in v0.90.0

type MetadataSearchStrategy interface {
	Find(ctx context.Context, svc MetadataService, frameworkName string, searchValue string) (Metadata, error)
}

MetadataSearchStrategy is a generic strategy for determining if the requested framework version is supported

func NewSearchStrategy added in v0.90.0

func NewSearchStrategy(version string, rootDir string) MetadataSearchStrategy

NewSearchStrategy returns a concrete MetadataSearchStrategy

type MetadataService added in v0.30.0

type MetadataService interface {
	Search(ctx context.Context, opts SearchOptions) (Metadata, error)

	Frameworks(ctx context.Context) ([]Framework, error)
	Versions(ctx context.Context, frameworkName string) ([]Metadata, error)
}

MetadataService represents an interface for retrieving framework metadata.

type PackageStrategy added in v0.90.0

type PackageStrategy struct {
	// contains filtered or unexported fields
}

PackageStrategy searches for metadata of a framework from a package.json file. If the requested version is a range (e.g. ~9.0.0), it matches the most recent version that satisfies the constraint.

func (PackageStrategy) Find added in v0.90.0

func (s PackageStrategy) Find(ctx context.Context, svc MetadataService, frameworkName string, frameworkVersion string) (Metadata, error)

type Platform added in v0.49.0

type Platform struct {
	PlatformName string
	BrowserNames []string
}

Platform represent a supported platform.

type SearchOptions added in v0.30.0

type SearchOptions struct {
	Name             string
	FrameworkVersion string
}

SearchOptions represents read query options for MetadataService.Search().

type UnavailableError added in v0.106.0

type UnavailableError struct {
	Name    string
	Version string
}

UnavailableError is an error type returned if the requested framework version is unavailable.

func (*UnavailableError) Error added in v0.106.0

func (e *UnavailableError) Error() string

Error returns the error string

Jump to

Keyboard shortcuts

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