Skip to content

Commit 13b37ee

Browse files
committed
fix: fix examples to always set service url
1 parent a4e5642 commit 13b37ee

11 files changed

+58
-21
lines changed

.releaserc

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
{
22
"branch": "master",
3-
"verifyConditions": ["@semantic-release/changelog", "@semantic-release/git", "@semantic-release/exec"],
4-
"prepare": [
3+
"debug": true,
4+
"verifyConditions": ["@semantic-release/changelog", "@semantic-release/git"],
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
58
"@semantic-release/changelog",
6-
"@semantic-release/git",
7-
{
8-
"path": "@semantic-release/exec",
9-
"cmd": "bumpversion --current-version ${lastRelease.version} --new-version ${nextRelease.version} --allow-dirty patch"
10-
}
11-
],
12-
"publish": ["@semantic-release/github"]
13-
}
9+
[
10+
"@semantic-release/exec",
11+
{
12+
"prepareCmd": "bumpversion --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch"
13+
}
14+
],
15+
[
16+
"@semantic-release/git",
17+
{
18+
"message": "chore(release): ${nextRelease.version} release notes\n\n${nextRelease.notes}"
19+
}
20+
],
21+
"@semantic-release/github"
22+
]}

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ install:
2020
- npm install @semantic-release/changelog
2121
- npm install @semantic-release/git
2222
- npm install @semantic-release/github
23+
- npm install @semantic-release/commit-analyzer
24+
- npm install @semantic-release/release-notes-generator
2325
- ./Travis/installUnity.sh
2426
before_script:
2527
- chmod a+x ./Travis/createProject.sh

Examples/ExampleAssistantV1.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ private IEnumerator CreateService()
114114
yield return null;
115115

116116
service = new AssistantService("2019-02-18", authenticator);
117+
service.SetServiceUrl("{serviceUrl}");
117118

118119
workspaceId = Environment.GetEnvironmentVariable("CONVERSATION_WORKSPACE_ID");
119120
Runnable.Run(Examples());

Examples/ExampleAssistantV2.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,33 @@ private IEnumerator CreateService()
7777
yield return null;
7878

7979
service = new AssistantService(versionDate, authenticator);
80+
if (!string.IsNullOrEmpty(serviceUrl))
81+
{
82+
service.SetServiceUrl(serviceUrl);
83+
}
8084

8185
Runnable.Run(Examples());
8286
}
8387

8488
private IEnumerator Examples()
8589
{
86-
Log.Debug("ExampleAssistantV2.RunTest()", "Attempting to CreateSession");
90+
Log.Debug("ExampleAssistantV2.RunExample()", "Attempting to CreateSession");
8791
service.CreateSession(OnCreateSession, assistantId);
8892

8993
while (!createSessionTested)
9094
{
9195
yield return null;
9296
}
9397

94-
Log.Debug("ExampleAssistantV2.RunTest()", "Attempting to Message");
98+
Log.Debug("ExampleAssistantV2.RunExample()", "Attempting to Message");
9599
service.Message(OnMessage0, assistantId, sessionId);
96100

97101
while (!messageTested0)
98102
{
99103
yield return null;
100104
}
101105

102-
Log.Debug("ExampleAssistantV2.RunTest()", "Are you open on Christmas?");
106+
Log.Debug("ExampleAssistantV2.RunExample()", "Are you open on Christmas?");
103107

104108
var input1 = new MessageInput()
105109
{
@@ -117,7 +121,7 @@ private IEnumerator Examples()
117121
yield return null;
118122
}
119123

120-
Log.Debug("ExampleAssistantV2.RunTest()", "What are your hours?");
124+
Log.Debug("ExampleAssistantV2.RunExample()", "What are your hours?");
121125

122126
var input2 = new MessageInput()
123127
{
@@ -135,7 +139,7 @@ private IEnumerator Examples()
135139
yield return null;
136140
}
137141

138-
Log.Debug("ExampleAssistantV2.RunTest()", "I'd like to make an appointment for 12pm.");
142+
Log.Debug("ExampleAssistantV2.RunExample()", "I'd like to make an appointment for 12pm.");
139143

140144
var input3 = new MessageInput()
141145
{
@@ -153,7 +157,7 @@ private IEnumerator Examples()
153157
yield return null;
154158
}
155159

156-
Log.Debug("ExampleAssistantV2.RunTest()", "On Friday please.");
160+
Log.Debug("ExampleAssistantV2.RunExample()", "On Friday please.");
157161

158162
//Dictionary<string, string> userDefinedDictionary = new Dictionary<string, string>();
159163
//userDefinedDictionary.Add("name", "Watson");
@@ -197,7 +201,7 @@ private IEnumerator Examples()
197201
yield return null;
198202
}
199203

