tests

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JvmLaunchEnvVar = "MAVEN_OPTS"
	GoCacheEnvVar   = "GOMODCACHE"
	PipCacheEnvVar  = "PIP_CACHE_DIR"

	TestJfrogUrlEnvVar                = "JFROG_SECURITY_CLI_TESTS_JFROG_URL"
	TestJfrogTokenEnvVar              = "JFROG_SECURITY_CLI_TESTS_JFROG_ACCESS_TOKEN"
	TestJfrogUserEnvVar               = "JFROG_SECURITY_CLI_TESTS_JFROG_USER"
	TestJfrogPasswordEnvVar           = "JFROG_SECURITY_CLI_TESTS_JFROG_PASSWORD"
	TestJfrogPlatformProjectKeyEnvVar = "JFROG_SECURITY_CLI_TESTS_JFROG_PLATFORM_PROJECT_KEY"

	MavenCacheRedirectionVal = "-Dmaven.repo.local="
)
View Source
const (
	XrayEndpoint        = "xray/"
	XscEndpoint         = "xsc/"
	ArtifactoryEndpoint = "artifactory/"
	AccessEndpoint      = "access/"
	RepoDetailsEndpoint = "api/repositories/"

	Out  = "out"
	Temp = "tmp"
)
View Source
const (
	DockerVirtualRepositoryConfig        = "docker_virtual_repository_config.json"
	DockerLocalRepositoryConfig          = "docker_local_repository_config.json"
	DockerRemoteRepositoryConfig         = "docker_remote_repository_config.json"
	NpmRemoteRepositoryConfig            = "npm_remote_repository_config.json"
	NugetRemoteRepositoryConfig          = "nuget_remote_repository_config.json"
	YarnRemoteRepositoryConfig           = "yarn_remote_repository_config.json"
	GradleRemoteRepositoryConfig         = "gradle_remote_repository_config.json"
	MavenRemoteRepositoryConfig          = "maven_remote_repository_config.json"
	MavenRemoteSnapshotsRepositoryConfig = "maven_remote_snapshots_repository_config.json"
	MavenVirtualRepositoryConfig         = "maven_virtual_repository_config.json"
	GoVirtualRepositoryConfig            = "go_virtual_repository_config.json"
	GoRemoteRepositoryConfig             = "go_remote_repository_config.json"
	GoLocalRepositoryConfig              = "go_local_repository_config.json"
	PypiRemoteRepositoryConfig           = "pypi_remote_repository_config.json"

	Repo1RepositoryConfig   = "repo1_repository_config.json"
	VirtualRepositoryConfig = "specs_virtual_repository_config.json"
)

Integration tests - Artifactory repositories creation templates

Variables

View Source
var (
	XrDetails *config.ServerDetails
	XrAuth    auth.ServiceDetails

	XscDetails *config.ServerDetails
	XscAuth    auth.ServiceDetails

	RtDetails     *config.ServerDetails
	RtAuth        auth.ServiceDetails
	RtHttpDetails httputils.HttpClientDetails

	PlatformCli     *coreTests.JfrogCli
	TestApplication *components.App

	RunAllTests bool
)

Integration tests - global variables

View Source
var (
	TestUnit        *bool
	TestArtifactory *bool
	TestXray        *bool
	TestXsc         *bool
	TestScan        *bool
	TestDockerScan  *bool
	TestCuration    *bool
	TestEnrich      *bool
	TestGit         *bool

	TestAuditGeneral    *bool
	TestAuditJas        *bool
	TestAuditJavaScript *bool
	TestAuditJava       *bool
	TestAuditCTypes     *bool
	TestAuditGo         *bool
	TestAuditPython     *bool
	TestAuditCocoapods  *bool
	TestAuditSwift      *bool

	JfrogUrl         *string
	JfrogUser        *string
	JfrogPassword    *string
	JfrogAccessToken *string

	JfrogSshKeyPath    *string
	JfrogSshPassphrase *string
	ContainerRegistry  *string

	// Used for tests that require a project key
	JfrogTestProjectKey *string
)

Test flags

View Source
var (
	ServerId = "testServerId"

	// Repositories
	RtRepo1       = "cli-rt1"
	RtVirtualRepo = "cli-rt-virtual"

	DockerVirtualRepo      = "cli-docker-virtual"
	DockerLocalRepo        = "cli-docker-local"
	DockerRemoteRepo       = "cli-docker-remote"
	NpmRemoteRepo          = "cli-npm-remote"
	NugetRemoteRepo        = "cli-nuget-remote"
	YarnRemoteRepo         = "cli-yarn-remote"
	GradleRemoteRepo       = "cli-gradle-remote"
	MvnRemoteRepo          = "cli-mvn-remote"
	MvnRemoteSnapshotsRepo = "cli-mvn-snapshots-remote"
	MvnVirtualRepo         = "cli-mvn-virtual"
	GoVirtualRepo          = "cli-go-virtual"
	GoRemoteRepo           = "cli-go-remote"
	GoRepo                 = "cli-go"
	PypiRemoteRepo         = "cli-pypi-remote"
)

Integration tests - Artifactory information

View Source
var CreatedNonVirtualRepositories map[*string]string
View Source
var CreatedVirtualRepositories map[*string]string

Functions

func AddTimestampToGlobalVars

func AddTimestampToGlobalVars()

func GetAllRepositoriesNames

func GetAllRepositoriesNames() []string

func GetNonVirtualRepositories

func GetNonVirtualRepositories() map[*string]string

Return local and remote repositories for the test suites, respectfully

func GetSubstitutionMap

func GetSubstitutionMap() map[string]string

Builds and repositories names to replace in the test files. We use substitution map to set repositories and builds with timestamp.

func GetTestResourcesPath added in v1.12.4

func GetTestResourcesPath() string

func GetTestResourcesPathFromPath added in v1.12.4

func GetTestResourcesPathFromPath(basePaths ...string) string

func GetVirtualRepositories

func GetVirtualRepositories() map[*string]string

Return virtual repositories for the test suites, respectfully

func InitTestFlags added in v1.12.4

func InitTestFlags()

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