utils

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeWD

func ChangeWD(t *testing.T, newPath string) string

func ChangeWDWithCallback added in v1.12.4

func ChangeWDWithCallback(t *testing.T, newPath string) func()

func CreateSecurityPolicy added in v1.14.0

func CreateSecurityPolicy(t *testing.T, policyName string, rules ...xrayApi.PolicyRule) (string, func())

func CreateTestIgnoreRules added in v1.14.0

func CreateTestIgnoreRules(t *testing.T, description string, filters xrayApi.IgnoreFilters) func()

func CreateTestPolicyAndWatch added in v1.14.0

func CreateTestPolicyAndWatch(t *testing.T, policyName, watchName string, severity xrayApi.Severity) (string, func())

func CreateTestProjectEnvAndChdir added in v1.12.4

func CreateTestProjectEnvAndChdir(t *testing.T, projectPath string) (string, func())

func CreateTestProjectFromZip added in v1.15.0

func CreateTestProjectFromZip(t *testing.T, projectPath string) (string, func())

'projectPath' directory should contains a single zip file in the format: fmt.Sprintf("%s.zip", filepath.Base(projectPath))

func CreateTestProjectFromZipAndChdir added in v1.15.0

func CreateTestProjectFromZipAndChdir(t *testing.T, projectPath string) (string, func())

'projectPath' directory should contains a single zip file in the format: fmt.Sprintf("%s.zip", filepath.Base(projectPath))

func CreateTestProjectInTempDir added in v1.12.4

func CreateTestProjectInTempDir(t *testing.T, projectPath string) (string, func())

func CreateTestSecurityPolicy added in v1.14.0

func CreateTestSecurityPolicy(t *testing.T, policyName string, severity xrayApi.Severity, failBuild bool, skipNotApplicable bool) (string, func())

func CreateWatchOnAllBuilds added in v1.23.0

func CreateWatchOnAllBuilds(t *testing.T, policyName, watchName string) (string, func())

func CreateWatchOnArtifactoryRepos added in v1.23.0

func CreateWatchOnArtifactoryRepos(t *testing.T, policyName, watchName string, repos ...string) (string, func())

func CreateWatchOnGitResources added in v1.23.0

func CreateWatchOnGitResources(t *testing.T, policyName, watchName string, gitResources ...string) (string, func())

func CreateWatchOnProjectBuilds added in v1.23.0

func CreateWatchOnProjectBuilds(t *testing.T, policyName, watchName, projectKey string) (string, func())

func GetAndValidateXrayVersion added in v1.15.0

func GetAndValidateXrayVersion(t *testing.T, minVersion string)

func GetTestsXrayVersion added in v1.13.2

func GetTestsXrayVersion() (version.Version, error)

func PrepareAnalyzerManagerResource added in v1.23.0

func PrepareAnalyzerManagerResource() (err error)

Make sure to call this function before running any tests that require the analyzer manager binary.

func PrepareIndexerAppResource added in v1.23.0

func PrepareIndexerAppResource(details *config.ServerDetails) (err error)

func PrepareXrayScanLibResource added in v1.23.0

func PrepareXrayScanLibResource() (err error)

func ReadSarifResults added in v1.12.0

func ReadSarifResults(t *testing.T, path string) *sarif.Report

func ReadSimpleJsonResults added in v1.12.0

func ReadSimpleJsonResults(t *testing.T, path string) formats.SimpleJsonResults

func ReadSummaryResults added in v1.12.0

func ReadSummaryResults(t *testing.T, path string) formats.ResultsSummary

func SkipTestIfDurationNotPassed added in v1.21.10

func SkipTestIfDurationNotPassed(t *testing.T, dateStr string, durationDays int, msg string)

SkipTestIfDurationNotPassed skips the test if the specified duration in days hasn't passed since the given date. dateStr should be in the format "02-01-2006" (DD-MM-YYYY). durationDays is the number of days that should have passed.

func UnmarshalJson added in v1.6.0

func UnmarshalJson(t *testing.T, output string) formats.EnrichJson

func UnmarshalXML added in v1.6.0

func UnmarshalXML(t *testing.T, output string) formats.Bom

func ValidateXrayVersion

func ValidateXrayVersion(t *testing.T, xrayVersion, minVersion string)

func ValidateXscVersion added in v1.1.0

func ValidateXscVersion(t *testing.T, xscVersion, minVersion string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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