framework

package
v0.188.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0 Imports: 10 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 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
	Runtimes           []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

func (*Metadata) SupportsRuntime added in v0.185.0

func (m *Metadata) SupportsRuntime(runtimeName string) bool

SupportsRuntime checks if the current runner supports the specified runtime.

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 {
	Frameworks(ctx context.Context) ([]string, error)
	Versions(ctx context.Context, frameworkName string) ([]Metadata, error)
	Runtimes(ctx context.Context) ([]runtime.Runtime, 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, _ string) (Metadata, error)

type Platform added in v0.49.0

type Platform struct {
	PlatformName string
	BrowserNames []string
}

Platform represent a supported platform.

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