Skip to content

Commit

Permalink
Add file exists check in integration-aliases test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay committed Oct 3, 2018
1 parent b74279d commit 33a8be9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/runner/lib/sanity/integration_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import textwrap
import re
import os

from lib.sanity import (
SanitySingleVersion,
Expand Down Expand Up @@ -36,6 +37,8 @@

class IntegrationAliasesTest(SanitySingleVersion):
"""Sanity test to evaluate integration test aliases."""
SHIPPABLE_YML = 'shippable.yml'

DISABLED = 'disabled/'
UNSTABLE = 'unstable/'
UNSUPPORTED = 'unsupported/'
Expand Down Expand Up @@ -86,7 +89,7 @@ def shippable_yml_lines(self):
: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
Expand Down Expand Up @@ -143,6 +146,12 @@ def test(self, args, targets):
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={},
Expand Down

0 comments on commit 33a8be9

Please sign in to comment.