lib

package module
v0.0.0-...-14868f9 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRepo

func CloneRepo(cloneURL string, commitRef string) (string, error)

func ConnectDB

func ConnectDB(dbConfig DBConfig) *sqlx.DB

func IsCore

func IsCore(path string) bool

func IsLibrary

func IsLibrary(path string) bool

func ListenChannel

func ListenChannel(dbConfig DBConfig, channelName string, cb func(*pq.Notification))

Types

type CheckSuite

type CheckSuite struct {
	ID                   int       `db:"id"`
	GitHubID             int64     `db:"github_id"`
	Status               string    `db:"status"`
	GitHubInstallationID int64     `db:"github_installation_id"`
	RepoName             string    `db:"repo_name"`
	RepoOwner            string    `db:"repo_owner"`
	RepoCloneURL         string    `db:"repo_clone_url"`
	CommitRef            string    `db:"commit_ref"`
	Created              time.Time `db:"created"`
}

CheckSuite represents a check suite notified by GitHub.

type DBConfig

type DBConfig struct {
	DSN string
}

type GlobalTestRequirements

type GlobalTestRequirements struct {
	RequireWiring []string `yaml:"require-wiring"`
}

type Job

type Job struct {
	ID               int                    `db:"id"`
	CheckSuiteID     int                    `db:"check_suite"`
	GitHubCheckRunID int64                  `db:"github_check_run_id"`
	Status           string                 `db:"status"`
	GitHubStatus     *string                `db:"github_status"`
	Runner           *string                `db:"runner"`
	SkippedByRunners pq.StringArray         `db:"skipped_by_runners"`
	TestRequirements TestRequirementsMatrix `db:"test_requirements"`
	Tests            Tests                  `db:"test_results"`
	Start            *time.Time             `db:"ts_start"`
	End              *time.Time             `db:"ts_end"`
}

Job represents the work that a single runner can do within a single CI workflow.

func (*Job) DeviceFQBNs

func (j *Job) DeviceFQBNs() (out []string)

func (*Job) Name

func (j *Job) Name() string

Name returns a formatted name representing this job.

func (*Job) Report

func (j *Job) Report() (out string)

func (*Job) StatusFromResults

func (j *Job) StatusFromResults() string

type PackageType

type PackageType int
const (
	Sketch PackageType = iota
	Library
	Core
)

type SketchRequirements

type SketchRequirements struct {
	RequireFQBN         string   `yaml:"require-fqbn"`
	RequireArchitecture string   `yaml:"require-architecture"`
	RequireFeatures     []string `yaml:"require-features"`
}

type Test

type Test struct {
	TestYML
	Path        string // absolute path to the test directory
	PackagePath string // absolute path to the package containing the test (if any)
	PackageType PackageType
	Status      string // success, failure, skipped
	Output      string
	DeviceFQBNs []string
}

Test represents a directory containing a cino.yml file.

func FindTests

func FindTests(path string) ([]Test, error)

FindTests looks for all the cino.yml files under the given path, detects the type of package contains them and returns a slice of Test objects.

func NewTest

func NewTest(path, packagePath string, packageType PackageType) (*Test, error)

NewTest instantiates a new Test object.

func (*Test) GetRequirements

func (test *Test) GetRequirements() TestRequirements

func (*Test) RelPath

func (test *Test) RelPath() string

RelPath returns the test path relative to the repository root.

type TestRequirements

type TestRequirements struct {
	GlobalTestRequirements
	Sketches []SketchRequirements
}

func (*TestRequirements) Clone

func (tr *TestRequirements) Clone() (out TestRequirements)

func (TestRequirements) Equals

func (tr TestRequirements) Equals(tr2 TestRequirements) bool

type TestRequirementsMatrix

type TestRequirementsMatrix struct {
	Original  TestRequirements // the test requirements as parsed from the original test
	Effective TestRequirements // the test requirements to use (with potentially more requirements)
}

func (*TestRequirementsMatrix) Scan

func (a *TestRequirementsMatrix) Scan(value interface{}) error

func (TestRequirementsMatrix) Value

type TestYML

type TestYML struct {
	GlobalTestRequirements `yaml:",inline"`
	Sketches               []testSketch
}

TestYML represents the contents of a cino.yml file.

type Tests

type Tests []Test

func (*Tests) Scan

func (a *Tests) Scan(value interface{}) error

func (Tests) Value

func (a Tests) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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