tests

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArchiveEntriesDownload                 = "archive_entries_download_spec.json"
	ArchiveEntriesUpload                   = "archive_entries_upload_spec.json"
	BuildAddDepsDoubleSpec                 = "build_add_deps_double_spec.json"
	BuildAddDepsSpec                       = "build_add_deps_simple_spec.json"
	BuildDownloadSpec                      = "build_download_spec.json"
	BuildDownloadSpecNoBuildNumber         = "build_download_spec_no_build_number.json"
	BuildDownloadSpecNoBuildNumberWithSort = "build_download_spec_no_build_number_with_sort.json"
	BuildDownloadSpecNoPattern             = "build_download_spec_no_pattern.json"
	BuildDownloadSpecExcludeArtifacts      = "build_download_spec_exclude_artifacts.json"
	BuildDownloadSpecIncludeDeps           = "build_download_spec_include_deps.json"
	BuildDownloadSpecDepsOnly              = "build_download_spec_deps_only.json"
	BundleDownloadSpec                     = "bundle_download_spec.json"
	BundleDownloadSpecNoPattern            = "bundle_download_spec_no_pattern.json"
	CopyByBuildPatternAllSpec              = "move_copy_delete_by_build_pattern_all_spec.json"
	CopyByBuildSpec                        = "move_copy_delete_by_build_spec.json"
	CopyByBundleSpec                       = "copy_by_bundle_spec.json"
	CopyByBundleAssertSpec                 = "copy_by_bundle_assert_spec.json"
	CopyItemsSpec                          = "copy_items_spec.json"
	CopyMoveSimpleSpec                     = "copy_move_simple.json"
	CpMvDlByBuildAssertSpec                = "copy_by_build_assert_spec.json"
	DebianTestRepositoryConfig             = "debian_test_repository_config.json"
	DebianUploadSpec                       = "upload_debian_spec.json"
	DeleteSimpleSpec                       = "delete_simple_spec.json"
	DeleteSpec                             = "delete_spec.json"
	DeleteSpecWildcardInRepo               = "delete_spec_wildcard.json"
	DelSpecExclude                         = "delete_spec_exclude.json"
	DelSpecExclusions                      = "delete_spec_exclusions.json"
	DistributionCreateByAql                = "dist_create_by_aql.json"
	DistributionRepoConfig1                = "dist_repository_config1.json"
	DistributionRepoConfig2                = "dist_repository_config2.json"
	DistributionRules                      = "distribution_rules.json"
	DistributionSetDeletePropsSpec         = "dist_set_delete_props_spec.json"
	DistributionUploadSpecA                = "dist_upload_spec_a.json"
	DistributionUploadSpecB                = "dist_upload_spec_b.json"
	DockerRepoConfig                       = "docker_repository_config.json"
	KanikoConfig                           = "kaniko_config.json"
	DownloadAllRepo1TestResources          = "download_all_repo1_test_resources.json"
	DownloadEmptyDirs                      = "download_empty_dir_spec.json"
	DownloadModFileGo                      = "downloadmodfile_go.json"
	DownloadModOfDependencyGo              = "downloadmodofdependency_go.json"
	DownloadSpecExclude                    = "download_spec_exclude.json"
	DownloadSpecExclusions                 = "download_spec_exclusions.json"
	DownloadWildcardRepo                   = "download_wildcard_repo.json"
	GitLfsAssertSpec                       = "git_lfs_assert_spec.json"
	GitLfsTestRepositoryConfig             = "git_lfs_test_repository_config.json"
	GoLocalRepositoryConfig                = "go_local_repository_config.json"
	GradleConfig                           = "gradle.yaml"
	GradleRemoteRepositoryConfig           = "gradle_remote_repository_config.json"
	GradleRepositoryConfig                 = "gradle_repository_config.json"
	GradleServerIDConfig                   = "gradle_server_id.yaml"
	GradleServerIDUsesPluginConfig         = "gradle_server_id_uses_plugin.yaml"
	GradleUsernamePasswordTemplate         = "gradle_user_pass_template.yaml"
	HttpsProxyEnvVar                       = "PROXY_HTTPS_PORT"
	MavenConfig                            = "maven.yaml"
	MavenRemoteRepositoryConfig            = "maven_remote_repository_config.json"
	MavenRepositoryConfig1                 = "maven_repository_config1.json"
	MavenRepositoryConfig2                 = "maven_repository_config2.json"
	MavenServerIDConfig                    = "maven_server_id.yaml"
	MavenUsernamePasswordTemplate          = "maven_user_pass_template.yaml"
	MoveCopySpecExclude                    = "move_copy_spec_exclude.json"
	MoveCopySpecExclusions                 = "move_copy_spec_exclusions.json"
	Repo2RepositoryConfig                  = "repo2_repository_config.json"
	NpmLocalRepositoryConfig               = "npm_local_repository_config.json"
	NpmRemoteRepositoryConfig              = "npm_remote_repository_config.json"
	NugetRemoteRepo                        = "jfrog-cli-tests-nuget-remote-repo"
	Out                                    = "out"
	PypiRemoteRepositoryConfig             = "pypi_remote_repository_config.json"
	PypiVirtualRepositoryConfig            = "pypi_virtual_repository_config.json"
	RepoDetailsUrl                         = "api/repositories/"
	RtServerId                             = "rtTestServerId"
	SearchAllDocker                        = "search_all_docker.json"
	SearchAllGradle                        = "search_all_gradle.json"
	SearchAllMaven                         = "search_all_maven.json"
	SearchAllRepo1                         = "search_all_repo1.json"
	SearchGo                               = "search_go.json"
	SearchDistRepoByInSuffix               = "search_dist_repo_by_in_suffix.json"
	SearchRepo1ByInSuffix                  = "search_repo1_by_in_suffix.json"
	SearchRepo1TestResources               = "search_repo1_test_resources.json"
	SearchRepo2                            = "search_repo2.json"
	SearchSimplePlaceholders               = "search_simple_placeholders.json"
	SearchTargetInRepo2                    = "search_target_in_repo2.json"
	SearchTxt                              = "search_txt.json"
	SetDeletePropsSpec                     = "set_delete_props_spec.json"
	Repo1RepositoryConfig                  = "repo1_repository_config.json"
	SplitUploadSpecA                       = "upload_split_spec_a.json"
	SplitUploadSpecB                       = "upload_split_spec_b.json"
	Temp                                   = "tmp"
	UploadEmptyDirs                        = "upload_empty_dir_spec.json"
	UploadFileWithParenthesesSpec          = "upload_file_with_parentheses.json"
	UploadFlatNonRecursive                 = "upload_flat_non_recursive.json"
	UploadFlatRecursive                    = "upload_flat_recursive.json"
	UploadMultipleFileSpecs                = "upload_multiple_file_specs.json"
	UploadSimplePlaceholders               = "upload_simple_placeholders.json"
	UploadSpecExclude                      = "upload_spec_exclude.json"
	UploadSpecExcludeRegex                 = "upload_spec_exclude_regex.json"
	UploadTempWildcard                     = "upload_temp_wildcard.json"
	UploadWithPropsSpec                    = "upload_with_props_spec.json"
	UploadWithPropsSpecdeleteExcludeProps  = "upload_with_props_spec_delete_exclude_props.json"
	VirtualRepositoryConfig                = "specs_virtual_repository_config.json"
	WinBuildAddDepsSpec                    = "win_simple_build_add_deps_spec.json"
	WinSimpleDownloadSpec                  = "win_simple_download_spec.json"
	WinSimpleUploadSpec                    = "win_simple_upload_spec.json"
	ReplicationTempCreate                  = "replication_push_create.json"
	UploadPrefixFiles                      = "upload_prefix_files.json"
)
View Source
const (
	BintrayTestRepositoryConfig = "bintray_repository_config.json"

	BintrayUploadTestPackageName = "uploadTestPackage"
	BintrayUploadTestVersion     = "1.2.3"
)

