database

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: AGPL-3.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrGetCommit

func CreateOrGetCommit(db *sqlx.DB, commit model.Commit) (*model.Commit, error)

func CreateUpload

func CreateUpload(db *sqlx.DB, upload model.Upload) (*model.Upload, error)

func GetTestName added in v0.0.8

func GetTestName(db *sqlx.DB, testID int) (string, error)

func InsertTests

func InsertTests(db *sqlx.DB, tests []model.TestResult, upload model.Upload) error

func New

func New(path string) *sqlx.DB

New creates a db instance.

func UpdateFlakyTests added in v0.0.8

func UpdateFlakyTests(db *sqlx.DB, commitID int) error

Types

type FlakyTest

type FlakyTest struct {
	ID        int     `db:"test_id"`
	Name      string  `db:"name"`
	Successes int     `db:"successes"`
	Fails     int     `db:"fails"`
	Score     float32 `db:"score"`
}

func GetFlakyTests

func GetFlakyTests(db *sqlx.DB, lastNDays int) ([]FlakyTest, error)

type TestFailure added in v0.0.7

type TestFailure struct {
	UploadID  int       `db:"upload_id"`
	Date      time.Time `db:"last_fail"`
	CommitSHA string    `db:"commit_sha"`
	URL       *string   `db:"url"`
}

func GetFailures added in v0.0.7

func GetFailures(db *sqlx.DB, testID int) ([]TestFailure, error)

type TestResult added in v0.0.8

type TestResult struct {
	UploadID  int     `db:"upload_id"`
	TestID    int     `db:"test_id"`
	Name      string  `db:"test_name"`
	CommitSHA string  `db:"commit_sha"`
	URL       *string `db:"url"`
	Success   bool    `db:"success"`
	Output    *string `db:"test_output"`
	Date      string  `db:"time"`
}

func GetTestResult added in v0.0.8

func GetTestResult(db *sqlx.DB, testID, uploadID int) (TestResult, error)

Jump to

Keyboard shortcuts

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