public void OnTestFinished(AWSConfigs.HttpClientOption hco, HashSet<string> failedTestCases)
{
bool retry = retryCount < 3 && failedTestCases.Count > 0;
Debug.LogFormat(@"the following test cases {0} for {1} = {2}",
retry ? "will be retried" : "failed",
hco,
string.Join(",", failedTestCases.ToArray<string>()));
if (retryCount < 3 && failedTestCases.Count > 0)
{
retryCount++;
EnsureBackgroundExecution(() =>
{
if (hco == AWSConfigs.HttpClientOption.UnityWWW)
{
runner.HttpClient = hco;
runner.RunTestsWithCategory("WWW", failedTestCases);
}
else
{
runner.HttpClient = hco;
runner.RunTestsWithName(failedTestCases);
}
});
return;
}
if (hco == AWSConfigs.HttpClientOption.UnityWWW)
{
finalFailedWWWTests = new HashSet<string>(failedTestCases);
}
else if (hco == AWSConfigs.HttpClientOption.UnityWebRequest)
{
finalFailedUWRTests = new HashSet<string>(failedTestCases);
}
if (finalFailedUWRTests != null && finalFailedWWWTests != null)
{
mainThread.Enqueue(() =>
{
Debug.Log("OnTestFinished");
if (finalFailedUWRTests.Count > 0 || finalFailedWWWTests.Count > 0)
PrintResult("SOME TESTS FAILED");
else
PrintResult("ALL TESTS PASSED");
});
}
}