Variables

View Source
var (
	// Repositories
	DistRepo1        = "cli-tests-dist1"
	DistRepo2        = "cli-tests-dist2"
	DockerRepo       = "cli-tests-docker"
	GoRepo           = "cli-tests-go"
	GradleRepo       = "cli-tests-gradle"
	MvnRemoteRepo    = "cli-tests-mvn-remote"
	GradleRemoteRepo = "cli-tests-gradle-remote"
	MvnRepo1         = "cli-tests-mvn1"
	MvnRepo2         = "cli-tests-mvn2"
	NpmRepo          = "cli-tests-npm"
	NpmRemoteRepo    = "cli-tests-npm-remote"
	PypiRemoteRepo   = "cli-tests-pypi-remote"
	PypiVirtualRepo  = "cli-tests-pypi-virtual"
	RtDebianRepo     = "cli-tests-debian"
	RtLfsRepo        = "cli-tests-lfs"
	RtRepo1          = "cli-tests-rt1"
	RtRepo2          = "cli-tests-rt2"
	RtVirtualRepo    = "cli-tests-rt-virtual"
	// These are not actual repositories. These patterns are meant to be used in both Repo1 and Repo2.
	RtRepo1And2            = "cli-tests-rt*"
	RtRepo1And2Placeholder = "cli-tests-rt(*)"

	BundleName                  = "cli-tests-dist-bundle"
	DockerBuildName             = "cli-tests-docker-build"
	DockerImageName             = "cli-tests-docker-image"
	DotnetBuildName             = "cli-tests-dotnet-build"
	GoBuildName                 = "cli-tests-go-build"
	GradleBuildName             = "cli-tests-gradle-build"
	NpmBuildName                = "cli-tests-npm-build"
	NuGetBuildName              = "cli-tests-nuget-build"
	PipBuildName                = "cli-tests-pip-build"
	RtBuildName1                = "cli-tests-rt-build1"
	RtBuildName2                = "cli-tests-rt-build2"
	RtBuildNameWithSpecialChars = "cli-tests-rt-a$+~&^a#-build3"
)
View Source
var BintrayRepo = "cli-tests-bintray"
View Source
var BtKey *string
View Source
var BtOrg *string
View Source
var BtUser *string
View Source
var CreatedNonVirtualRepositories map[*string]string
View Source
var CreatedVirtualRepositories map[*string]string
View Source
var DockerRemoteRepo *string
View Source
var DockerRepoDomain *string
View Source
var DockerTargetRepo *string
View Source
var DockerVirtualRepo *string
View Source
var HideUnitTestLog *bool
View Source
var PipVirtualEnv *string
View Source
var RtAccessToken *string
View Source
var RtApiKey *string
View Source
var RtDistributionAccessToken *string
View Source
var RtDistributionUrl *string
View Source
var RtPassword *string
View Source
var RtSshKeyPath *string
View Source
var RtSshPassphrase *string
View Source
var RtUrl *string
View Source
var RtUser *string
View Source
var TestArtifactory *bool
View Source
var TestArtifactoryProxy *bool
View Source
var TestBintray *bool
View Source
var TestDistribution *bool
View Source
var TestDocker *bool
View Source
var TestGo *bool
View Source
var TestGradle *bool
View Source
var TestMaven *bool
View Source
var TestNpm *bool
View Source
var TestNuget *bool
View Source
var TestPip *bool
View Source
var TestPlugins *bool

