Closed fmoral2 closed 1 year ago
Complexity label:
1 generally easier - should take no more than 1 work day
2 middle - term should take no more than 3 work days
3 complex - should take ~ 5 work days
4 jedi - should take ~ 10 work days
Label: 3
Details of the implementation :
type RunCmd struct { Run []TestMap }
type TestMap struct { Cmd string ExpectedValue string ExpectedValueUpgrade string Description string }
template changed to this
template.VersionTemplate(template.VersionTestTemplate{
Description: template.TestMapFlag.Description,
TestCombination: &template.RunCmd{
Run: []template.TestMap{
{
Cmd: template.TestMapFlag.Cmd,
ExpectedValue: template.TestMapFlag.ExpectedValue,
ExpectedValueUpgrade: template.TestMapFlag.ExpectedValueUpgrade,
},
},
},
InstallUpgrade: customflag.ServiceFlag.InstallUpgrade,
TestConfig: &template.TestConfig{
TestFunc: template.TestCase(customflag.ServiceFlag.TestCase.TestFunc),
DeployWorkload: customflag.ServiceFlag.TestCase.DeployWorkload,
},
})
})
processor changed to thjis :
func processTestCombination(resultChan chan error, wg *sync.WaitGroup, ips []string, testCombination RunCmd) { for , ip := range ips { if testCombination.Run != nil { for , testMap := range testCombination.Run { if strings.Contains(testMap.Cmd, "kubectl") { wg.Add(1) go func(ip string, cmd, expectedValue, expectedValueUpgraded string) { defer wg.Done() defer GinkgoRecover() processOnHost(resultChan, ip, cmd, expectedValue) }(ip, testMap.Cmd, testMap.ExpectedValue, testMap.ExpectedValueUpgrade) } else { wg.Add(1) go func(ip string, cmd, expectedValue string) { defer wg.Done() defer GinkgoRecover() processOnNode(resultChan, ip, cmd, expectedValue) }(ip, testMap.Cmd, testMap.ExpectedValue) } } } } }
In this wat we cand send an arg like :
`go test ....... -cmd` instead of `go test ..... -cmdNode ..... -cmdHost`
So we basically changed the code to handle this instead of user.
Related to epic rancher/qa-tasks#799