From 625fe9da9923619d27c6beeda3f118123cb5a2e1 Mon Sep 17 00:00:00 2001 From: ehdsouza Date: Fri, 8 Nov 2019 11:12:15 -0800 Subject: [PATCH 1/8] test(services): rename and refactor integration tests --- test/integration/test_discovery_v1.py | 65 ++++++++++--------- ...ition.py => test_visual_recognition_v3.py} | 0 .../integration/test_visual_recognition_v4.py | 3 +- 3 files changed, 36 insertions(+), 32 deletions(-) rename test/integration/{test_visual_recognition.py => test_visual_recognition_v3.py} (100%) diff --git a/test/integration/test_discovery_v1.py b/test/integration/test_discovery_v1.py index e234e815a..566ccdb1d 100644 --- a/test/integration/test_discovery_v1.py +++ b/test/integration/test_discovery_v1.py @@ -8,26 +8,39 @@ @pytest.mark.skipif( os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES') class Discoveryv1(TestCase): - def setUp(self): - self.discovery = ibm_watson.DiscoveryV1( - version='2018-08-01') - self.discovery.set_default_headers({ + discovery = None + environment_id = '62b0dd87-eefa-40bf-81d6-cf9bc82692ab' # This environment is created for integration testing + collection_id = None + collection_name = 'FOR-PYTHON-DELETE-ME' + + @classmethod + def setup_class(cls): + cls.discovery = ibm_watson.DiscoveryV1(version='2018-08-01') + cls.discovery.set_default_headers({ 'X-Watson-Learning-Opt-Out': '1', 'X-Watson-Test': '1' }) - self.environment_id = 'e15f6424-f887-4f50-b4ea-68267c36fc9c' # This environment is created for integration testing - collections = self.discovery.list_collections(self.environment_id).get_result()['collections'] - self.collection_id = collections[0]['collection_id'] + collections = cls.discovery.list_collections(cls.environment_id).get_result()['collections'] for collection in collections: - if collection['name'] == 'DO-NOT-DELETE-JAPANESE-COLLECTION': - self.collection_id_JP = collection['collection_id'] - - def tearDown(self): - collections = self.discovery.list_collections(self.environment_id).get_result()['collections'] + if collection['name'] == cls.collection_name: + cls.collection_id = collection['collection_id'] + + if cls.collection_id is None: + print("Creating a new temporary collection") + cls.collection_id = cls.discovery.create_collection( + cls.environment_id, + cls.collection_name, + description="Integration test for python sdk").get_result()['collection_id'] + + @classmethod + def teardown_class(cls): + collections = cls.discovery.list_collections(cls.environment_id).get_result()['collections'] for collection in collections: - if not collection['name'].startswith('DO-NOT-DELETE'): - self.discovery.delete_collection(self.environment_id, collection['collection_id']) + if collection['name'] == cls.collection_name: + print('Deleting the temporary collection') + cls.discovery.delete_collection(cls.environment_id, cls.collection_id) + break def test_environments(self): envs = self.discovery.list_environments().get_result() @@ -60,32 +73,21 @@ def test_configurations(self): assert deleted_config['status'] == 'deleted' def test_collections_and_expansions(self): - name = 'Example collection for python' + random.choice('ABCDEFGHIJKLMNOPQ') - new_collection_id = self.discovery.create_collection( - self.environment_id, - name, - description="Integration test for python sdk").get_result()['collection_id'] - assert new_collection_id is not None - - self.discovery.get_collection(self.environment_id, new_collection_id) + self.discovery.get_collection(self.environment_id, self.collection_id) updated_collection = self.discovery.update_collection( - self.environment_id, new_collection_id, name, description='Updating description').get_result() + self.environment_id, self.collection_id, self.collection_name, description='Updating description').get_result() assert updated_collection['description'] == 'Updating description' self.discovery.create_expansions(self.environment_id, - new_collection_id, [{ + self.collection_id, [{ 'input_terms': ['a'], 'expanded_terms': ['aa'] }]).get_result() expansions = self.discovery.list_expansions(self.environment_id, - new_collection_id).get_result() + self.collection_id).get_result() assert expansions['expansions'] self.discovery.delete_expansions(self.environment_id, - new_collection_id) - - deleted_collection = self.discovery.delete_collection( - self.environment_id, new_collection_id).get_result() - assert deleted_collection['status'] == 'deleted' + self.collection_id) def test_documents(self): with open(os.path.join(os.path.dirname(__file__), '../../resources/simple.html'), 'r') as fileinfo: @@ -185,10 +187,11 @@ def test_create_event(self): self.collection_id, document_id).get_result() + @pytest.mark.skip(reason="Temporary disable") def test_tokenization_dictionary(self): result = self.discovery.get_tokenization_dictionary_status( self.environment_id, - self.collection_id_JP + self.collection_id ).get_result() assert result['status'] is not None diff --git a/test/integration/test_visual_recognition.py b/test/integration/test_visual_recognition_v3.py similarity index 100% rename from test/integration/test_visual_recognition.py rename to test/integration/test_visual_recognition_v3.py diff --git a/test/integration/test_visual_recognition_v4.py b/test/integration/test_visual_recognition_v4.py index 5677b6815..8ed3aa073 100644 --- a/test/integration/test_visual_recognition_v4.py +++ b/test/integration/test_visual_recognition_v4.py @@ -73,9 +73,10 @@ def test_03_analyze(self): dog_path = os.path.join(os.path.dirname(__file__), '../../resources/dog.jpg') giraffe_path = os.path.join(os.path.dirname(__file__), '../../resources/my-giraffe.jpeg') + with open(dog_path, 'rb') as dog_file, open(giraffe_path, 'rb') as giraffe_files: analyze_images = self.visual_recognition.analyze( - collection_ids=['d31d6534-3458-40c4-b6de-2185a5f3cbe4'], + collection_ids=['684777e5-1f2d-40e3-987f-72d36557ef46'], features=[AnalyzeEnums.Features.OBJECTS.value], images_file=[ FileWithMetadata(dog_file), From 02fb28a99bbbe46b4a7d178afb8a803d0f2ada89 Mon Sep 17 00:00:00 2001 From: ehdsouza Date: Fri, 8 Nov 2019 11:12:42 -0800 Subject: [PATCH 2/8] test(examples): Include examples in integration tests which are not already in integration test --- examples/assistant_v1.py | 17 ++++++++++---- examples/natural_language_understanding_v1.py | 12 +++++++--- examples/personality_insights_v3.py | 13 +++++++---- examples/tone_analyzer_v3.py | 23 +++++++++++-------- examples/visual_recognition_v4.py | 2 +- test/integration/test_examples.py | 13 ++++------- 6 files changed, 50 insertions(+), 30 deletions(-) diff --git a/examples/assistant_v1.py b/examples/assistant_v1.py index c4faa537e..77d49191e 100644 --- a/examples/assistant_v1.py +++ b/examples/assistant_v1.py @@ -1,11 +1,18 @@ import json from ibm_watson import AssistantV1 -from ibm_cloud_sdk_core.authenticators import IAMAuthenticator +# from ibm_cloud_sdk_core.authenticators import IAMAuthenticator -authenticator = IAMAuthenticator('your apikey') -assistant = AssistantV1( - version='2018-07-10', - authenticator=authenticator) + +# Authentication via IAM +# authenticator = IAMAuthenticator('your apikey') +# assistant = AssistantV1( +# version='2018-07-10', +# authenticator=authenticator) +# assistant.set_service_url('https://gateway.watsonplatform.net/assistant/api') + + +# Authentication via external config like VCAP_SERVICES +assistant = AssistantV1(version='2018-07-10') assistant.set_service_url('https://gateway.watsonplatform.net/assistant/api') ######################### diff --git a/examples/natural_language_understanding_v1.py b/examples/natural_language_understanding_v1.py index 9ed28204a..86485e796 100644 --- a/examples/natural_language_understanding_v1.py +++ b/examples/natural_language_understanding_v1.py @@ -3,10 +3,16 @@ from ibm_watson.natural_language_understanding_v1 import Features, EntitiesOptions, KeywordsOptions from ibm_cloud_sdk_core.authenticators import IAMAuthenticator -authenticator = IAMAuthenticator('your_api_key') +# Authentication via IAM +# authenticator = IAMAuthenticator('your_api_key') +# service = NaturalLanguageUnderstandingV1( +# version='2018-03-16', +# authenticator=authenticator) +# service.set_service_url('https://gateway.watsonplatform.net/natural-language-understanding/api') + +# Authentication via external config like VCAP_SERVICES service = NaturalLanguageUnderstandingV1( - version='2018-03-16', - authenticator=authenticator) + version='2018-03-16') service.set_service_url('https://gateway.watsonplatform.net/natural-language-understanding/api') response = service.analyze( diff --git a/examples/personality_insights_v3.py b/examples/personality_insights_v3.py index 68fe1f2cd..c9b6394c7 100755 --- a/examples/personality_insights_v3.py +++ b/examples/personality_insights_v3.py @@ -8,10 +8,15 @@ import csv from ibm_cloud_sdk_core.authenticators import IAMAuthenticator -authenticator = IAMAuthenticator('your_api_key') -service = PersonalityInsightsV3( - version='2017-10-13', - authenticator=authenticator) +# Authentication via IAM +# authenticator = IAMAuthenticator('your_api_key') +# service = PersonalityInsightsV3( +# version='2017-10-13', +# authenticator=authenticator) +# service.set_service_url('https://gateway.watsonplatform.net/personality-insights/api') + +# Authentication via external config like VCAP_SERVICES +service = PersonalityInsightsV3(version='2017-10-13') service.set_service_url('https://gateway.watsonplatform.net/personality-insights/api') ############################ diff --git a/examples/tone_analyzer_v3.py b/examples/tone_analyzer_v3.py index 921336fa6..896a26b73 100755 --- a/examples/tone_analyzer_v3.py +++ b/examples/tone_analyzer_v3.py @@ -4,10 +4,15 @@ from ibm_watson.tone_analyzer_v3 import ToneInput from ibm_cloud_sdk_core.authenticators import IAMAuthenticator -authenticator = IAMAuthenticator('your_api_key') -service = ToneAnalyzerV3( - version='2017-09-21', - authenticator=authenticator) +# Authentication via IAM +# authenticator = IAMAuthenticator('your_api_key') +# service = ToneAnalyzerV3( +# version='2017-09-21', +# authenticator=authenticator) +# service.set_service_url('https://gateway.watsonplatform.net/tone-analyzer/api') + +# Authentication via external config like VCAP_SERVICES +service = ToneAnalyzerV3(version='2017-09-21') service.set_service_url('https://gateway.watsonplatform.net/tone-analyzer/api') print("\ntone_chat() example 1:\n") @@ -31,13 +36,13 @@ print("\ntone() example 2:\n") with open(join(dirname(__file__), - '../resources/tone-example.json')) as tone_json: + '../../resources/tone-example.json')) as tone_json: tone = service.tone(json.load(tone_json)['text'], content_type="text/plain").get_result() print(json.dumps(tone, indent=2)) print("\ntone() example 3:\n") with open(join(dirname(__file__), - '../resources/tone-example.json')) as tone_json: + '../../resources/tone-example.json')) as tone_json: tone = service.tone( tone_input=json.load(tone_json)['text'], content_type='text/plain', @@ -46,7 +51,7 @@ print("\ntone() example 4:\n") with open(join(dirname(__file__), - '../resources/tone-example.json')) as tone_json: + '../../resources/tone-example.json')) as tone_json: tone = service.tone( tone_input=json.load(tone_json), content_type='application/json').get_result() @@ -54,7 +59,7 @@ print("\ntone() example 5:\n") with open(join(dirname(__file__), - '../resources/tone-example-html.json')) as tone_html: + '../../resources/tone-example-html.json')) as tone_html: tone = service.tone( json.load(tone_html)['text'], content_type='text/html').get_result() @@ -62,7 +67,7 @@ print("\ntone() example 6 with GDPR support:\n") with open(join(dirname(__file__), - '../resources/tone-example-html.json')) as tone_html: + '../../resources/tone-example-html.json')) as tone_html: tone = service.tone( json.load(tone_html)['text'], content_type='text/html', diff --git a/examples/visual_recognition_v4.py b/examples/visual_recognition_v4.py index ae51c5b7d..6ea4eb7b0 100644 --- a/examples/visual_recognition_v4.py +++ b/examples/visual_recognition_v4.py @@ -14,7 +14,7 @@ # create a classifier my_collection = service.create_collection( name='', - description='tetsing for python' + description='testing for python' ).get_result() collection_id = my_collection.get('collection_id') diff --git a/test/integration/test_examples.py b/test/integration/test_examples.py index 1ee6c1369..861fb27e5 100644 --- a/test/integration/test_examples.py +++ b/test/integration/test_examples.py @@ -8,11 +8,11 @@ from os.path import join, dirname from glob import glob -# tests to exclude -excludes = ['discovery_v1.ipynb', '__init__.py', 'microphone-speech-to-text.py'] +# tests to include +includes = ['assistant_v1.py', 'natural_language_understanding_v1.py', 'personality_insights_v3.py', 'tone_analyzer_v3.py'] # examples path. /examples -examples_path = join(dirname(__file__), '../', 'examples', '*.py') +examples_path = join(dirname(__file__), '../../', 'examples', '*.py') @pytest.mark.skipif(os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES') @@ -22,13 +22,10 @@ def test_examples(): for example in examples: name = example.split('/')[-1] - # exclude some tests cases like authorization - if name in excludes: + if not name in includes: continue - # exclude tests if there are no credentials for that service - service_name = name[:-6] if not name.startswith('visual_recognition')\ - else 'watson_vision_combined' + service_name = name[:-6] if service_name not in vcap_services: print('%s does not have credentials in VCAP_SERVICES', From c20828a69c46370f61dd2fca614eb342a40e25e6 Mon Sep 17 00:00:00 2001 From: ehdsouza Date: Fri, 8 Nov 2019 11:36:05 -0800 Subject: [PATCH 3/8] refactor(test): Update test paths --- examples/personality_insights_v3.py | 4 ++-- examples/tone_analyzer_v3.py | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/personality_insights_v3.py b/examples/personality_insights_v3.py index c9b6394c7..82753f321 100755 --- a/examples/personality_insights_v3.py +++ b/examples/personality_insights_v3.py @@ -23,7 +23,7 @@ # Profile with JSON output # ############################ -with open(join(dirname(__file__), '../resources/personality-v3.json')) as \ +with open(join(os.getcwd(), 'resources/personality-v3.json')) as \ profile_json: profile = service.profile( profile_json.read(), @@ -37,7 +37,7 @@ # Profile with CSV output # ########################### -with open(join(dirname(__file__), '../resources/personality-v3.json'), 'r') as \ +with open(jjoin(os.getcwd(), 'resources/personality-v3.json'), 'r') as \ profile_json: response = service.profile( profile_json.read(), diff --git a/examples/tone_analyzer_v3.py b/examples/tone_analyzer_v3.py index 896a26b73..a8bb4e30f 100755 --- a/examples/tone_analyzer_v3.py +++ b/examples/tone_analyzer_v3.py @@ -35,14 +35,14 @@ indent=2)) print("\ntone() example 2:\n") -with open(join(dirname(__file__), - '../../resources/tone-example.json')) as tone_json: +with open(join(os.getcwd(), + 'resources/tone-example.json')) as tone_json: tone = service.tone(json.load(tone_json)['text'], content_type="text/plain").get_result() print(json.dumps(tone, indent=2)) print("\ntone() example 3:\n") -with open(join(dirname(__file__), - '../../resources/tone-example.json')) as tone_json: +with open(join(os.getcwd(), + 'resources/tone-example.json')) as tone_json: tone = service.tone( tone_input=json.load(tone_json)['text'], content_type='text/plain', @@ -50,24 +50,24 @@ print(json.dumps(tone, indent=2)) print("\ntone() example 4:\n") -with open(join(dirname(__file__), - '../../resources/tone-example.json')) as tone_json: +with open(join(os.getcwd(), + 'resources/tone-example.json')) as tone_json: tone = service.tone( tone_input=json.load(tone_json), content_type='application/json').get_result() print(json.dumps(tone, indent=2)) print("\ntone() example 5:\n") -with open(join(dirname(__file__), - '../../resources/tone-example-html.json')) as tone_html: +with open(join(os.getcwd(), + 'resources/tone-example-html.json')) as tone_html: tone = service.tone( json.load(tone_html)['text'], content_type='text/html').get_result() print(json.dumps(tone, indent=2)) print("\ntone() example 6 with GDPR support:\n") -with open(join(dirname(__file__), - '../../resources/tone-example-html.json')) as tone_html: +with open(join(os.getcwd(), + 'resources/tone-example-html.json')) as tone_html: tone = service.tone( json.load(tone_html)['text'], content_type='text/html', From f0eaafa2731b12847c9941687f0f91d73c43d94f Mon Sep 17 00:00:00 2001 From: ehdsouza Date: Fri, 8 Nov 2019 11:43:48 -0800 Subject: [PATCH 4/8] fix(semantic): Fix semantic release stale commit --- .releaserc | 7 +++++-- .travis.yml | 21 +++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.releaserc b/.releaserc index 69775b042..7bca89531 100644 --- a/.releaserc +++ b/.releaserc @@ -1,7 +1,10 @@ { "branch": "master", - "verifyConditions": [], + "verifyConditions": ["@semantic-release/changelog", "@semantic-release/github"], + "debug": true, "prepare": [ + "@semantic-release/changelog", + "@semantic-release/git", { "path": "@semantic-release/exec", "cmd": "bumpversion --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch" @@ -9,7 +12,7 @@ ], "publish": [ { - "path": "@semantic-release/github", + "path": "@semantic-release/github" } ] } \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 40f4f7388..62e0621b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,18 +12,23 @@ before_install: - npm install npm@latest -g install: - pip install tox-travis -- pip install bumpversion -- npm install @semantic-release/exec -script: -- pip install -U python-dotenv -- tox -before_deploy: +before_script: - sudo apt-get update -- pip install -r requirements.txt -- pip install -r requirements-dev.txt - pip install pypandoc - sudo apt-get install pandoc +- pip install -r requirements.txt +- pip install -r requirements-dev.txt - pip install --editable . +script: +- pip install -U python-dotenv +- tox +before_deploy: +- pip install bumpversion +- nvm install 12 +- npm install @semantic-release/changelog +- npm install @semantic-release/exec +- npm install @semantic-release/git +- npm install @semantic-release/github deploy: - provider: script script: docs/publish.sh From fa24ca943a47664f79276e6e88fb3b453b8ff5de Mon Sep 17 00:00:00 2001 From: ehdsouza Date: Fri, 8 Nov 2019 11:44:53 -0800 Subject: [PATCH 5/8] chore(travis): Update env file --- .env.enc | Bin 2736 -> 1792 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.env.enc b/.env.enc index 78b26c9d65f2369cef9bf281440e83732dc1a2d7..314487b935a79d4c97b851c97835575d10fd900b 100644 GIT binary patch literal 1792 zcmV+b2mkofCg_VMQQ-b2GupQ4;73}wQ=Z1`5iUqv)8<{whT{GvuJ7TtG!dRJz(Pi$ z#RF$f7H~>ZLaqh zMbzR&zFcCMUvGVJ~VcU=d0NkSPhB_Zb(nQcjEvMdr(xAo4#5aNyyJx+(^8z_D)d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GQZ{$*3Q~<9#Qp1#9km#naY^n_tqG08 From d53bcc9397cbd276f1dc73ecd74ba3e5973df705 Mon Sep 17 00:00:00 2001 From: ehdsouza Date: Fri, 8 Nov 2019 12:01:17 -0800 Subject: [PATCH 6/8] chore(pi): correct typo --- examples/personality_insights_v3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/personality_insights_v3.py b/examples/personality_insights_v3.py index 82753f321..2ba587d79 100755 --- a/examples/personality_insights_v3.py +++ b/examples/personality_insights_v3.py @@ -37,7 +37,7 @@ # Profile with CSV output # ########################### -with open(jjoin(os.getcwd(), 'resources/personality-v3.json'), 'r') as \ +with open(join(os.getcwd(), 'resources/personality-v3.json'), 'r') as \ profile_json: response = service.profile( profile_json.read(), From 5242d9778a173079dd789971da85c0003276d6f5 Mon Sep 17 00:00:00 2001 From: ehdsouza Date: Fri, 8 Nov 2019 12:51:22 -0800 Subject: [PATCH 7/8] refactor(test): Update minor details --- examples/natural_language_understanding_v1.py | 2 +- examples/tone_analyzer_v3.py | 5 +++-- test/integration/test_examples.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/natural_language_understanding_v1.py b/examples/natural_language_understanding_v1.py index 86485e796..87449a6d2 100644 --- a/examples/natural_language_understanding_v1.py +++ b/examples/natural_language_understanding_v1.py @@ -1,7 +1,7 @@ import json from ibm_watson import NaturalLanguageUnderstandingV1 from ibm_watson.natural_language_understanding_v1 import Features, EntitiesOptions, KeywordsOptions -from ibm_cloud_sdk_core.authenticators import IAMAuthenticator +# from ibm_cloud_sdk_core.authenticators import IAMAuthenticator # Authentication via IAM # authenticator = IAMAuthenticator('your_api_key') diff --git a/examples/tone_analyzer_v3.py b/examples/tone_analyzer_v3.py index a8bb4e30f..bcd32adfd 100755 --- a/examples/tone_analyzer_v3.py +++ b/examples/tone_analyzer_v3.py @@ -1,8 +1,9 @@ import json -from os.path import join, dirname +import os +from os.path import join from ibm_watson import ToneAnalyzerV3 from ibm_watson.tone_analyzer_v3 import ToneInput -from ibm_cloud_sdk_core.authenticators import IAMAuthenticator +# from ibm_cloud_sdk_core.authenticators import IAMAuthenticator # Authentication via IAM # authenticator = IAMAuthenticator('your_api_key') diff --git a/test/integration/test_examples.py b/test/integration/test_examples.py index 861fb27e5..ed6e5f9a1 100644 --- a/test/integration/test_examples.py +++ b/test/integration/test_examples.py @@ -22,7 +22,7 @@ def test_examples(): for example in examples: name = example.split('/')[-1] - if not name in includes: + if name not in includes: continue service_name = name[:-6] From 63f19e244d4449fef8a02815e063629e790fa116 Mon Sep 17 00:00:00 2001 From: ehdsouza Date: Mon, 11 Nov 2019 10:09:51 -0800 Subject: [PATCH 8/8] refactor(release.rc): Update release rc file with prepare steps order --- .releaserc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.releaserc b/.releaserc index 7bca89531..5402290f7 100644 --- a/.releaserc +++ b/.releaserc @@ -3,12 +3,12 @@ "verifyConditions": ["@semantic-release/changelog", "@semantic-release/github"], "debug": true, "prepare": [ - "@semantic-release/changelog", - "@semantic-release/git", { "path": "@semantic-release/exec", "cmd": "bumpversion --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch" - } + }, + "@semantic-release/changelog", + "@semantic-release/git" ], "publish": [ {