Functions

func AddTimestampToGlobalVars

func AddTimestampToGlobalVars()

Add timestamp to builds and repositories names

func CleanFileSystem

func CleanFileSystem()

func CleanUpOldItems

func CleanUpOldItems(baseItemNames []string, getActualItems func() ([]string, error), deleteItem func(string))

Clean items with timestamp older than 24 hours. Used to delete old repositories, builds, release bundles and Docker images. baseItemNames - The items to delete without timestamp, i.e. [cli-tests-rt1, cli-tests-rt2, ...] getActualItems - Function that returns all actual items in the remote server, i.e. [cli-tests-rt1-1592990748, cli-tests-rt2-1592990748, ...] deleteItem - Function that deletes the item by name

func CompareExpectedVsActual

func CompareExpectedVsActual(expected []string, actual []artUtils.SearchResult, t *testing.T)

func ConvertSliceToMap

func ConvertSliceToMap(props []utils.Property) map[string]string

func CreateSpec

func CreateSpec(fileName string) (string, error)

func DeleteFiles

func DeleteFiles(deleteSpec *spec.SpecFiles, artifactoryDetails *config.ArtifactoryDetails) (successCount, failCount int, err error)

func GetAllRepositoriesNames

func GetAllRepositoriesNames() []string

func GetAnyItemCopy

