|  | @@ -48,9 +48,8 @@ argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int)
 | 
	
		
			
				|  |  |  argp.add_argument('--gcr_path',
 | 
	
		
			
				|  |  |                    default='gcr.io/grpc-testing',
 | 
	
		
			
				|  |  |                    help='Path of docker images in Google Container Registry')
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  argp.add_argument('--release',
 | 
	
		
			
				|  |  | -                  default='master',
 | 
	
		
			
				|  |  | +                  default='all',
 | 
	
		
			
				|  |  |                    choices=['all', 'master'] + _RELEASES,
 | 
	
		
			
				|  |  |                    help='Release tags to test.  When testing all '
 | 
	
		
			
				|  |  |                    'releases defined in client_matrix.py, use "all".')
 | 
	
	
		
			
				|  | @@ -94,14 +93,15 @@ def find_all_images_for_lang(lang):
 | 
	
		
			
				|  |  |    for runtime in client_matrix.LANG_RUNTIME_MATRIX[lang]:
 | 
	
		
			
				|  |  |      image_path = '%s/grpc_interop_%s' % (args.gcr_path, runtime)
 | 
	
		
			
				|  |  |      output = subprocess.check_output(['gcloud', 'beta', 'container', 'images',
 | 
	
		
			
				|  |  | -                                        'list-tags', '--format=json', image_path])
 | 
	
		
			
				|  |  | +                                      'list-tags', '--format=json', image_path])
 | 
	
		
			
				|  |  |      docker_image_list = json.loads(output)
 | 
	
		
			
				|  |  |      # All images should have a single tag or no tag.
 | 
	
		
			
				|  |  | +    # TODO(adelez): Remove tagless images.
 | 
	
		
			
				|  |  |      tags = [i['tags'][0] for i in docker_image_list if i['tags']]
 | 
	
		
			
				|  |  |      jobset.message('START', 'Found images for %s: %s' % (image_path, tags),
 | 
	
		
			
				|  |  |                     do_newline=True)
 | 
	
		
			
				|  |  |      skipped = len(docker_image_list) - len(tags)
 | 
	
		
			
				|  |  | -    jobset.message('START', 'Skipped images (no-tag/unknown-tag): %d' % skipped,
 | 
	
		
			
				|  |  | +    jobset.message('SKIPPED', 'Skipped images (no-tag/unknown-tag): %d' % skipped,
 | 
	
		
			
				|  |  |                     do_newline=True)
 | 
	
		
			
				|  |  |      # Filter tags based on the releases.
 | 
	
		
			
				|  |  |      images[runtime] = [(tag,'%s:%s' % (image_path,tag)) for tag in tags if
 | 
	
	
		
			
				|  | @@ -148,6 +148,7 @@ def run_tests_for_lang(lang, runtime, images):
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    images is a list of (<release-tag>, <image-full-path>) tuple.
 | 
	
		
			
				|  |  |    """
 | 
	
		
			
				|  |  | +  total_num_failures = 0
 | 
	
		
			
				|  |  |    for image_tuple in images:
 | 
	
		
			
				|  |  |      release, image = image_tuple
 | 
	
		
			
				|  |  |      jobset.message('START', 'Testing %s' % image, do_newline=True)
 | 
	
	
		
			
				|  | @@ -161,6 +162,7 @@ def run_tests_for_lang(lang, runtime, images):
 | 
	
		
			
				|  |  |                                           maxjobs=args.jobs)
 | 
	
		
			
				|  |  |      if num_failures:
 | 
	
		
			
				|  |  |        jobset.message('FAILED', 'Some tests failed', do_newline=True)
 | 
	
		
			
				|  |  | +      total_num_failures += num_failures
 | 
	
		
			
				|  |  |      else:
 | 
	
		
			
				|  |  |        jobset.message('SUCCESS', 'All tests passed', do_newline=True)
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -170,6 +172,9 @@ def run_tests_for_lang(lang, runtime, images):
 | 
	
		
			
				|  |  |          'grpc_interop_matrix',
 | 
	
		
			
				|  |  |          '%s__%s %s'%(lang,runtime,release),
 | 
	
		
			
				|  |  |          str(uuid.uuid4()))
 | 
	
		
			
				|  |  | +  
 | 
	
		
			
				|  |  | +  return total_num_failures
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  _docker_images_cleanup = []
 | 
	
		
			
				|  |  |  def cleanup():
 | 
	
	
		
			
				|  | @@ -180,9 +185,14 @@ def cleanup():
 | 
	
		
			
				|  |  |  atexit.register(cleanup)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  languages = args.language if args.language != ['all'] else _LANGUAGES
 | 
	
		
			
				|  |  | +total_num_failures = 0
 | 
	
		
			
				|  |  |  for lang in languages:
 | 
	
		
			
				|  |  |    docker_images = find_all_images_for_lang(lang)
 | 
	
		
			
				|  |  |    for runtime in sorted(docker_images.keys()):
 | 
	
		
			
				|  |  | -    run_tests_for_lang(lang, runtime, docker_images[runtime])
 | 
	
		
			
				|  |  | +    total_num_failures += run_tests_for_lang(lang, runtime, docker_images[runtime])
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  report_utils.create_xml_report_file(_xml_report_tree, args.report_file)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +if total_num_failures:
 | 
	
		
			
				|  |  | +  sys.exit(1)
 | 
	
		
			
				|  |  | +sys.exit(0)
 |