Add file exists check in integration-aliases test.

pull/46462/head
Matt Clay 6 years ago
parent b74279d14c
commit 33a8be9109

@ -4,6 +4,7 @@ from __future__ import absolute_import, print_function
import json
import textwrap
import re
import os
from lib.sanity import (
SanitySingleVersion,
@ -36,6 +37,8 @@ from lib.util import (
class IntegrationAliasesTest(SanitySingleVersion):
"""Sanity test to evaluate integration test aliases."""
SHIPPABLE_YML = 'shippable.yml'
DISABLED = 'disabled/'
UNSTABLE = 'unstable/'
UNSUPPORTED = 'unsupported/'
@ -86,7 +89,7 @@ class IntegrationAliasesTest(SanitySingleVersion):
:rtype: list[str]
"""
if not self._shippable_yml_lines:
with open('shippable.yml', 'r') as shippable_yml_fd:
with open(self.SHIPPABLE_YML, 'r') as shippable_yml_fd:
self._shippable_yml_lines = shippable_yml_fd.read().splitlines()
return self._shippable_yml_lines
@ -143,6 +146,12 @@ class IntegrationAliasesTest(SanitySingleVersion):
if args.explain:
return SanitySuccess(self.name)
if not os.path.isfile(self.SHIPPABLE_YML):
return SanityFailure(self.name, messages=[SanityMessage(
message='file missing',
path=self.SHIPPABLE_YML,
)])
results = dict(
comments=[],
labels={},

Loading…
Cancel
Save