Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ def _setup_split_targets_build(bucket_path, fuzz_target, revision=None):

# Check this so that we handle deleted targets properly.
targets_list = _get_targets_list(bucket_path)
if fuzz_target not in targets_list:
if not targets_list or fuzz_target not in targets_list:
raise errors.BuildNotFoundError(revision, environment.get_value('JOB_NAME'))

fuzz_target_bucket_path = _full_fuzz_target_path(bucket_path, fuzz_target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,12 @@ def test_target_not_built(self):
os.environ['FUZZ_TARGET_BUILD_BUCKET_PATH'])
self.assertCountEqual(['target1', 'target3'], targets_list)

def test_setup_split_build_no_targets_list(self):
"""Test that BuildNotFoundError is raised when the targets list is missing."""
self.mock.read_data.return_value = None
with self.assertRaises(errors.BuildNotFoundError):
build_manager.setup_build(fuzz_target='target3')

def test_target_no_longer_built(self):
"""Test a target that's not longer listed in target.list."""
test_helpers.patch(self, [
Expand Down