mobiledevice

package
v1.338.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mobiledevice holds the names and types of the Nexus service through which a pipeline, in its organization namespace, runs its device work in the namespace of each device's runner: preparing the device, running each mobile-automation step and cleaning the device.

Index

Constants

View Source
const (
	// ServiceName is the Nexus service every runner namespace serves.
	ServiceName = "mobile-device"

	// PrepareOperationName starts PrepareWorkflowName.
	PrepareOperationName = "Prepare a mobile device"
	// PrepareWorkflowName prepares one device for a pipeline run.
	PrepareWorkflowName = "Prepare a mobile device"
	// RunStepOperationName starts StepWorkflowName.
	RunStepOperationName = "Run a mobile automation step"
	// StepWorkflowName runs one mobile-automation step.
	StepWorkflowName = "Run a mobile automation workflow"
	// CleanUpOperationName starts CleanUpWorkflowName.
	CleanUpOperationName = "Clean up a mobile device"
	// CleanUpWorkflowName cleans one device after a pipeline run.
	CleanUpWorkflowName = "Clean up a mobile device"

	// PipelineRunMemoKey is the memo key naming the pipeline run a runner
	// namespace workflow belongs to.
	PipelineRunMemoKey = "credimi_pipeline_run"
)

Variables

This section is empty.

Functions

func CleanUpSummary

func CleanUpSummary(deviceID string) string

CleanUpSummary names the Clean up operation and workflow of deviceID in the Temporal UI, e.g. "Clean up a mobile device (pixel-7a)".

func CleanUpWorkflowID

func CleanUpWorkflowID(pipelineWorkflowID, deviceID string) string

CleanUpWorkflowID is the ID of the workflow that cleans deviceID after the pipeline run pipelineWorkflowID.

func PrepareSummary

func PrepareSummary(deviceID string) string

PrepareSummary names the Prepare operation and workflow of deviceID in the Temporal UI, e.g. "Prepare a mobile device (pixel-7a)".

func PrepareWorkflowID

func PrepareWorkflowID(pipelineWorkflowID, deviceID string) string

PrepareWorkflowID is the ID of the workflow that prepares deviceID for the pipeline run pipelineWorkflowID.

Types

type CleanUpInput

type CleanUpInput struct {
	WorkflowID string `json:"workflow_id"`
	DeviceID   string `json:"device_id"`
	// Device is the setted_devices entry Prepare returned.
	Device           map[string]any               `json:"device"`
	RunIdentifier    string                       `json:"run_identifier"`
	ExecutionTimeout time.Duration                `json:"execution_timeout"`
	Pipeline         PipelineRun                  `json:"pipeline"`
	Workflow         workflowengine.WorkflowInput `json:"workflow"`
}

CleanUpInput cleans one device after a pipeline run.

type CleanUpResult

type CleanUpResult struct {
	ResultVideoURLs []string `json:"result_video_urls"`
	ScreenshotURLs  []string `json:"screenshot_urls"`
	Warnings        []string `json:"warnings"`
	Errors          []string `json:"errors"`
}

CleanUpResult is the evidence the device cleanup stored and what went wrong.

type MobileDeviceRequest

type MobileDeviceRequest struct {
	DeviceID          string `json:"device_id"`          // canonified device path
	VersionIdentifier string `json:"version_identifier"` // wallet version identifier to install
	StepID            string `json:"step_id"`            // label used in errors and run identifiers
	RunIdentifier     string `json:"run_identifier"`
	// PackageID is the package of an app installed outside Credimi, with
	// VersionIdentifier MobileExternalSourceVersionID. Its `installed` entry
	// only provides PreparedMobileDevice.PackageID: cleanup removes the app by
	// the diff against the initial_installed_apps recorded at prepare.
	PackageID string `json:"package_id,omitempty"`
}

MobileDeviceRequest names one device to prepare for a run.

type PipelineRun

type PipelineRun struct {
	// Namespace is the pipeline's organization namespace.
	Namespace  string `json:"namespace"`
	WorkflowID string `json:"workflow_id"`
	RunID      string `json:"run_id"`
}

PipelineRun names the pipeline run that owns a runner-namespace workflow.

type PrepareInput

type PrepareInput struct {
	WorkflowID string                `json:"workflow_id"`
	DeviceID   string                `json:"device_id"`
	Requests   []MobileDeviceRequest `json:"requests"`
	// Device is the entry of a device the calling pipeline's parent already
	// prepared. With it, Prepare prepares only the requests: it changes no
	// device setting, starts no log or recording, and never cleans the device.
	Device           map[string]any `json:"device,omitempty"`
	RunIdentifier    string         `json:"run_identifier"`
	DisablePlayStore bool           `json:"disable_play_store"`
	NoVideo          bool           `json:"no_video"`
	ExecutionTimeout time.Duration  `json:"execution_timeout"`
	Pipeline         PipelineRun    `json:"pipeline"`
	// Workflow carries the pipeline's activity options and config; its
	// payload is unused.
	Workflow workflowengine.WorkflowInput `json:"workflow"`
}

PrepareInput prepares one device for every mobile step of a pipeline run that uses it.

type PrepareResult

type PrepareResult struct {
	// Device is the device's setted_devices entry.
	Device map[string]any `json:"device"`
	// Steps is the prepared device of each step, by step ID.
	Steps map[string]PreparedMobileDevice `json:"steps"`
}

PrepareResult is the prepared device.

type PreparedMobileDevice

type PreparedMobileDevice struct {
	RunnerID string `json:"runner_id"`
	// Serial is the adb serial, or the UDID of the run's simulator clone.
	Serial string `json:"serial"`
	Type   string `json:"type"`
	// PackageID is the Android package or the iOS bundle ID.
	PackageID string `json:"package_id"`
	// InstallerPath is the runner-host path of the installed APK or .app.
	InstallerPath string `json:"installer_path"`
}

PreparedMobileDevice is what a run needs to drive the prepared device.

type RunStepInput

type RunStepInput struct {
	// WorkflowID is the step's task workflow ID.
	WorkflowID       string        `json:"workflow_id"`
	ExecutionTimeout time.Duration `json:"execution_timeout"`
	Pipeline         PipelineRun   `json:"pipeline"`
	// Input is the step workflow's input; its config holds the step ID.
	Input workflowengine.WorkflowInput `json:"input"`
}

RunStepInput runs one mobile-automation step.

Jump to

Keyboard shortcuts

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