From 3c1f7a792f263768f0a124ca6fdfad6ed610c97f Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Fri, 3 Apr 2020 13:11:41 -0700 Subject: [PATCH] [jobs] testing: reduce test flakiness` fixes #2945 fixes #2818 There were 8 tests which has `time.sleep(10)` for waiting data propagation or whatever. I chose to use `@eventually_consistent.call` instead of sleep in those tests. Bonus point is now the tests are significantly faster because it doesn't always wait for 10 seconds. The downside is it will take a long time on failure. We may want to specify the retry count on the eventualy consistent decorator once the following issue is fixed: https://github.com/GoogleCloudPlatform/python-repo-tools/issues/25 --- jobs/v3/api_client/auto_complete_sample.py | 24 ++++++---- .../api_client/auto_complete_sample_test.py | 41 ++++++++++------ jobs/v3/api_client/commute_search_sample.py | 21 ++++++--- .../api_client/commute_search_sample_test.py | 27 ++++++++--- jobs/v3/api_client/custom_attribute_sample.py | 22 ++++++--- .../custom_attribute_sample_test.py | 32 +++++++++---- .../api_client/email_alert_search_sample.py | 20 ++++++-- .../email_alert_search_sample_test.py | 27 ++++++++--- .../api_client/featured_job_search_sample.py | 20 ++++++-- .../featured_job_search_sample_test.py | 27 ++++++++--- jobs/v3/api_client/general_search_sample.py | 24 +++++++--- .../api_client/general_search_sample_test.py | 40 +++++++++++----- jobs/v3/api_client/histogram_sample.py | 20 ++++++-- jobs/v3/api_client/histogram_sample_test.py | 27 ++++++++--- jobs/v3/api_client/location_search_sample.py | 35 +++++++++----- .../api_client/location_search_sample_test.py | 47 ++++++++++++------- jobs/v3/api_client/requirements-test.txt | 1 + 17 files changed, 318 insertions(+), 137 deletions(-) diff --git a/jobs/v3/api_client/auto_complete_sample.py b/jobs/v3/api_client/auto_complete_sample.py index 5f2510d467aa..69e03d0f1ae3 100755 --- a/jobs/v3/api_client/auto_complete_sample.py +++ b/jobs/v3/api_client/auto_complete_sample.py @@ -50,10 +50,9 @@ def auto_complete_default(client_service, query, company_name): # [END auto_complete_default] -def run_sample(): +def set_up(): import base_company_sample import base_job_sample - company_to_be_created = base_company_sample.generate_company() company_created = base_company_sample.create_company( client_service, company_to_be_created) @@ -64,16 +63,25 @@ def run_sample(): job_to_be_created.update({'title': 'Software engineer'}) job_name = base_job_sample.create_job(client_service, job_to_be_created).get('name') + return company_name, job_name - # Wait several seconds for post processing - time.sleep(10) - auto_complete_default(client_service, 'goo', company_name) - auto_complete_default(client_service, 'sof', company_name) - job_title_auto_complete(client_service, 'sof', company_name) +def tear_down(company_name, job_name): + import base_company_sample + import base_job_sample base_job_sample.delete_job(client_service, job_name) base_company_sample.delete_company(client_service, company_name) +def run_sample(company_name): + auto_complete_default(client_service, 'goo', company_name) + auto_complete_default(client_service, 'sof', company_name) + job_title_auto_complete(client_service, 'sof', company_name) + + if __name__ == '__main__': - run_sample() + company_name, job_name = set_up() + # Wait several seconds for post processing + time.sleep(10) + run_sample(company_name) + tear_down(company_name, job_name) diff --git a/jobs/v3/api_client/auto_complete_sample_test.py b/jobs/v3/api_client/auto_complete_sample_test.py index 05866c4a967e..8f2458e1e6b0 100755 --- a/jobs/v3/api_client/auto_complete_sample_test.py +++ b/jobs/v3/api_client/auto_complete_sample_test.py @@ -12,19 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest +import re -def test_auto_complete_sample(capsys): - import auto_complete_sample - import re +from gcp_devrel.testing import eventually_consistent - auto_complete_sample.run_sample() - out, _ = capsys.readouterr() - expected = ( - '.*completionResults.*' - 'suggestion.*Google.*type.*COMPANY_NAME.*\n' - '.*completionResults.*' - 'suggestion.*Software Engineer.*type.*JOB_TITLE.*\n' - '.*completionResults.*' - 'suggestion.*Software Engineer.*type.*JOB_TITLE.*\n' - ) - assert re.search(expected, out) +import auto_complete_sample + + +@pytest.fixture(scope="module") +def company_name(): + company_name, job_name = auto_complete_sample.set_up() + yield company_name + auto_complete_sample.tear_down(company_name, job_name) + + +def test_auto_complete_sample(company_name, capsys): + @eventually_consistent.call + def _(): + auto_complete_sample.run_sample(company_name) + out, _ = capsys.readouterr() + expected = ( + '.*completionResults.*' + 'suggestion.*Google.*type.*COMPANY_NAME.*\n' + '.*completionResults.*' + 'suggestion.*Software Engineer.*type.*JOB_TITLE.*\n' + '.*completionResults.*' + 'suggestion.*Software Engineer.*type.*JOB_TITLE.*\n' + ) + assert re.search(expected, out) diff --git a/jobs/v3/api_client/commute_search_sample.py b/jobs/v3/api_client/commute_search_sample.py index cb2c548a0139..8064942c8d2b 100755 --- a/jobs/v3/api_client/commute_search_sample.py +++ b/jobs/v3/api_client/commute_search_sample.py @@ -19,7 +19,6 @@ import time from googleapiclient.discovery import build - client_service = build('jobs', 'v3') parent = 'projects/' + os.environ['GOOGLE_CLOUD_PROJECT'] # [END instantiate] @@ -54,7 +53,7 @@ def commute_search(client_service, company_name): # [END commute_search] -def run_sample(): +def set_up(): import base_company_sample import base_job_sample @@ -70,14 +69,24 @@ def run_sample(): }) job_name = base_job_sample.create_job(client_service, job_to_be_created).get('name') + return company_name, job_name - # Wait several seconds for post processing - time.sleep(10) - commute_search(client_service, company_name) + +def tear_down(company_name, job_name): + import base_company_sample + import base_job_sample base_job_sample.delete_job(client_service, job_name) base_company_sample.delete_company(client_service, company_name) +def run_sample(company_name): + commute_search(client_service, company_name) + + if __name__ == '__main__': - run_sample() + company_name, job_name = set_up() + # Wait several seconds for post processing + time.sleep(10) + run_sample(company_name) + tear_down(company_name, job_name) diff --git a/jobs/v3/api_client/commute_search_sample_test.py b/jobs/v3/api_client/commute_search_sample_test.py index ee99a308b967..5a99527f3e71 100755 --- a/jobs/v3/api_client/commute_search_sample_test.py +++ b/jobs/v3/api_client/commute_search_sample_test.py @@ -12,12 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest +import re -def test_commute_search_sample(capsys): - import commute_search_sample - import re +from gcp_devrel.testing import eventually_consistent - commute_search_sample.run_sample() - out, _ = capsys.readouterr() - expected = ('.*matchingJobs.*1600 Amphitheatre Pkwy.*') - assert re.search(expected, out) +import commute_search_sample + + +@pytest.fixture(scope="module") +def company_name(): + company_name, job_name = commute_search_sample.set_up() + yield company_name + commute_search_sample.tear_down(company_name, job_name) + + +def test_commute_search_sample(company_name, capsys): + @eventually_consistent.call + def _(): + commute_search_sample.run_sample(company_name) + out, _ = capsys.readouterr() + expected = ('.*matchingJobs.*1600 Amphitheatre Pkwy.*') + assert re.search(expected, out) diff --git a/jobs/v3/api_client/custom_attribute_sample.py b/jobs/v3/api_client/custom_attribute_sample.py index 842d8d4e654c..0b25c2613490 100755 --- a/jobs/v3/api_client/custom_attribute_sample.py +++ b/jobs/v3/api_client/custom_attribute_sample.py @@ -133,7 +133,7 @@ def custom_attribute_filter_multi_attributes(client_service): # [END custom_attribute_filter_multi_attributes] -def run_sample(): +def set_up(): import base_company_sample import base_job_sample @@ -145,16 +145,24 @@ def run_sample(): job_to_be_created = generate_job_with_custom_attributes(company_name) job_name = base_job_sample.create_job(client_service, job_to_be_created).get('name') + return company_name, job_name - # Wait several seconds for post processing - time.sleep(10) - custom_attribute_filter_string_value(client_service) - custom_attribute_filter_long_value(client_service) - custom_attribute_filter_multi_attributes(client_service) +def tear_down(company_name, job_name): + import base_company_sample + import base_job_sample base_job_sample.delete_job(client_service, job_name) base_company_sample.delete_company(client_service, company_name) +def run_sample(): + custom_attribute_filter_string_value(client_service) + custom_attribute_filter_long_value(client_service) + custom_attribute_filter_multi_attributes(client_service) + + if __name__ == '__main__': - run_sample() + company_name, job_name = set_up() + # Wait several seconds for post processing + time.sleep(10) + run_sample(company_name, job_name) diff --git a/jobs/v3/api_client/custom_attribute_sample_test.py b/jobs/v3/api_client/custom_attribute_sample_test.py index 286ae1dcca38..7ccc47e90c02 100755 --- a/jobs/v3/api_client/custom_attribute_sample_test.py +++ b/jobs/v3/api_client/custom_attribute_sample_test.py @@ -12,15 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest +import re -def test_custom_attribute_sample(capsys): - import custom_attribute_sample - import re +from gcp_devrel.testing import eventually_consistent - custom_attribute_sample.run_sample() - out, _ = capsys.readouterr() - expected = ('.*Job created:.*job_with_custom_attributes.*\n' - '.*matchingJobs.*job_with_custom_attributes.*\n' - '.*matchingJobs.*job_with_custom_attributes.*\n' - '.*matchingJobs.*job_with_custom_attributes.*\n') - assert re.search(expected, out, re.DOTALL) +import custom_attribute_sample + + +@pytest.fixture(scope="module") +def create_data(): + company_name, job_name = custom_attribute_sample.set_up() + yield + custom_attribute_sample.tear_down(company_name, job_name) + + +def test_custom_attribute_sample(create_data, capsys): + @eventually_consistent.call + def _(): + custom_attribute_sample.run_sample() + out, _ = capsys.readouterr() + expected = ('.*matchingJobs.*job_with_custom_attributes.*\n' + '.*matchingJobs.*job_with_custom_attributes.*\n' + '.*matchingJobs.*job_with_custom_attributes.*\n') + assert re.search(expected, out, re.DOTALL) diff --git a/jobs/v3/api_client/email_alert_search_sample.py b/jobs/v3/api_client/email_alert_search_sample.py index 8c538abdbe82..26a4c8734e58 100755 --- a/jobs/v3/api_client/email_alert_search_sample.py +++ b/jobs/v3/api_client/email_alert_search_sample.py @@ -44,7 +44,7 @@ def search_for_alerts(client_service, company_name): # [END search_for_alerts] -def run_sample(): +def set_up(): import base_company_sample import base_job_sample @@ -58,13 +58,23 @@ def run_sample(): job_name = base_job_sample.create_job(client_service, job_to_be_created).get('name') - # Wait several seconds for post processing - time.sleep(10) - search_for_alerts(client_service, company_name) + return company_name, job_name + +def tear_down(company_name, job_name): + import base_company_sample + import base_job_sample base_job_sample.delete_job(client_service, job_name) base_company_sample.delete_company(client_service, company_name) +def run_sample(company_name): + search_for_alerts(client_service, company_name) + + if __name__ == '__main__': - run_sample() + company_name, job_name = set_up() + # Wait several seconds for post processing + time.sleep(10) + run_sample(company_name) + tear_down(company_name, job_name) diff --git a/jobs/v3/api_client/email_alert_search_sample_test.py b/jobs/v3/api_client/email_alert_search_sample_test.py index 1f7e61b63171..08cf6695fbd6 100755 --- a/jobs/v3/api_client/email_alert_search_sample_test.py +++ b/jobs/v3/api_client/email_alert_search_sample_test.py @@ -12,12 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest +import re -def test_email_alert_search_sample(capsys): - import email_alert_search_sample - import re +from gcp_devrel.testing import eventually_consistent - email_alert_search_sample.run_sample() - out, _ = capsys.readouterr() - expected = ('.*matchingJobs.*') - assert re.search(expected, out) +import email_alert_search_sample + + +@pytest.fixture(scope="module") +def company_name(): + company_name, job_name = email_alert_search_sample.set_up() + yield company_name + email_alert_search_sample.tear_down(company_name, job_name) + + +def test_email_alert_search_sample(company_name, capsys): + @eventually_consistent.call + def _(): + email_alert_search_sample.run_sample(company_name) + out, _ = capsys.readouterr() + expected = ('.*matchingJobs.*') + assert re.search(expected, out) diff --git a/jobs/v3/api_client/featured_job_search_sample.py b/jobs/v3/api_client/featured_job_search_sample.py index 3cef8ce3725c..9cca4286fceb 100755 --- a/jobs/v3/api_client/featured_job_search_sample.py +++ b/jobs/v3/api_client/featured_job_search_sample.py @@ -74,7 +74,7 @@ def search_featured_job(client_service, company_name): # [END search_featured_job] -def run_sample(): +def set_up(): import base_company_sample import base_job_sample @@ -86,14 +86,24 @@ def run_sample(): job_to_be_created = generate_featured_job(company_name) job_name = base_job_sample.create_job(client_service, job_to_be_created).get('name') + return company_name, job_name - # Wait several seconds for post processing - time.sleep(10) - search_featured_job(client_service, company_name) + +def tear_down(company_name, job_name): + import base_company_sample + import base_job_sample base_job_sample.delete_job(client_service, job_name) base_company_sample.delete_company(client_service, company_name) +def run_sample(company_name): + search_featured_job(client_service, company_name) + + if __name__ == '__main__': - run_sample() + company_name, job_name = set_up() + # Wait several seconds for post processing + time.sleep(10) + run_sample(company_name) + tear_down(company_name, job_name) diff --git a/jobs/v3/api_client/featured_job_search_sample_test.py b/jobs/v3/api_client/featured_job_search_sample_test.py index 3a76529940cc..730bcb65aeba 100755 --- a/jobs/v3/api_client/featured_job_search_sample_test.py +++ b/jobs/v3/api_client/featured_job_search_sample_test.py @@ -12,12 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest +import re -def test_featured_job_search_sample(capsys): - import featured_job_search_sample - import re +from gcp_devrel.testing import eventually_consistent - featured_job_search_sample.run_sample() - out, _ = capsys.readouterr() - expected = ('.*matchingJobs.*') - assert re.search(expected, out) +import featured_job_search_sample + + +@pytest.fixture(scope="module") +def company_name(): + company_name, job_name = featured_job_search_sample.set_up() + yield company_name + featured_job_search_sample.tear_down(company_name, job_name) + + +def test_featured_job_search_sample(company_name, capsys): + @eventually_consistent.call + def _(): + featured_job_search_sample.run_sample(company_name) + out, _ = capsys.readouterr() + expected = ('.*matchingJobs.*') + assert re.search(expected, out) diff --git a/jobs/v3/api_client/general_search_sample.py b/jobs/v3/api_client/general_search_sample.py index f0fa9122bea8..192c76a06a04 100755 --- a/jobs/v3/api_client/general_search_sample.py +++ b/jobs/v3/api_client/general_search_sample.py @@ -196,7 +196,7 @@ def compensation_search(client_service, company_name): # [END compensation_filter] -def run_sample(): +def set_up(): import base_company_sample import base_job_sample @@ -224,9 +224,18 @@ def run_sample(): }) job_name = base_job_sample.create_job(client_service, job_to_be_created).get('name') + return company_name, job_name - # Wait several seconds for post processing - time.sleep(10) + +def tear_down(company_name, job_name): + import base_company_sample + import base_job_sample + + base_job_sample.delete_job(client_service, job_name) + base_company_sample.delete_company(client_service, company_name) + + +def run_sample(company_name, job_name): basic_keyword_search(client_service, company_name, 'Systems Administrator') category_search(client_service, company_name, ['COMPUTER_AND_IT']) date_range = {'start_time': '2018-07-01T00:00:00Z'} @@ -237,9 +246,10 @@ def run_sample(): compensation_search(client_service, company_name) language_code_search(client_service, company_name, ['pt-BR', 'en-US']) - base_job_sample.delete_job(client_service, job_name) - base_company_sample.delete_company(client_service, company_name) - if __name__ == '__main__': - run_sample() + company_name, job_name = set_up() + # Wait several seconds for post processing + time.sleep(10) + run_sample(company_name, job_name) + tear_down(company_name, job_name) diff --git a/jobs/v3/api_client/general_search_sample_test.py b/jobs/v3/api_client/general_search_sample_test.py index 7f1f53f325bc..16b043d044aa 100755 --- a/jobs/v3/api_client/general_search_sample_test.py +++ b/jobs/v3/api_client/general_search_sample_test.py @@ -12,18 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest +import re -def test_general_search_sample(capsys): - import general_search_sample - import re +from gcp_devrel.testing import eventually_consistent - general_search_sample.run_sample() - out, _ = capsys.readouterr() - expected = ('.*matchingJobs.*\n' - '.*matchingJobs.*\n' - '.*matchingJobs.*\n' - '.*matchingJobs.*\n' - '.*matchingJobs.*\n' - '.*matchingJobs.*\n' - '.*matchingJobs.*\n') - assert re.search(expected, out, re.DOTALL) +import general_search_sample + + +@pytest.fixture(scope="module") +def company_and_job(): + company_name, job_name = general_search_sample.set_up() + yield company_name, job_name + general_search_sample.tear_down(company_name, job_name) + + +def test_general_search_sample(company_and_job, capsys): + @eventually_consistent.call + def _(): + general_search_sample.run_sample( + company_and_job[0], company_and_job[1]) + out, _ = capsys.readouterr() + expected = ('.*matchingJobs.*\n' + '.*matchingJobs.*\n' + '.*matchingJobs.*\n' + '.*matchingJobs.*\n' + '.*matchingJobs.*\n' + '.*matchingJobs.*\n' + '.*matchingJobs.*\n') + assert re.search(expected, out, re.DOTALL) diff --git a/jobs/v3/api_client/histogram_sample.py b/jobs/v3/api_client/histogram_sample.py index ec880c7e4999..cab1c59097a2 100755 --- a/jobs/v3/api_client/histogram_sample.py +++ b/jobs/v3/api_client/histogram_sample.py @@ -53,7 +53,7 @@ def histogram_search(client_service, company_name): # [END histogram_search] -def run_sample(): +def set_up(): import base_company_sample import base_job_sample import custom_attribute_sample as caa @@ -66,14 +66,24 @@ def run_sample(): job_to_be_created = caa.generate_job_with_custom_attributes(company_name) job_name = base_job_sample.create_job(client_service, job_to_be_created).get('name') + return company_name, job_name - # Wait several seconds for post processing - time.sleep(10) - histogram_search(client_service, company_name) + +def tear_down(company_name, job_name): + import base_company_sample + import base_job_sample base_job_sample.delete_job(client_service, job_name) base_company_sample.delete_company(client_service, company_name) +def run_sample(company_name): + histogram_search(client_service, company_name) + + if __name__ == '__main__': - run_sample() + company_name, job_name = set_up() + # Wait several seconds for post processing + time.sleep(10) + run_sample(company_name) + tear_down(company_name, job_name) diff --git a/jobs/v3/api_client/histogram_sample_test.py b/jobs/v3/api_client/histogram_sample_test.py index 11066ec15ae8..5776f5b90a8e 100755 --- a/jobs/v3/api_client/histogram_sample_test.py +++ b/jobs/v3/api_client/histogram_sample_test.py @@ -12,12 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest +import re -def test_histogram_sample(capsys): - import histogram_sample - import re +from gcp_devrel.testing import eventually_consistent - histogram_sample.run_sample() - out, _ = capsys.readouterr() - assert re.search('COMPANY_ID', out) - assert re.search('someFieldName1', out) +import histogram_sample + + +@pytest.fixture(scope="module") +def company_name(): + company_name, job_name = histogram_sample.set_up() + yield company_name + histogram_sample.tear_down(company_name, job_name) + + +def test_histogram_sample(company_name, capsys): + @eventually_consistent.call + def _(): + histogram_sample.run_sample(company_name) + out, _ = capsys.readouterr() + assert re.search('COMPANY_ID', out) + assert re.search('someFieldName1', out) diff --git a/jobs/v3/api_client/location_search_sample.py b/jobs/v3/api_client/location_search_sample.py index afc73c2435bb..56cba5ec0154 100755 --- a/jobs/v3/api_client/location_search_sample.py +++ b/jobs/v3/api_client/location_search_sample.py @@ -139,7 +139,12 @@ def broadening_location_search(client_service, company_name, location): # [END broadening_location_search] -def run_sample(): +location = 'Mountain View, CA' +distance = 0.5 +keyword = 'Software Engineer' +location2 = 'Synnyvale, CA' + +def set_up(): import base_company_sample import base_job_sample @@ -148,10 +153,6 @@ def run_sample(): client_service, company_to_be_created) company_name = company_created.get('name') - location = 'Mountain View, CA' - distance = 0.5 - keyword = 'Software Engineer' - location2 = 'Synnyvale, CA' job_to_be_created = base_job_sample.generate_job_with_required_fields( company_name) @@ -164,9 +165,19 @@ def run_sample(): job_to_be_created2.update({'addresses': [location2], 'title': keyword}) job_name2 = base_job_sample.create_job(client_service, job_to_be_created2).get('name') + return company_name, job_name, job_name2 - # Wait several seconds for post processing - time.sleep(10) + +def tear_down(company_name, job_name, job_name2): + import base_company_sample + import base_job_sample + + base_job_sample.delete_job(client_service, job_name) + base_job_sample.delete_job(client_service, job_name2) + base_company_sample.delete_company(client_service, company_name) + + +def run_sample(company_name): basic_location_search(client_service, company_name, location, distance) city_location_search(client_service, company_name, location) broadening_location_search(client_service, company_name, location) @@ -175,10 +186,10 @@ def run_sample(): multi_locations_search(client_service, company_name, location, distance, location2) - base_job_sample.delete_job(client_service, job_name) - base_job_sample.delete_job(client_service, job_name2) - base_company_sample.delete_company(client_service, company_name) - if __name__ == '__main__': - run_sample() + company_name, job_name, job_name2 = set_up() + # Wait several seconds for post processing + time.sleep(10) + run_sample(company_name) + tear_down(company_name, job_name, job_name2) diff --git a/jobs/v3/api_client/location_search_sample_test.py b/jobs/v3/api_client/location_search_sample_test.py index 7fb3300f3dbb..3dae1965a632 100755 --- a/jobs/v3/api_client/location_search_sample_test.py +++ b/jobs/v3/api_client/location_search_sample_test.py @@ -12,22 +12,35 @@ # See the License for the specific language governing permissions and # limitations under the License. +import pytest +import re -def test_location_search_sample(capsys): - import location_search_sample - import re +from gcp_devrel.testing import eventually_consistent - location_search_sample.run_sample() - out, _ = capsys.readouterr() - expected = ('.*locationFilters.*\n' - '.*locationFilters.*\n' - '.*locationFilters.*\n' - '.*locationFilters.*\n' - '.*locationFilters.*\n') - assert re.search(expected, out, re.DOTALL) - expected = ('.*matchingJobs.*\n' - '.*matchingJobs.*\n' - '.*matchingJobs.*\n' - '.*matchingJobs.*\n' - '.*matchingJobs.*\n') - assert re.search(expected, out, re.DOTALL) +import location_search_sample + + +@pytest.fixture(scope="module") +def company_name(): + company_name, job_name, job_name2 = location_search_sample.set_up() + yield company_name + location_search_sample.tear_down(company_name, job_name, job_name2) + + +def test_location_search_sample(company_name, capsys): + @eventually_consistent.call + def _(): + location_search_sample.run_sample(company_name) + out, _ = capsys.readouterr() + expected = ('.*locationFilters.*\n' + '.*locationFilters.*\n' + '.*locationFilters.*\n' + '.*locationFilters.*\n' + '.*locationFilters.*\n') + assert re.search(expected, out, re.DOTALL) + expected = ('.*matchingJobs.*\n' + '.*matchingJobs.*\n' + '.*matchingJobs.*\n' + '.*matchingJobs.*\n' + '.*matchingJobs.*\n') + assert re.search(expected, out, re.DOTALL) diff --git a/jobs/v3/api_client/requirements-test.txt b/jobs/v3/api_client/requirements-test.txt index 1f10be83760a..7531bd92a5ee 100644 --- a/jobs/v3/api_client/requirements-test.txt +++ b/jobs/v3/api_client/requirements-test.txt @@ -1,3 +1,4 @@ pytest==5.3.2 gcp-devrel-py-tools==0.0.15 +google-cloud-core flaky==3.6.1