ufm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOptimizedFormat

func BuildOptimizedFormat(findings []testapi.FindingData) (map[string]json.RawMessage, map[string][]string, []testapi.FindingData)

BuildOptimizedFormat extracts problems into a central store and creates references. Returns: problemStore, problemRefs, optimizedFindings

func CreateWorkflowDataFromTestResults

func CreateWorkflowDataFromTestResults(id workflow.Identifier, results []testapi.TestResult) workflow.Data

CreateWorkflowDataFromTestResults converts TestResults to JSON-serializable format, serializes them to JSON bytes, and wraps them in workflow.Data. This ensures the results can be safely persisted, cached, or transmitted.

func GetTestResultsFromWorkflowData

func GetTestResultsFromWorkflowData(data workflow.Data) []testapi.TestResult

GetTestResultsFromWorkflowData extracts and deserializes TestResults from workflow.Data. The data is expected to be JSON bytes created by CreateWorkflowDataFromTestResults.

func NewSerializableTestResult

func NewSerializableTestResult(ctx context.Context, tr testapi.TestResult) (testapi.TestResult, error)

NewSerializableTestResult converts a testapi.TestResult to a JSON-serializable format. It fetches findings from the source TestResult and optimizes the format by: 1. Extracting problems into a central problemStore 2. Replacing problems in findings with references The returned TestResult can be safely marshaled to JSON using json.Marshal.

func NewSerializableTestResultFromBytes

func NewSerializableTestResultFromBytes(jsonBytes []byte) ([]testapi.TestResult, error)

func ReconstructFindings

func ReconstructFindings(result *jsonTestResult) error

ReconstructFindings rebuilds full findings from problemStore and problemRefs. It returns an error if any problems fail to reconstruct. After successful reconstruction, it clears the optimized data to free memory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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