func GetAnyItemCopy() []string

func GetAnyItemCopyRecursive

func GetAnyItemCopyRecursive() []string

func GetAnyItemCopyUsingSpec

func GetAnyItemCopyUsingSpec() []string

func GetBuildArchiveEntriesDownloadCli

func GetBuildArchiveEntriesDownloadCli() []string

func GetBuildArchiveEntriesDownloadSpec

func GetBuildArchiveEntriesDownloadSpec() []string

func GetBuildArchiveEntriesSpecificPathDownload

func GetBuildArchiveEntriesSpecificPathDownload() []string

func GetBuildBeforeCopyExpected

func GetBuildBeforeCopyExpected() []string

func GetBuildBeforeMoveExpected

func GetBuildBeforeMoveExpected() []string

func GetBuildCopyExclude

func GetBuildCopyExclude() []string

func GetBuildCopyExpected

func GetBuildCopyExpected() []string

func GetBuildDeleteExpected

func GetBuildDeleteExpected() []string

func GetBuildDownload

func GetBuildDownload() []string

func GetBuildDownloadByShaAndBuild

func GetBuildDownloadByShaAndBuild() []string

func GetBuildDownloadByShaAndBuildName

func GetBuildDownloadByShaAndBuildName() []string

func GetBuildDownloadByShaAndBuildNameWithSort

func GetBuildDownloadByShaAndBuildNameWithSort() []string

func GetBuildDownloadDoesntExist

func GetBuildDownloadDoesntExist() []string

func GetBuildExcludeDownload

func GetBuildExcludeDownload() []string

func GetBuildExcludeDownloadBySpec

func GetBuildExcludeDownloadBySpec() []string

func GetBuildInfo added in v1.41.0

func GetBuildInfo(artDetails *config.ArtifactoryDetails, buildName, buildNumber string) (pbi *buildinfo.PublishedBuildInfo, found bool, err error)

This function makes no assertion, caller is responsible to assert as needed.

func GetBuildMoveExpected

func GetBuildMoveExpected() []string

func GetBuildNames

func GetBuildNames() []string

func GetBuildSimpleDownload

func GetBuildSimpleDownload() []string

func GetBuildSimpleDownloadNoPattern

func GetBuildSimpleDownloadNoPattern() []string

func GetBundleCopyExpected

func GetBundleCopyExpected() []string

func GetCleanBuild

func GetCleanBuild() []string

func GetCopyFileNameWithParentheses

func GetCopyFileNameWithParentheses() []string

func GetCopyFolderRename

func GetCopyFolderRename() []string

func GetDeleteFolderWithWildcard

func GetDeleteFolderWithWildcard() []string

func GetDockerDeployedManifest added in v1.39.0

func GetDockerDeployedManifest() []string

func GetDockerSourceManifest added in v1.39.0

func GetDockerSourceManifest() []string

func GetDownloadByBuildIncludeDeps added in v1.42.0

func GetDownloadByBuildIncludeDeps() []string

func GetDownloadByBuildOnlyDeps added in v1.42.0

func GetDownloadByBuildOnlyDeps() []string

func GetDownloadUnicode

func GetDownloadUnicode() []string

func GetDownloadWildcardRepo

func GetDownloadWildcardRepo() []string

func GetExpectedSyncDeletesDownloadStep2

func GetExpectedSyncDeletesDownloadStep2() []string

func GetExpectedSyncDeletesDownloadStep3

func GetExpectedSyncDeletesDownloadStep3() []string

func GetExpectedSyncDeletesDownloadStep4

func GetExpectedSyncDeletesDownloadStep4() []string

func GetExplodeUploadExpectedRepo1

func GetExplodeUploadExpectedRepo1() []string

func GetExtractedDownload

func GetExtractedDownload() []string

func GetFilePathForArtifactory

func GetFilePathForArtifactory(fileName string) string

func GetFilePathForBintray

func GetFilePathForBintray(filename, path string, a ...string) string

func GetFileWithParenthesesDownload

func GetFileWithParenthesesDownload() []string

func GetFirstSearchResultSortedByAsc added in v1.39.4

func GetFirstSearchResultSortedByAsc() utils.SearchResult

func GetFolderCopyIntoFolder

