Skip to content

Commit

Permalink
Prepare for production testing
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianriobo committed May 31, 2021
1 parent 6ac5fff commit c5dd1f7
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions pkg/event/interop/ocp/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
)

const (
topicBuildComplete string = "VirtualTopic.qe.ci.product-scenario.ascerra.build.complete"
topicTestComplete string = "VirtualTopic.qe.ci.product-scenario.ascerra.test.complete"
topicBuildComplete string = "VirtualTopic.qe.ci.product-scenario.build.complete"
topicTestComplete string = "VirtualTopic.qe.ci.product-scenario.test.complete"
// testError string = "VirtualTopic.qe.ci.product-scenario.ascerra.test.error"
)

Expand Down Expand Up @@ -44,19 +44,28 @@ func (p ProductScenarioBuild) Handler(event interface{}) error {
return err
}
// Business Logic
var openshiftVersion string = ""
var codereadyContainersMessage bool = false
for _, product := range data.Artifact.Products {
if product.Name == "openshift" {
name, correlation, _, err :=
pipelines.RunInteropOCP(product.Id, util.GenerateCorrelation(),
strings.Join(serversids[:], ","),
strings.Join(platforms[:], ","))
if err != nil {
logging.Error(err)
}
// We will take info from status to send back the results
response := buildResponse(name, correlation, &data)
return umb.Send(topicTestComplete, response)
openshiftVersion = product.Id
}
if product.Name == "codeready_containers" {
codereadyContainersMessage = true
}
}
// Filtering this will be improved in future versions
if len(openshiftVersion) > 0 && codereadyContainersMessage {
name, correlation, _, err :=
pipelines.RunInteropOCP(openshiftVersion, util.GenerateCorrelation(),
strings.Join(serversids[:], ","),
strings.Join(platforms[:], ","))
if err != nil {
logging.Error(err)
}
// We will take info from status to send back the results
response := buildResponse(name, correlation, &data)
return umb.Send(topicTestComplete, response)
}
return nil
}
Expand Down

0 comments on commit c5dd1f7

Please sign in to comment.