Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/serverless-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ config:
enabled: true
excludes:
- .*ocp-4.22-lp-interop.*
skipE2EMatches:
- "^kitchensink-upgrade$"
useClusterPool: true
version: "4.21"
- includeE2EMatches:
- "^kitchensink-upgrade$"
onDemand: true
skipPromotion: true
version: "4.20"
- onDemand: true
version: "4.16"
promotion: {}
Expand Down
20 changes: 15 additions & 5 deletions pkg/prowgen/prowgen_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ type OpenShift struct {
OnDemand bool `json:"onDemand,omitempty" yaml:"onDemand,omitempty"`
CustomConfigs *CustomConfigsEnablement `json:"customConfigs,omitempty" yaml:"customConfigs,omitempty"`
CandidateRelease bool `json:"candidateRelease,omitempty" yaml:"candidateRelease,omitempty"`
// SkipPromotion excludes this OpenShift version from promotion indexing.
SkipPromotion bool `json:"skipPromotion,omitempty" yaml:"skipPromotion,omitempty"`
// SkipE2EMatches excludes e2e tests (by exact match on E2ETest.Match) from this OpenShift version.
SkipE2EMatches []string `json:"skipE2EMatches,omitempty" yaml:"skipE2EMatches,omitempty"`
// IncludeE2EMatches, if non-empty, limits this OpenShift version to only the listed e2e tests (by exact match on E2ETest.Match).
IncludeE2EMatches []string `json:"includeE2EMatches,omitempty" yaml:"includeE2EMatches,omitempty"`
}

type CustomConfigsEnablement struct {
Expand Down Expand Up @@ -187,7 +193,8 @@ func NewGenerateConfigs(ctx context.Context, r Repository, cc CommonConfig, opts

openshiftVersions := branch.OpenShiftVersions

for i, ov := range openshiftVersions {
promotionIndex := 0
for _, ov := range openshiftVersions {
log.Println(r.RepositoryDirectory(), "Generating config", branchName, "OpenShiftVersion", ov)

variant := strings.ReplaceAll(ov.Version, ".", "")
Expand Down Expand Up @@ -261,10 +268,13 @@ func NewGenerateConfigs(ctx context.Context, r Repository, cc CommonConfig, opts

options := make([]ReleaseBuildConfigurationOption, 0, len(opts))
copy(options, opts)
if i == 0 {
options = append(options, withNamePromotion(r, branch, branchName))
} else if i == 1 {
options = append(options, withTagPromotion(r, branch, branchName))
if !ov.SkipPromotion {
if promotionIndex == 0 {
options = append(options, withNamePromotion(r, branch, branchName))
} else if promotionIndex == 1 {
options = append(options, withTagPromotion(r, branch, branchName))
}
promotionIndex++
}

fromImage := srcImage
Expand Down
8 changes: 6 additions & 2 deletions pkg/prowgen/prowgen_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ var makefileTargetPattern = regexp.MustCompile("^(\\S+):\\s*(.*)$")

func DiscoverTests(r Repository, openShift OpenShift, sourceImageName string, skipE2ETestMatch []string, random *rand.Rand) ReleaseBuildConfigurationOption {
return func(cfg *cioperatorapi.ReleaseBuildConfiguration) error {
tests, err := discoverE2ETests(r, skipE2ETestMatch)
combinedSkip := append(append([]string(nil), skipE2ETestMatch...), openShift.SkipE2EMatches...)
tests, err := discoverE2ETests(r, combinedSkip, openShift.IncludeE2EMatches)
if err != nil {
return err
}
Expand Down Expand Up @@ -316,7 +317,7 @@ func (t *Test) HexSha() string {
return hex.EncodeToString(h.Sum(nil))[:shaLength]
}

func discoverE2ETests(r Repository, skipE2ETestMatch []string) ([]Test, error) {
func discoverE2ETests(r Repository, skipE2ETestMatch []string, includeE2ETestMatch []string) ([]Test, error) {
makefilePath := filepath.Join(r.RepositoryDirectory(), "Makefile")
if _, err := os.Stat(makefilePath); err != nil && os.IsNotExist(err) {
return nil, nil
Expand All @@ -343,6 +344,9 @@ func discoverE2ETests(r Repository, skipE2ETestMatch []string) ([]Test, error) {
if slices.Contains(skipE2ETestMatch, e2e.Match) {
continue
}
if len(includeE2ETestMatch) > 0 && !slices.Contains(includeE2ETestMatch, e2e.Match) {
continue
}
if err := createTest(r, target, e2e, &targets, commands); err != nil {
return nil, err
}
Expand Down
Loading