Skip to content

Commit 9ee5e76

Browse files
committed
adding integration tests, fixing some other errors in integration tests
1 parent 15bdedc commit 9ee5e76

File tree

5 files changed

+164
-11
lines changed

5 files changed

+164
-11
lines changed

Examples/ServiceExamples/ServiceExamples.unity

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ OcclusionCullingSettings:
1313
--- !u!104 &2
1414
RenderSettings:
1515
m_ObjectHideFlags: 0
16-
serializedVersion: 7
16+
serializedVersion: 8
1717
m_Fog: 0
1818
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
1919
m_FogMode: 3
@@ -25,6 +25,7 @@ RenderSettings:
2525
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
2626
m_AmbientIntensity: 1
2727
m_AmbientMode: 0
28+
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
2829
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
2930
m_HaloStrength: 0.5
3031
m_FlareStrength: 1
@@ -41,7 +42,7 @@ RenderSettings:
4142
--- !u!157 &3
4243
LightmapSettings:
4344
m_ObjectHideFlags: 0
44-
serializedVersion: 7
45+
serializedVersion: 9
4546
m_GIWorkflowMode: 0
4647
m_GISettings:
4748
serializedVersion: 2
@@ -53,7 +54,7 @@ LightmapSettings:
5354
m_EnableBakedLightmaps: 1
5455
m_EnableRealtimeLightmaps: 1
5556
m_LightmapEditorSettings:
56-
serializedVersion: 4
57+
serializedVersion: 8
5758
m_Resolution: 2
5859
m_BakeResolution: 40
5960
m_TextureWidth: 1024
@@ -66,13 +67,27 @@ LightmapSettings:
6667
m_LightmapParameters: {fileID: 0}
6768
m_LightmapsBakeMode: 1
6869
m_TextureCompression: 1
69-
m_DirectLightInLightProbes: 1
7070
m_FinalGather: 0
7171
m_FinalGatherFiltering: 1
7272
m_FinalGatherRayCount: 1024
7373
m_ReflectionCompression: 2
74+
m_MixedBakeMode: 1
75+
m_BakeBackend: 0
76+
m_PVRSampling: 1
77+
m_PVRDirectSampleCount: 32
78+
m_PVRSampleCount: 500
79+
m_PVRBounces: 2
80+
m_PVRFiltering: 0
81+
m_PVRFilteringMode: 1
82+
m_PVRCulling: 1
83+
m_PVRFilteringGaussRadiusDirect: 1
84+
m_PVRFilteringGaussRadiusIndirect: 5
85+
m_PVRFilteringGaussRadiusAO: 2
86+
m_PVRFilteringAtrousColorSigma: 1
87+
m_PVRFilteringAtrousNormalSigma: 1
88+
m_PVRFilteringAtrousPositionSigma: 1
7489
m_LightingDataAsset: {fileID: 0}
75-
m_RuntimeCPUUsage: 25
90+
m_ShadowMaskMode: 2
7691
--- !u!196 &4
7792
NavMeshSettings:
7893
serializedVersion: 2
@@ -89,6 +104,8 @@ NavMeshSettings:
89104
minRegionArea: 2
90105
manualCellSize: 0
91106
cellSize: 0.16666667
107+
manualTileSize: 0
108+
tileSize: 256
92109
accuratePlacement: 0
93110
m_NavMeshData: {fileID: 0}
94111
--- !u!1 &85803340
@@ -106,7 +123,7 @@ GameObject:
106123
m_Icon: {fileID: 0}
107124
m_NavMeshLayer: 0
108125
m_StaticEditorFlags: 0
109-
m_IsActive: 1
126+
m_IsActive: 0
110127
--- !u!114 &85803341
111128
MonoBehaviour:
112129
m_ObjectHideFlags: 0
@@ -321,6 +338,8 @@ Camera:
321338
m_TargetDisplay: 0
322339
m_TargetEye: 3
323340
m_HDR: 0
341+
m_AllowMSAA: 1
342+
m_ForceIntoRT: 0
324343
m_OcclusionCulling: 1
325344
m_StereoConvergence: 10
326345
m_StereoSeparation: 0.022
@@ -659,6 +678,46 @@ Transform:
659678
m_Father: {fileID: 0}
660679
m_RootOrder: 14
661680
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
681+
--- !u!1 &1646373635
682+
GameObject:
683+
m_ObjectHideFlags: 0
684+
m_PrefabParentObject: {fileID: 0}
685+
m_PrefabInternal: {fileID: 0}
686+
serializedVersion: 5
687+
m_Component:
688+
- component: {fileID: 1646373637}
689+
- component: {fileID: 1646373636}
690+
m_Layer: 0
691+
m_Name: ExampleNaturalLanguageUnderstandingV1
692+
m_TagString: Untagged
693+
m_Icon: {fileID: 0}
694+
m_NavMeshLayer: 0
695+
m_StaticEditorFlags: 0
696+
m_IsActive: 1
697+
--- !u!114 &1646373636
698+
MonoBehaviour:
699+
m_ObjectHideFlags: 0
700+
m_PrefabParentObject: {fileID: 0}
701+
m_PrefabInternal: {fileID: 0}
702+
m_GameObject: {fileID: 1646373635}
703+
m_Enabled: 1
704+
m_EditorHideFlags: 0
705+
m_Script: {fileID: 11500000, guid: a2bd480466fdc154fa059d91ab9b79a8, type: 3}
706+
m_Name:
707+
m_EditorClassIdentifier:
708+
--- !u!4 &1646373637
709+
Transform:
710+
m_ObjectHideFlags: 0
711+
m_PrefabParentObject: {fileID: 0}
712+
m_PrefabInternal: {fileID: 0}
713+
m_GameObject: {fileID: 1646373635}
714+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
715+
m_LocalPosition: {x: 134.92715, y: 220.47162, z: 32.101807}
716+
m_LocalScale: {x: 1, y: 1, z: 1}
717+
m_Children: []
718+
m_Father: {fileID: 0}
719+
m_RootOrder: 16
720+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
662721
--- !u!1 &1713392457
663722
GameObject:
664723
m_ObjectHideFlags: 0

