Skip to content

Feature 97 integration testing #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jul 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
60abd73
logging integration test log on success or fail
mediumTaj Jun 24, 2016
e5c045d
log before exit
mediumTaj Jun 24, 2016
5222fc9
Merge branch 'develop' into feature-97-integrationTesting
mediumTaj Jul 18, 2016
aac6aa9
run travisIntegrationTest instead of UnitTest, log in the system cons…
mediumTaj Jul 18, 2016
85d738e
logging to system console, increased timeout
mediumTaj Jul 18, 2016
46b3a11
hide debugging in restconnector, log to system if in batch mode only
mediumTaj Jul 18, 2016
2601ef6
removed quit from unit test batchmode call, decreased timeout
mediumTaj Jul 18, 2016
71718bc
added step to download and install Unity Test Tools into the Assets d…
mediumTaj Jul 19, 2016
bb2016b
removed installation of test tools
mediumTaj Jul 19, 2016
10f49c5
timeout changes to visual recognition
mediumTaj Jul 19, 2016
7360c76
removed check for batchmode in Logger because it errored if not in ma…
mediumTaj Jul 20, 2016
66fd105
added a pause before deleting cluster in integration test
mediumTaj Jul 20, 2016
b1f6492
encrypt credentials
mediumTaj Jul 20, 2016
971693d
revised installSDK script because of build error in Travis
mediumTaj Jul 20, 2016
95fd708
clone from feature-97 branch instead of develop
mediumTaj Jul 20, 2016
8980eff
encrypt credentials
mediumTaj Jul 26, 2016
0a34c13
Merge branch 'feature-97-integrationTesting' of https://github.com/wa…
mediumTaj Jul 26, 2016
9b761f5
ncrypt config
mediumTaj Jul 26, 2016
e20dd1c
merged in develop
mediumTaj Jul 26, 2016
30ea0d3
encrypt credentials
mediumTaj Jul 26, 2016
0721b36
merge in feature-106-visualRecognitionRetraining
mediumTaj Jul 26, 2016
3c8a922
orig cleanup and encrypt config
mediumTaj Jul 26, 2016
3ad4aa5
encrypt config
mediumTaj Jul 27, 2016
282d712
cleanup existing data from failed integration tests before running in…
mediumTaj Jul 28, 2016
50961d2
encrypt credentials
mediumTaj Jul 28, 2016
7cacbcd
give a little time between delete calls
mediumTaj Jul 28, 2016
ad0198d
removed travis wait
mediumTaj Jul 28, 2016
8aea53e
add travis wait to test function
mediumTaj Jul 28, 2016
f7e1cf1
moved travisWait into yml
mediumTaj Jul 28, 2016
314e2f0
moved wait back
mediumTaj Jul 28, 2016
7902a72
missing arg when searching for existing collections, set timeout in t…
mediumTaj Jul 28, 2016
57286b1
only test each method once
mediumTaj Jul 28, 2016
9197a12
forgot the test
mediumTaj Jul 28, 2016
5c5d4b2
logging delete clusters
mediumTaj Jul 28, 2016
5893804
logging success in deletExtraConfig
mediumTaj Jul 28, 2016
5c1b902
timer between delete calls
mediumTaj Jul 29, 2016
9e2b3af
Merge branch 'develop' into feature-97-integrationTesting
mediumTaj Jul 29, 2016
95a0eb1
ifdef out create/delete in integration test. it works fine in editor …
mediumTaj Jul 29, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ install:
script:
- ./Travis/createProject.sh
- ./Travis/installSDK.sh
- ./Travis/runTests.sh
- travis_wait 15 ./Travis/runTests.sh
- ./Travis/build.sh
Binary file modified Config.json.enc
Binary file not shown.
4 changes: 2 additions & 2 deletions Examples/ServiceExamples/Scripts/ExampleDIalog.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Scripts/Logging/Logger.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public static class Log
public static void Debug(string subSystem, string messageFmt, params object[] args)
{
LogSystem.Instance.ProcessLog(new LogRecord(LogLevel.DEBUG, subSystem, messageFmt, args));
System.Console.WriteLine("[{0}][{1}]: {2}", LogLevel.DEBUG, subSystem, string.Format(messageFmt, args));
}
#else
// We compile out Log.Debug() functions in release builds.
Expand All @@ -230,6 +231,7 @@ public static void Debug(string subSystem, string messageFmt, params object[] ar
public static void Status(string subSystem, string messageFmt, params object[] args)
{
LogSystem.Instance.ProcessLog(new LogRecord(LogLevel.STATUS, subSystem, messageFmt, args));
System.Console.WriteLine("[{0}][{1}]: {2}", LogLevel.STATUS, subSystem, string.Format(messageFmt, args));
}
/// <summary>
/// Log a WARNING level message.
Expand All @@ -240,6 +242,7 @@ public static void Status(string subSystem, string messageFmt, params object[] a
public static void Warning(string subSystem, string messageFmt, params object[] args)
{
LogSystem.Instance.ProcessLog(new LogRecord(LogLevel.WARNING, subSystem, messageFmt, args));
System.Console.WriteLine("[{0}][{1}]: {2}", LogLevel.WARNING, subSystem, string.Format(messageFmt, args));
}
/// <summary>
/// Log a ERROR level message.
Expand All @@ -250,6 +253,7 @@ public static void Warning(string subSystem, string messageFmt, params object[]
public static void Error(string subSystem, string messageFmt, params object[] args)
{
LogSystem.Instance.ProcessLog(new LogRecord(LogLevel.ERROR, subSystem, messageFmt, args));
System.Console.WriteLine("[{0}][{1}]: {2}", LogLevel.ERROR, subSystem, string.Format(messageFmt, args));
}
/// <summary>
/// Log a CRITICAL level message.
Expand All @@ -260,6 +264,7 @@ public static void Error(string subSystem, string messageFmt, params object[] ar
public static void Critical(string subSystem, string messageFmt, params object[] args)
{
LogSystem.Instance.ProcessLog(new LogRecord(LogLevel.CRITICAL, subSystem, messageFmt, args));
System.Console.WriteLine("[{0}][{1}]: {2}", LogLevel.CRITICAL, subSystem, string.Format(messageFmt, args));
}
}
}
19 changes: 19 additions & 0 deletions Scripts/Services/RetrieveAndRank/DataModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,25 @@ public class Doc
/// </summary>
public string[] bibliography { get; set; }
}

/// <summary>
/// Cluster object containing it's associated configs and collections.
/// </summary>
public class ClusterInfo
{
/// <summary>
/// The Cluster's info.
/// </summary>
public SolrClusterResponse Cluster { get; set; }
/// <summary>
/// Cluster's configs.
/// </summary>
public string[] Configs { get; set; }
/// <summary>
/// Cluster's collections.
/// </summary>
public string[] Collections { get; set; }
}
#endregion

#region Rankers
Expand Down
9 changes: 8 additions & 1 deletion Scripts/Services/RetrieveAndRank/RetrieveAndRank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ private void OnCreateClusterResponse(RESTConnector.Request req, RESTConnector.Re

DeleteClusterRequest req = new DeleteClusterRequest();
req.Callback = callback;
req.Data = customData;
req.ClusterID = clusterID;
req.Delete = true;
req.Timeout = REQUEST_TIMEOUT;
Expand Down Expand Up @@ -318,7 +319,7 @@ public class DeleteClusterRequest : RESTConnector.Request
/// <param name="resp"></param>
private void OnDeleteClusterResponse(RESTConnector.Request req, RESTConnector.Response resp)
{
Log.Debug("RetrieveAndRank", "OnDeleteClusterResponse!!");
Log.Debug("RetrieveAndRank", "OnDeleteClusterResponse success: {0}", resp.Success);
if (((DeleteClusterRequest)req).Callback != null)
((DeleteClusterRequest)req).Callback(resp.Success, ((DeleteClusterRequest)req).Data);
}
Expand Down Expand Up @@ -348,6 +349,7 @@ private void OnDeleteClusterResponse(RESTConnector.Request req, RESTConnector.Re

GetClusterRequest req = new GetClusterRequest();
req.Callback = callback;
req.Data = customData;
req.ClusterID = clusterID;
req.Timeout = REQUEST_TIMEOUT;

Expand Down Expand Up @@ -437,6 +439,7 @@ private void OnGetClusterResponse(RESTConnector.Request req, RESTConnector.Respo
GetClusterConfigsRequest req = new GetClusterConfigsRequest();
req.Callback = callback;
req.ClusterID = clusterID;
req.Data = customData;
req.Timeout = REQUEST_TIMEOUT;
req.OnResponse = OnGetClusterConfigsResponse;

Expand Down Expand Up @@ -530,6 +533,7 @@ private void OnGetClusterConfigsResponse(RESTConnector.Request req, RESTConnecto

DeleteClusterConfigRequest req = new DeleteClusterConfigRequest();
req.Callback = callback;
req.Data = customData;
req.ClusterID = clusterID;
req.ConfigID = configID;
req.Timeout = REQUEST_TIMEOUT;
Expand Down Expand Up @@ -718,6 +722,7 @@ public void SaveConfig(OnSaveClusterConfig callback, byte[] configData, string c

UploadClusterConfigRequest req = new UploadClusterConfigRequest();
req.Callback = callback;
req.Data = customData;
req.ClusterID = clusterID;
req.ConfigName = configName;
req.OnResponse = UploadClusterConfigResponse;
Expand Down Expand Up @@ -1499,6 +1504,7 @@ private void OnRankResponse(RESTConnector.Request req, RESTConnector.Response re

DeleteRankerRequest req = new DeleteRankerRequest();
req.Callback = callback;
req.Data = customData;
req.RankerID = rankerID;
req.Timeout = REQUEST_TIMEOUT;
req.Delete = true;
Expand Down Expand Up @@ -1566,6 +1572,7 @@ private void OnDeleteRankerResponse(RESTConnector.Request req, RESTConnector.Res

GetRankerRequest req = new GetRankerRequest();
req.Callback = callback;
req.Data = customData;
req.RankerID = rankerID;
req.Timeout = REQUEST_TIMEOUT;

Expand Down
Empty file modified Scripts/Services/VisualRecognition/DataModels.cs
100644 → 100755
Empty file.
5 changes: 3 additions & 2 deletions Scripts/Services/VisualRecognition/VisualRecognition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ private void OnClassifyResp(RESTConnector.Request req, RESTConnector.Response re
req.Callback = callback;
req.Data = customData;
req.OnResponse = OnDetectFacesResp;
req.Timeout = REQUEST_TIMEOUT;
req.Parameters["api_key"] = mp_ApiKey;
req.Parameters["url"] = url;
req.Parameters["version"] = VisualRecognitionVersion.Version;
Expand Down Expand Up @@ -444,6 +445,7 @@ private void OnDetectFacesResp(RESTConnector.Request req, RESTConnector.Response
req.Data = customData;
req.Timeout = REQUEST_TIMEOUT;
req.OnResponse = OnRecognizeTextResp;
req.Timeout = REQUEST_TIMEOUT;
req.Parameters["api_key"] = mp_ApiKey;
req.Parameters["url"] = url;
req.Parameters["version"] = VisualRecognitionVersion.Version;
Expand Down Expand Up @@ -647,7 +649,7 @@ private void OnGetClassifier(GetClassifiersPerClassifierVerbose classifier, stri
req.Data = customData;
req.Parameters["api_key"] = mp_ApiKey;
req.Parameters["version"] = VisualRecognitionVersion.Version;
req.Timeout = 10.0f * 60.0f;
req.Timeout = 20.0f * 60.0f;
req.OnResponse = OnGetClassifiersResp;

return connector.Send(req);
Expand Down Expand Up @@ -720,7 +722,6 @@ private void OnGetClassifiersResp(RESTConnector.Request req, RESTConnector.Respo

GetClassifierReq req = new GetClassifierReq();
req.Callback = callback;
req.Data = customData;
req.Parameters["api_key"] = mp_ApiKey;
req.Parameters["version"] = VisualRecognitionVersion.Version;
req.OnResponse = OnGetClassifierResp;
Expand Down
2 changes: 2 additions & 0 deletions Scripts/UnitTests/TestAlchemyLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ public override IEnumerator RunTest()
m_AlchemyAPI.GetNews(OnGetNews, returnFields, queryFields);
while(!m_GetNewsTested)
yield return null;

yield break;
}

#region GetAuthors
Expand Down
4 changes: 3 additions & 1 deletion Scripts/UnitTests/TestConversation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public override IEnumerator RunTest()
while(!m_MessageTested)
yield return null;
}
}

yield break;
}

private void OnMessage(MessageResponse resp)
{
Expand Down
Empty file modified Scripts/UnitTests/TestDialog.cs
100644 → 100755
Empty file.
Loading