func GetFolderCopyIntoFolder() []string

func GetFolderCopyTwice

func GetFolderCopyTwice() []string

func GetGitLfsExpected

func GetGitLfsExpected() []string

func GetGradleDeployedArtifacts

func GetGradleDeployedArtifacts() []string

func GetMavenDeployedArtifacts

func GetMavenDeployedArtifacts() []string

func GetMoveCopySpecExpected

func GetMoveCopySpecExpected() []string

func GetMultipleFileSpecs

func GetMultipleFileSpecs() []string

func GetNonVirtualRepositories

func GetNonVirtualRepositories() map[*string]string

Return local and remote repositories for the test suites, respectfully

func GetNpmDeployedArtifacts

func GetNpmDeployedArtifacts() []string

func GetNpmDeployedScopedArtifacts

func GetNpmDeployedScopedArtifacts() []string

func GetPrefixFilesCopy added in v1.39.4

func GetPrefixFilesCopy() []string

func GetReplicationConfig

func GetReplicationConfig() []clientutils.ReplicationParams

func GetRepo1TestResourcesExpected

func GetRepo1TestResourcesExpected() []string

func GetSearchAfterDeleteWithExcludeProps added in v1.39.0

func GetSearchAfterDeleteWithExcludeProps() []utils.SearchResult

func GetSearchIncludeDirsFiles

func GetSearchIncludeDirsFiles() []utils.SearchResult

func GetSearchNotIncludeDirsFiles

func GetSearchNotIncludeDirsFiles() []utils.SearchResult

func GetSearchPropsStep1

func GetSearchPropsStep1() []utils.SearchResult

func GetSearchPropsStep2

func GetSearchPropsStep2() []utils.SearchResult

func GetSearchPropsStep3

func GetSearchPropsStep3() []utils.SearchResult

func GetSearchPropsStep4

func GetSearchPropsStep4() []utils.SearchResult

func GetSearchPropsStep5

func GetSearchPropsStep5() []utils.SearchResult

func GetSearchPropsStep6

func GetSearchPropsStep6() []utils.SearchResult

func GetSearchResultAfterDeleteByPropsStep1

func GetSearchResultAfterDeleteByPropsStep1() []utils.SearchResult

func GetSearchResultAfterDeleteByPropsStep2

func GetSearchResultAfterDeleteByPropsStep2() []utils.SearchResult

func GetSearchResultAfterDeleteByPropsStep3

func GetSearchResultAfterDeleteByPropsStep3() []utils.SearchResult

func GetSecondSearchResultSortedByAsc added in v1.39.4

func GetSecondSearchResultSortedByAsc() utils.SearchResult

func GetSimpleDelete

func GetSimpleDelete() []string

func GetSimplePlaceholders

func GetSimplePlaceholders() []string

func GetSimpleUploadExpectedRepo1

func GetSimpleUploadExpectedRepo1() []string

func GetSimpleUploadSpecialCharNoRegexExpected2filesRepo1

func GetSimpleUploadSpecialCharNoRegexExpected2filesRepo1() []string

func GetSimpleUploadSpecialCharNoRegexExpected2filesRepo2

func GetSimpleUploadSpecialCharNoRegexExpected2filesRepo2() []string

func GetSimpleUploadSpecialCharNoRegexExpectedRepo1

func GetSimpleUploadSpecialCharNoRegexExpectedRepo1() []string

func GetSimpleUploadSpecialCharNoRegexExpectedRepo2

func GetSimpleUploadSpecialCharNoRegexExpectedRepo2() []string

func GetSimpleWildcardUploadExpectedRepo1

func GetSimpleWildcardUploadExpectedRepo1() []string

func GetSingleDirectoryCopyFlat

func GetSingleDirectoryCopyFlat() []string

func GetSingleFileCopy

func GetSingleFileCopy() []string

func GetSingleFileCopyFullPath

func GetSingleFileCopyFullPath() []string

func GetSingleInnerFileCopyFullPath

func GetSingleInnerFileCopyFullPath() []string

func GetSortAndLimit

func GetSortAndLimit() []string

func GetSyncExpectedDeletesDownloadStep5

func GetSyncExpectedDeletesDownloadStep5() []string

func GetSyncExpectedDeletesDownloadStep6

