Skip to content

Commit 564e4a5

Browse files
committed
Fix virtual repository tests - match package types for included repos
Fixed test failures caused by Artifactory's strict package type validation for virtual repositories. Virtual repositories can only include repositories with matching package types. Changes: 1. BaseRepositoryTests: Modified to include localRepo (same package type) instead of genericRepo when creating virtual repos for package-specific tests 2. CustomPropertiesRepositoryTests: Removed enableComposerSupport from virtual repo test to avoid package type conflicts This fixes errors like: "Virtual repository has package type 'Composer' but includes non-matching repository with package type 'Generic'"
1 parent ee27ef0 commit 564e4a5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

services/src/test/groovy/org/jfrog/artifactory/client/BaseRepositoryTests.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ abstract class BaseRepositoryTests extends ArtifactoryTestsBase {
154154

155155
if (prepareVirtualRepo) {
156156
RepositorySettings settings = getRepositorySettings(RepositoryTypeImpl.VIRTUAL)
157-
artifactory.repositories().create(0, genericRepo)
157+
Repository repoToInclude = (settings?.packageType == 'generic' || settings == null) ? genericRepo : localRepo
158+
artifactory.repositories().create(0, repoToInclude)
158159
def repos = new ArrayList<String>()
159-
repos.add(genericRepo.getKey())
160+
repos.add(repoToInclude.getKey())
160161

161162
virtualRepo = artifactory.repositories().builders().virtualRepositoryBuilder()
162163
.key("$REPO_NAME_PREFIX-virtual-$id")

0 commit comments

Comments
 (0)