common

package
v0.0.0-...-f4b31ea Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package common is the common package.

Package common is the common package.

Package common is the common package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlexibleTFFlag

func AddFlexibleTFFlag(tp *api.InternalTestplan)

append the magical `FlexibleTF` key on the suiteArgs to be processed by cros-test.

func Converter

func Converter(deps []*api.TestCase_Dependency) []*api.TestCase_Dependency

Converter will convert and revert the TC dependency in case its in the legacy style.

func ExtractBucketAndPrefixFromPath

func ExtractBucketAndPrefixFromPath(gcsPath string) (bucketName, prefix string, err error)

func FindNewestDirInGcsBucket

func FindNewestDirInGcsBucket(ctx context.Context, gcsBasePath string, bucket *storage.BucketHandle, pf string) (string, error)

func GenerateSuiteInfo

func GenerateSuiteInfo() *api.SuiteInfo

GenerateSuiteInfo creates SuiteInfo to be used in unittests.

func GenerateSuiteInfoTF

func GenerateSuiteInfoTF() *api.SuiteInfo

GenerateSuiteInfo creates SuiteInfo to be used in unittests.

func GenerateTestMetadata

func GenerateTestMetadata() []*api.TestCaseMetadata

GenerateTestMetadata creates TestCaseMetadata to be used in unittests.

func PullAllFilesFromGcsDir

func PullAllFilesFromGcsDir(ctx context.Context, bucket *storage.BucketHandle, dir string, postfix string) ([][]byte, error)

PullAllFilesFromGcsDir will grab all the files from a dir matching the postfix

func TestSuiteFromTestplan

func TestSuiteFromTestplan(req *api.InternalTestplan) ([]*api.TestSuite, error)

TestSuiteFromTestplan will create the TestSuite from the TestPlan (req).

func TranslateTCMtoCTPTC

func TranslateTCMtoCTPTC(matchingTests []*api.TestCaseMetadata) (CTPTCs []*api.CTPTestCase)

TranslateTCMtoCTPTC will translate []*api.TestCaseMetadata to []*api.CTPTestCase

Types

type AbstractFinder

type AbstractFinder struct {
	FinderInterface

	FinderHarness FinderHarness

	Testplan *api.InternalTestplan

	Logger *log.Logger
	// contains filtered or unexported fields
}

AbstractFinder satisfies the executor requirement that is common to all.

func NewAbstractFinder

func NewAbstractFinder(ctx context.Context, req *api.InternalTestplan, exType FinderHarness, log *log.Logger) *AbstractFinder

NewAbstractFinder provides a new Abstract Finder

func (*AbstractFinder) GetFinderHarness

func (ex *AbstractFinder) GetFinderHarness() FinderHarness

GetFinderHarness returns the type of the FinderHarness.

type FinderHarness

type FinderHarness string

type FinderInterface

type FinderInterface interface {
	// GetFinderHarness returns the executor type.
	GetFinderHarness() FinderHarness

	// ExecuteCommand executes the provided command via current executor.
	FindTestsAB() (*api.InternalTestplan, error)
}

FinderInterface defines the contract an executor will have to satisfy.

Jump to

Keyboard shortcuts

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