func GetSyncExpectedDeletesDownloadStep6() []string

func GetSyncExpectedDeletesDownloadStep7

func GetSyncExpectedDeletesDownloadStep7() []string

func GetTestResourcesPath

func GetTestResourcesPath() string

func GetTestsLogsDir

func GetTestsLogsDir() (string, error)

func GetThirdSearchResultSortedByAsc added in v1.39.4

func GetThirdSearchResultSortedByAsc() utils.SearchResult

func GetTxtUploadExpectedRepo1

func GetTxtUploadExpectedRepo1() []string

func GetUploadDebianExpected

func GetUploadDebianExpected() []string

func GetUploadExpectedRepo1SyncDeleteStep1

func GetUploadExpectedRepo1SyncDeleteStep1() []string

func GetUploadExpectedRepo1SyncDeleteStep2

func GetUploadExpectedRepo1SyncDeleteStep2() []string

func GetUploadExpectedRepo1SyncDeleteStep3

func GetUploadExpectedRepo1SyncDeleteStep3() []string

func GetUploadExpectedRepo1SyncDeleteStep4 added in v1.42.0

func GetUploadExpectedRepo1SyncDeleteStep4() []string

func GetUploadFileNameWithParentheses

func GetUploadFileNameWithParentheses() []string

func GetUploadSpecExcludeRepo1

func GetUploadSpecExcludeRepo1() []string

func GetVirtualDownloadExpected

func GetVirtualDownloadExpected() []string

func GetVirtualRepositories

func GetVirtualRepositories() map[*string]string

Return virtual repositories for the test suites, respectfully

func GetWinCompatibility

func GetWinCompatibility() []string

func GitExecutor

func GitExecutor(dotGitPath string) *gitManager

func RedirectLogOutputToBuffer added in v1.39.6

func RedirectLogOutputToBuffer() (buffer *bytes.Buffer, previousLog log.Log)

Set new logger with output redirection to a buffer. Caller is responsible to set the old log back.

func ReplaceTemplateVariables

func ReplaceTemplateVariables(path, destPath string) (string, error)

func SetBasicAuthFromAccessToken

func SetBasicAuthFromAccessToken(t *testing.T) (string, string)

Set user and password from access token. Return the original user and password to allow restoring them in the end of the test.

func ValidateChecksums

func ValidateChecksums(filePath string, expectedChecksum fileutils.ChecksumDetails, t *testing.T)

func ValidateListsIdentical

func ValidateListsIdentical(expected, actual []string) error

func VerifyExistLocally

func VerifyExistLocally(expected, actual []string, t *testing.T)

Types

type JfrogCli

type JfrogCli struct {
	// contains filtered or unexported fields
}

func NewJfrogCli

func NewJfrogCli(mainFunc func() error, prefix, credentials string) *JfrogCli

func (*JfrogCli) Exec

func (cli *JfrogCli) Exec(args ...string) error

func (*JfrogCli) LegacyBuildToolExec

func (cli *JfrogCli) LegacyBuildToolExec(args ...string) error

func (*JfrogCli) WithoutCredentials

func (cli *JfrogCli) WithoutCredentials() *JfrogCli

type PackageSearchResultItem

type PackageSearchResultItem struct {
	Name      string
	Path      string
	Package   string
	Version   string
	Repo      string
	Owner     string
	Created   string
	Size      int64
	Sha1      string
	Published bool
}

func GetBintrayExpectedUploadFlatNonRecursive

func GetBintrayExpectedUploadFlatNonRecursive() []PackageSearchResultItem

func GetBintrayExpectedUploadFlatNonRecursiveModified

func GetBintrayExpectedUploadFlatNonRecursiveModified() []PackageSearchResultItem

func GetBintrayExpectedUploadFlatRecursive

func GetBintrayExpectedUploadFlatRecursive() []PackageSearchResultItem

func GetBintrayExpectedUploadNonFlatNonRecursive

func GetBintrayExpectedUploadNonFlatNonRecursive() []PackageSearchResultItem

func GetBintrayExpectedUploadNonFlatRecursive

func GetBintrayExpectedUploadNonFlatRecursive() []PackageSearchResultItem

Directories

Path Synopsis
proxy

Jump to

Keyboard shortcuts

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