models

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	gorm.Model
	ProjectID uint
	Name      string
	Token     string
	ExpiresAt *time.Time
}

type App

type App struct {
	gorm.Model
	ProjectID        uint
	Project          *Project
	Name             string
	Identifier       string
	Platform         PlatformType
	DefaultParameter string
}

type AppBinary

type AppBinary struct {
	gorm.Model
	AppID          uint
	App            *App
	Name           string
	Platform       string
	Version        string
	AppPath        string
	Identifier     string
	LaunchActivity string
	Additional     string
	Hash           string
	Size           int
	Tags           string
}

func (*AppBinary) AfterCreate

func (a *AppBinary) AfterCreate(tx *gorm.DB) (err error)

type Company

type Company struct {
	gorm.Model
	Token    string
	Name     string
	Users    []*User `gorm:"many2many:user_companies;"`
	Projects []Project
}

type ConnectionParameter

type ConnectionParameter struct {
	gorm.Model
	DeviceID       uint
	ConnectionType ConnectionType
	IP             string
	Port           int
}

type ConnectionType

type ConnectionType int
const (
	ConnectionTypeUSB ConnectionType = iota
	ConnectionTypeRemote
)

type Device

type Device struct {
	gorm.Model
	CompanyID           uint
	DeviceIdentifier    string
	DeviceType          DeviceType
	Name                string
	Manager             string
	HardwareModel       string
	RAM                 float32
	SOC                 string
	DisplaySize         string
	DPI                 float32
	OS                  string
	OSVersion           string
	OSInfos             string
	GPU                 string
	ABI                 string
	OpenGLESVersion     float32
	Parameter           []DeviceParameter
	StatusLog           []DeviceLog
	ConnectionParameter ConnectionParameter
	IsAcknowledged      bool
	Status              device.State `gorm:"-"`
	Dev                 interface{}  `gorm:"-"`
	Connection          interface{}  `gorm:"-"`
}

func (*Device) GetAttribute

func (d *Device) GetAttribute(key string) string

type DeviceLog

type DeviceLog struct {
	gorm.Model
	DeviceID uint
	Time     time.Time
	Status   device.State
	Payload  string
}

type DeviceParameter

type DeviceParameter struct {
	gorm.Model
	DeviceID uint
	Key      string
	Value    string
}

type DeviceType

type DeviceType int
const (
	DeviceTypePhone DeviceType = iota
	DeviceTypeTablet
	DeviceTypeDesktop
	DeviceTypeUnityEditor
)

type Devices

type Devices []*Device

type ExecutionType

type ExecutionType uint
const (
	ConcurrentExecutionType     ExecutionType = iota // each test on a different free device ( faster results )
	SimultaneouslyExecutionType                      // every test on every device ( more accuracy )
)

type PlatformType

type PlatformType uint
const (
	PlatformTypeiOS PlatformType = iota
	PlatformTypeAndroid
	PlatformTypeMac
	PlatformTypeWindows
	PlatformTypeLinux
	PlatformTypeWeb
	PlatformTypeEditor
)

type Project

type Project struct {
	gorm.Model
	Identifier   string
	Name         string
	CompanyID    uint
	Company      *Company
	AccessTokens []*AccessToken
	Users        []*User `gorm:"many2many:user_projects;"`
	Apps         []*App
}

type ProtocolEntry

type ProtocolEntry struct {
	gorm.Model
	TestProtocolID uint
	Timestamp      time.Time
	Source         string
	Level          string
	Message        string
	Data           string
	Runtime        float64
}

type ProtocolPerformanceEntry

type ProtocolPerformanceEntry struct {
	gorm.Model
	TestProtocolID uint
	Checkpoint     string
	FPS            float32 `sql:"type:decimal(10,2);"`
	MEM            float32 `sql:"type:decimal(10,2);"`
	CPU            float32 `sql:"type:decimal(10,2);"`
	Other          string
	Runtime        float64
}

type ScenarioStep

type ScenarioStep struct {
	gorm.Model
	TestConfigScenarioID uint
	StepType             StepType
	InstallIdentifier    string
	Checkpoint           string
	AppIdentifier        string
	TestName             string
}