Scripts/Services/Discovery/v1/DataModels.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ public class DiskUsage
9898
/// <summary>
9999
/// Number of bytes used on the environment's disk capacity.
100100
/// </summary>
101-
public uint used_bytes { get; set; }
101+
public long used_bytes { get; set; }
102102
/// <summary>
103103
/// Total number of bytes available in the environment's disk capacity.
104104
/// </summary>
105-
public uint total_bytes { get; set; }
105+
public long total_bytes { get; set; }
106106
/// <summary>
107107
/// Amount of disk capacity used, in KB or GB format.
108108
/// </summary>
@@ -126,11 +126,11 @@ public class MemoryUsage
126126
/// <summary>
127127
/// Number of bytes used in the environment's memory capacity.
128128
/// </summary>
129-
public uint used_bytes { get; set; }
129+
public long used_bytes { get; set; }
130130
/// <summary>
131131
/// Total number of bytes available in the environment's memory capacity.
132132
/// </summary>
133-
public uint total_bytes { get; set; }
133+
public long total_bytes { get; set; }
134134
/// <summary>
135135
/// Amount of memory capacity used, in KB or GB format.
136136
/// </summary>

Scripts/UnitTests/TestDiscovery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public override IEnumerator RunTest()
133133

134134
Test(!string.IsNullOrEmpty(resp.environment_id));
135135
m_AddEnvironmentsTested = true;
136-
}, m_CreatedEnvironmentName, m_CreatedEnvironmentDescription, 0))
136+
}, m_CreatedEnvironmentName, m_CreatedEnvironmentDescription, 1))
137137
Log.Debug("ExampleDiscoveryV1", "Failed to add environment");
138138

139139
while (!m_AddEnvironmentsTested)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/**
2+
* Copyright 2015 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using UnityEngine;
19+
using System.Collections;
20+
using IBM.Watson.DeveloperCloud.Logging;
21+
using IBM.Watson.DeveloperCloud.Services.NaturalLanguageUnderstanding.v1;
22+
23+
namespace IBM.Watson.DeveloperCloud.UnitTests
24+
{
25+
public class TestNaturalLanguageUnderstanding : UnitTest
26+
{
27+
private NaturalLanguageUnderstanding m_NaturalLanguageUnderstanding = new NaturalLanguageUnderstanding();
28+
29+
private bool m_AnalyzeTested = false;
30+
private bool m_ListModelsTested = false;
31+
public override IEnumerator RunTest()
32+
{
33+
LogSystem.InstallDefaultReactors();
34+
35+
Log.Debug("TestNaturalLanguageUnderstanding", "Attempting to list environments");
36+
if (!m_NaturalLanguageUnderstanding.GetModels((ListModelsResults resp, string data) =>
37+
{
38+
Test(resp != null);
39+
m_ListModelsTested = true;
40+
}))
41+
Log.Debug("TestNaturalLanguageUnderstanding", "Failed to list models");
42+
43+
while (!m_ListModelsTested)
44+
yield return null;
45+
46+
Log.Debug("TestNaturalLanguageUnderstanding", "Attempting to analyze");
47+
Parameters parameters = new Parameters()
48+
{
49+
text = "Analyze various features of text content at scale. Provide text, raw HTML, or a public URL, and IBM Watson Natural Language Understanding will give you results for the features you request. The service cleans HTML content before analysis by default, so the results can ignore most advertisements and other unwanted content.",
50+
return_analyzed_text = true,
51+
language = "en",
52+
features = new Features()
53+
{
54+
entities = new EntitiesOptions()
55+
{
56+
limit = 50,
57+
sentiment = true,
58+
emotion = true,
59+
},
60+
keywords = new KeywordsOptions()
61+
{
62+
limit = 50,
63+
sentiment = true,
64+
emotion = true
65+
}
66+
}
67+
};
68+
69+
if (!m_NaturalLanguageUnderstanding.Analyze((AnalysisResults resp, string data) =>
70+
{
71+
Test(resp != null);
72+
m_AnalyzeTested = true;
73+
}, parameters))
74+
Log.Debug("TestNaturalLanguageUnderstanding", "Failed to analyze");
75+
76+
while (!m_AnalyzeTested)
77+
yield return null;
78+
79+
yield break;
80+
}
81+
}
82+
}

Scripts/UnitTests/TestNaturalLanguageUnderstanding.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)