<#5963 Improve test coverage of quality of service...
# flyte-github
c
#5963 Improve test coverage of quality of service Pull request opened by luckyarthur Why are the changes needed? the test coverage of quality_of_service is 62.12%, which is far away from 80%, so I add some test cases in this PR. What changes were proposed in this pull request? 1. to improve the test coverage flyteadmin/pkg/manager/impl/executions/quality_of_service.go, more test cases are added. 2. some nil pointer bugs found when add test cases, and fixed in this PR. more details about the nil pointer bug explanation: imagefor this part, to get into this if condition
input.ExecutionCreateRequest.Spec.QualityOfService
must be nil to fail the first if condition
if input.ExecutionCreateRequest.Spec.QualityOfService != nil
, and also the code here needs LaunchPlan service info hereimagesame reason as above to run into this condition, but here we are supposed to offer workflow service info截屏2024-11-12 19 26 04same reason as above to run into this condtion, but qualityOfService info is neededimageto run into this if condition,
input.Workflow.Closure.CompiledWorkflow.Primary.Template.Metadata.QualityOfService
must be nil in the previous condition
if input.Workflow.Closure.CompiledWorkflow.Primary.Template.Metadata != nil && input.Workflow.Closure.CompiledWorkflow.Primary.Template.Metadata.QualityOfService != nil
the
qualityOfService.GetTier()
should be used here How was this patch tested? 1. add more test cases to cover some scenarios missed 2. all test passed when I make each commit Check all the applicable boxes • [ ] I updated the documentation accordingly. • [ x ] All new and existing tests passed. • [ ] All commits are signed-off. flyteorg/flyte