200-
Log.Debug("ExampleAssistantV2.RunTest()", "Attempting to delete session");
204+
Log.Debug("ExampleAssistantV2.RunExample()", "Attempting to delete session");
201205
service.DeleteSession(OnDeleteSession, assistantId, sessionId);
202206

203207
while (!deleteSessionTested)

Examples/ExampleDiscoveryV1.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ public IEnumerator CreateService()
4747
yield return null;
4848

4949
service = new DiscoveryService(versionDate, authenticator);
50-
50+
if (!string.IsNullOrEmpty(serviceUrl))
51+
{
52+
service.SetServiceUrl(serviceUrl);
53+
}
5154

5255
Runnable.Run(ExampleCreateEnvironment());
5356
Runnable.Run(ExampleListEnvironments());

Examples/ExampleDiscoveryV2.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public IEnumerator CreateService()
5757

5858
service = new DiscoveryService(versionDate, authenticator);
5959
service.SetServiceUrl("service_url");
60-
60+
if (!string.IsNullOrEmpty(serviceUrl))
61+
{
62+
service.SetServiceUrl(serviceUrl);
63+
}
6164

6265
Runnable.Run(ExampleListCollections());
6366
}

Examples/ExampleLanguageTranslatorV3.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ public IEnumerator CreateService()
4747
yield return null;
4848

4949
service = new LanguageTranslatorService(versionDate, authenticator);
50-
service.SetServiceUrl("https://api.us-south.language-translator.test.watson.cloud.ibm.com");
51-
50+
if (!string.IsNullOrEmpty(serviceUrl))
51+
{
52+
service.SetServiceUrl(serviceUrl);
53+
}
5254

5355
Log.Debug("LanguageTranslatorServiceV3", "ListModels result");
5456
}

Examples/ExampleNaturalLanguageClassifierV1.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ private IEnumerator CreateService()
6363
}
6464

6565
service = new NaturalLanguageClassifierService(authenticator);
66+
if (!string.IsNullOrEmpty(serviceUrl))
67+
{
68+
service.SetServiceUrl(serviceUrl);
69+
}
6670

6771
Runnable.Run(ExampleListClassifiers());
6872
}

Examples/ExampleNaturalLanguageUnderstandingV1.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ private IEnumerator CreateService()
6666
}
6767

6868
service = new NaturalLanguageUnderstandingService(versionDate, authenticator);
69+
if (!string.IsNullOrEmpty(serviceUrl))
70+
{
71+
service.SetServiceUrl(serviceUrl);
72+
}
6973

7074
Runnable.Run(ExampleAnalyze());
7175
Runnable.Run(ExampleListModels());

Examples/ExamplePersonalityInsightsV3.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ private IEnumerator CreateService()
5555
yield return null;
5656

5757
service = new PersonalityInsightsService("2019-02-18", authenticator);
58+
service.SetServiceUrl("{serviceUrl}");
5859

5960
Runnable.Run(Examples());
6061
}

Examples/ExampleToneAnalyzerV3.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ private IEnumerator CreateService()
6969
yield return null;
7070

7171
service = new ToneAnalyzerService(versionDate, authenticator);
72+
if (!string.IsNullOrEmpty(serviceUrl))
73+
{
74+
service.SetServiceUrl(serviceUrl);
75+
}
7276

7377
Runnable.Run(Examples());
7478
}

0 commit comments

Comments
 (0)