type StepType

type StepType uint
const (
	StepTypeInstallApp StepType = iota
	StepTypeUninstallApp
	StepTypeStartApp
	StepTypeStopApp
	StepTypeExecuteTest
	StepTypeCheckpoint
)

type Test

type Test struct {
	gorm.Model
	AppID      uint
	App        *App
	Name       string
	TestConfig TestConfig
	TestRuns   []TestRun
	Last       *TestRun
}

type TestConfig

type TestConfig struct {
	gorm.Model
	TestID        uint
	ExecutionType ExecutionType
	Type          TestType
	AllDevices    bool
	Devices       []TestConfigDevice
	Unity         *TestConfigUnity
	// Cocos 	*CocosTestConfig
	// Serenity *SerenityTestConfig
	Scenario *TestConfigScenario
}

func (*TestConfig) GetDeviceIds

func (t *TestConfig) GetDeviceIds() []uint

type TestConfigDevice

type TestConfigDevice struct {
	gorm.Model
	TestConfigID uint
	DeviceID     uint
	Device       Device
}

type TestConfigScenario

type TestConfigScenario struct {
	gorm.Model
	TestConfigID uint
	Steps        []ScenarioStep
}

type TestConfigUnity

type TestConfigUnity struct {
	gorm.Model
	TestConfigID       uint
	RunAllTests        bool
	UnityTestFunctions []UnityTestFunction
	Categories         string
	PlayMode           bool
}

type TestProtocol

type TestProtocol struct {
	gorm.Model
	TestRunID   uint
	DeviceID    *uint
	Device      *Device
	TestName    string
	StartedAt   time.Time
	EndedAt     *time.Time
	Entries     []ProtocolEntry
	TestResult  TestResultState
	Performance []ProtocolPerformanceEntry
	AvgFPS      float32 `sql:"type:decimal(10,2);"`
	AvgMEM      float32 `sql:"type:decimal(10,2);"`
	AvgCPU      float32 `sql:"type:decimal(10,2);"`
	// calculated fields
	HistAvgFPS          float32        `db:"-" gorm:"-:all"`
	HistAvgMEM          float32        `db:"-" gorm:"-:all"`
	HistAvgCPU          float32        `db:"-" gorm:"-:all"`
	TestProtocolHistory []TestProtocol `db:"-" gorm:"-:all"`
}

type TestResultState

type TestResultState uint
const (
	TestResultOpen TestResultState = iota
	TestResultUnstable
	TestResultFailed
	TestResultSuccess
)

type TestRun

type TestRun struct {
	gorm.Model
	TestID       uint
	Test         *Test
	AppBinaryID  uint
	AppBinary    *AppBinary
	SessionID    string
	Parameter    string
	Protocols    []TestProtocol
	Log          []TestRunLogEntry
	DeviceStatus []TestRunDeviceStatus
}

type TestRunDeviceStatus

type TestRunDeviceStatus struct {
	gorm.Model
	TestRunID   uint
	DeviceID    uint
	Device      *Device
	StartupTime uint

	// calculated fields
	HistAvgStartupTime uint `db:"-" gorm:"-:all"`
}

type TestRunLogEntry

type TestRunLogEntry struct {
	gorm.Model
	TestRunID uint
	Level     string
	Log       string
}

type TestType

type TestType uint
const (
	TestTypeUnity TestType = iota
	TestTypeCocos
	TestTypeSerenity
	TestTypeScenario
)

type UnityTestFunction

type UnityTestFunction struct {
	gorm.Model
	TestConfigUnityID uint
	Assembly          string
	Class             string
	Method            string
}

type User

type User struct {
	gorm.Model
	Name      string
	Auth      []UserAuth
	Companies []*Company `gorm:"many2many:user_companies;"`
	Projects  []*Project `gorm:"many2many:user_projects;"`
}

type UserAuth

type UserAuth struct {
	gorm.Model
	UserID       uint
	Provider     string
	Token        string
	Username     string
	Email        string
	PasswordHash string
}

Jump to

Keyboard shortcuts

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