cloudapi: run all Koji compose unit tests
Previously, only a subset from all Koji Compose unit test cases were run. Remove this limitation and run all defined unit tests, which were copied from `kojiapi`. In addition, fix unit tests and relevant cloudapi methods to make unit tests pass. Add `TestRouteWithReply()` to `test/helpers.go` to allow getting the compose ID when submitting a new compose. This is needed to make some unit tests deterministic. Do not delete values from `fields` slice in `dropFields()` in `test/helpers.go`. The behavior was previously not consistent. If the top-level map contained the value, it was deleted from it, but the nested maps also contained the value, it was not deleted. On the other hand, if the top level map didn't contain the value, but nested maps did contain it, the value was deleted from all nested maps.
This commit is contained in:
parent
fc8af28231
commit
09534091a9
3 changed files with 166 additions and 108 deletions
|
|
@ -689,6 +689,10 @@ func imageStatusFromKojiJobStatus(js *worker.JobStatus, initResult *worker.KojiI
|
|||
return ImageStatusValueFailure
|
||||
}
|
||||
|
||||
if buildResult.OSBuildOutput != nil && !buildResult.OSBuildOutput.Success {
|
||||
return ImageStatusValueFailure
|
||||
}
|
||||
|
||||
return ImageStatusValueSuccess
|
||||
}
|
||||
|
||||
|
|
@ -725,6 +729,10 @@ func composeStatusFromKojiJobStatus(js *worker.JobStatus, initResult *worker.Koj
|
|||
if buildResult.JobError != nil {
|
||||
return ComposeStatusValueFailure
|
||||
}
|
||||
|
||||
if buildResult.OSBuildOutput != nil && !buildResult.OSBuildOutput.Success {
|
||||
return ComposeStatusValueFailure
|
||||
}
|
||||
}
|
||||
|
||||
if result.JobError != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue