Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
added test to ensure proper creation of targets when copying jobsteps
Browse files Browse the repository at this point in the history
Summary: This diff doesn't contain any code change aside from tests. It updates the test for creating replacement jobstep to ensure that bazel targets are also properly recreated.

Test Plan: unit tests

Reviewers: paulruan

Reviewed By: paulruan

Subscribers: changesbot, wwu, kylec, anupc

Differential Revision: https://tails.corp.dropbox.com/D232859
  • Loading branch information
Naphat Sanguansin committed Sep 28, 2016
1 parent 3ed807b commit 81c647e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/changes/buildsteps/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def test_create_replacement_jobstep_expanded(self, get_vcs):
FutureCommand('echo 1'),
FutureCommand('echo "foo"\necho "bar"', path='subdir'),
],
data={'weight': 1, 'forceInfraFailure': True},
data={'weight': 1, 'forceInfraFailure': True, 'targets': ['//A:test', '//B:test']},
)

buildstep = self.get_buildstep(cluster='foo')
Expand All @@ -569,6 +569,10 @@ def test_create_replacement_jobstep_expanded(self, get_vcs):
assert fail_jobstep.replacement_id == new_jobstep.id
assert new_jobstep.data['avoid_node'] == 'ip-127-0-0-1'

# make sure targets are copied over
assert len(new_jobstep.targets) == 2
assert set([t.name for t in new_jobstep.targets]) == set(['//A:test', '//B:test'])

# we want the replacement jobstep to have the same attributes the
# original jobstep would be expected to after expand_jobstep()
assert new_jobstep.data['expanded'] is True
Expand Down

0 comments on commit 81c647e

Please sign in to comment.