Skip to content

Commit 6ac4f6d

Browse files
authored
ci: 9879 inttest (watson-developer-cloud#1117)
* ci: add int * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix * ci: fix
1 parent 6749e38 commit 6ac4f6d

File tree

4 files changed

+218
-2
lines changed

4 files changed

+218
-2
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support documentation.
4+
# This workflow will download a prebuilt Node version, install dependencies and run integration tests
5+
6+
name: Run Integration Tests
7+
8+
on:
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
jobs:
13+
integration_test:
14+
name: Build and Run Integration Tests on Node ${{ matrix.node-version }} and ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
node-version: ['14.x']
19+
os: [ubuntu-latest]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Set up Node
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
29+
- name: Install Node dependencies
30+
run: |
31+
npm ci
32+
npm run build --if-present
33+
npm install -g jest
34+
35+
- name: Execute Node integration tests
36+
# continue-on-error: true
37+
env:
38+
NATURAL_LANGUAGE_CLASSIFIER_URL: "https://api.us-south.natural-language-classifier.watson.cloud.ibm.com"
39+
NATURAL_LANGUAGE_CLASSIFIER_APIKEY: ${{ secrets.NLC_APIKEY }}
40+
NATURAL_LANGUAGE_CLASSIFIER_ID: ${{ secrets.NLC_CLASSIFIER_ID }}
41+
ASSISTANT_URL: "https://api.us-south.assistant.watson.cloud.ibm.com"
42+
ASSISTANT_APIKEY: ${{ secrets.WA_APIKEY }}
43+
ASSISTANT_WORKSPACE_ID: ${{ secrets.WA_WORKSPACE_ID }}
44+
ASSISTANT_ASSISTANT_ID: ${{ secrets.WA_ASSISTANT_ID }}
45+
COMPARE_COMPLY_URL: "https://api.us-south.compare-comply.watson.cloud.ibm.com"
46+
COMPARE_COMPLY_APIKEY: ${{ secrets.CC_APIKEY }}
47+
COMPARE_COMPLY_FEEDBACK_ID: ${{ secrets.CC_FEEDBACK_ID }}
48+
LANGUAGE_TRANSLATOR_URL: "https://api.us-south.language-translator.watson.cloud.ibm.com"
49+
LANGUAGE_TRANSLATOR_APIKEY: ${{ secrets.LT_APIKEY }}
50+
NATURAL_LANGUAGE_UNDERSTANDING_URL: "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com"
51+
NATURAL_LANGUAGE_UNDERSTANDING_APIKEY: ${{ secrets.NLU_APIKEY }}
52+
PERSONALITY_INSIGHTS_URL: "https://api.us-south.personality-insights.watson.cloud.ibm.com"
53+
PERSONALITY_INSIGHTS_APIKEY: ${{ secrets.PI_APIKEY }}
54+
SPEECH_TO_TEXT_URL: "https://api.us-south.speech-to-text.watson.cloud.ibm.com"
55+
SPEECH_TO_TEXT_APIKEY: ${{ secrets.STT_APIKEY }}
56+
TEXT_TO_SPEECH_URL: "https://api.us-south.text-to-speech.watson.cloud.ibm.com"
57+
TEXT_TO_SPEECH_APIKEY: ${{ secrets.TTS_APIKEY }}
58+
TONE_ANALYZER_URL: "https://api.us-south.tone-analyzer.watson.cloud.ibm.com"
59+
TONE_ANALYZER_APIKEY: ${{ secrets.TA_APIKEY }}
60+
VISUAL_RECOGNITION_URL: "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
61+
VISUAL_RECOGNITION_APIKEY: ${{ secrets.VR_APIKEY }}
62+
VISUAL_RECOGNITION_COLLECTION_ID: ${{ secrets.VR_COLLECTION_ID }}
63+
DISCOVERY_URL: "https://api.us-south.discovery.watson.cloud.ibm.com"
64+
DISCOVERY_APIKEY: ${{ secrets.D1_APIKEY }}
65+
DISCOVERY_ENVIRONMENT_ID: ${{ secrets.D1_ENVIRONMENT_ID }}
66+
DISCOVERY_CONFIGURATION_ID: ${{ secrets.D1_CONFIGURATION_ID }}
67+
DISCOVERY_COLLECTION_ID1: ${{ secrets.D1_COLLECTION_ID1 }}
68+
DISCOVERY_COLLECTION_ID2: ${{ secrets.D1_COLLECTION_ID2 }}
69+
DISCOVERY_COLLECTION_ID3: ${{ secrets.D1_COLLECTION_ID3 }} # japanese
70+
DISCOVERY_V2_URL: "https://api.us-south.discovery.watson.cloud.ibm.com"
71+
DISCOVERY_V2_APIKEY: ${{ secrets.D2_APIKEY }}
72+
DISCOVERY_V2_PROJECT_ID: ${{ secrets.D2_PROJECT_ID }}
73+
DISCOVERY_V2_COLLECTION_ID: ${{ secrets.D2_COLLECTION_ID }}
74+
75+
run: |
76+
mv test/resources/auth.gha.js test/resources/auth.js
77+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/assistant.v1.test.js
78+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/assistant.v2.test.js
79+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/compare-comply.test.js
80+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/discovery.v1.test.js
81+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/discovery.v2.test.js
82+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/language-translator.v3.test.js
83+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/natural-language-classifier.test.js
84+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/personality-insights.v3.test.js
85+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/speech-to-text.test.js
86+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/text-to-speech.test.js
87+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/tone-analyzer.test.js
88+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/visual-recognition.custom-classifiers.test.js
89+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/visual-recognition.v3.test.js
90+
jest --silent --coverage=false --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' test/integration/visual-recognition.v4.test.js
91+
92+
# Do not notify on success. We will leave the code here just in case we decide to switch gears
93+
- name: Notify slack on success
94+
if: false # success()
95+
env:
96+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
97+
uses: voxmedia/github-action-slack-notify-build@v1
98+
with:
99+
channel: watson-e2e-tests
100+
status: SUCCESS
101+
color: good
102+
103+
- name: Notify slack on failure
104+
if: failure()
105+
env:
106+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
107+
uses: voxmedia/github-action-slack-notify-build@v1
108+
with:
109+
channel: watson-e2e-tests
110+
status: FAILED
111+
color: danger

test/integration/assistant.v1.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ describe('assistant v1 integration', () => {
10681068
});
10691069

10701070
describe('bulkClassify()', () => {
1071-
it('should bulk classify messages', async () => {
1071+
it('should bulk classify messages @slow', async () => {
10721072
const params = {
10731073
input: {
10741074
text: 'Turn on the lights',

test/integration/visual-recognition.v4.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('visual recognition v4 integration', () => {
8282
collectionId = result.collection_id;
8383
});
8484

85-
test('listCollections', async () => {
85+
test('listCollections @slow', async () => {
8686
const res = await visualRecognition.listCollections();
8787

8888
expect(res).toBeDefined();

test/resources/auth.gha.js

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/**
2+
* Copyright 2015, 2019 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+
'use strict';
18+
19+
const testingHeaders = {
20+
'X-Watson-Learning-Opt-Out': 1,
21+
'X-Watson-Test': 1,
22+
};
23+
24+
module.exports = {
25+
assistant: {
26+
url: process.env.ASSISTANT_URL,
27+
apikey: process.env.ASSISTANT_APIKEY,
28+
workspaceId: process.env.ASSISTANT_WORKSPACE_ID,
29+
assistantId: process.env.ASSISTANT_ASSISTANT_ID,
30+
headers: Object.assign(testingHeaders, { 'x-watson-origin': 'assistant-test' }),
31+
},
32+
compareComply: {
33+
url: process.env.COMPARE_COMPLY_URL,
34+
apikey: process.env.COMPARE_COMPLY_APIKEY,
35+
feedbackId: process.env.COMPARE_COMPLY_FEEDBACK_ID,
36+
headers: testingHeaders,
37+
version: '2018-12-06',
38+
},
39+
languageTranslator: {
40+
url: process.env.LANGUAGE_TRANSLATOR_URL,
41+
apikey: process.env.LANGUAGE_TRANSLATOR_APIKEY,
42+
headers: testingHeaders,
43+
version: 'v3',
44+
},
45+
naturalLanguageClassifier: {
46+
url: process.env.NATURAL_LANGUAGE_CLASSIFIER_URL,
47+
apikey: process.env.NATURAL_LANGUAGE_CLASSIFIER_APIKEY,
48+
classifierId: process.env.NATURAL_LANGUAGE_CLASSIFIER_ID,
49+
headers: testingHeaders,
50+
version: 'v1',
51+
},
52+
naturalLanguageUnderstanding: {
53+
url: process.env.NATURAL_LANGUAGE_UNDERSTANDING_URL,
54+
apikey: process.env.NATURAL_LANGUAGE_UNDERSTANDING_APIKEY,
55+
headers: testingHeaders,
56+
},
57+
personalityInsights: {
58+
url: process.env.PERSONALITY_INSIGHTS_URL,
59+
apikey: process.env.PERSONALITY_INSIGHTS_APIKEY,
60+
headers: testingHeaders,
61+
version: 'v3',
62+
version_date: '2016-10-19',
63+
},
64+
speechToText: {
65+
serviceUrl: process.env.SPEECH_TO_TEXT_URL,
66+
apikey: process.env.SPEECH_TO_TEXT_APIKEY,
67+
headers: testingHeaders,
68+
version: 'v1',
69+
},
70+
textToSpeech: {
71+
url: process.env.TEXT_TO_SPEECH_URL,
72+
apikey: process.env.TEXT_TO_SPEECH_APIKEY,
73+
headers: testingHeaders,
74+
version: 'v1',
75+
},
76+
toneAnalyzer: {
77+
url: process.env.TONE_ANALYZER_URL,
78+
apikey: process.env.TONE_ANALYZER_APIKEY,
79+
headers: testingHeaders,
80+
},
81+
visualRecognition: {
82+
url: process.env.VISUAL_RECOGNITION_URL,
83+
apikey: process.env.VISUAL_RECOGNITION_APIKEY,
84+
testCollectionId: process.env.VISUAL_RECOGNITION_COLLECTION_ID,
85+
headers: testingHeaders,
86+
version: 'v3',
87+
},
88+
discovery: {
89+
apikey: process.env.DISCOVERY_APIKEY,
90+
environmentId: process.env.DISCOVERY_ENVIRONMENT_ID,
91+
configurationId: process.env.DISCOVERY_CONFIGURATION_ID,
92+
collectionId: process.env.DISCOVERY_COLLECTION_ID1,
93+
collectionId2: process.env.DISCOVERY_COLLECTION_ID2,
94+
japaneseCollectionId: process.env.DISCOVERY_COLLECTION_ID3, // This collection is no longer valid
95+
version_date: '2018-10-24',
96+
headers: testingHeaders,
97+
},
98+
discoveryV2: {
99+
url: process.env.DISCOVERY_V2_URL,
100+
apikey: process.env.DISCOVERY_V2_APIKEY,
101+
projectId: process.env.DISCOVERY_V2_PROJECT_ID,
102+
collectionId: process.env.DISCOVERY_V2_COLLECTION_ID,
103+
headers: testingHeaders,
104+
},
105+
};

0 commit comments

Comments
 (0)