Skip to content

Commit

Permalink
Merge 8f537c4 into 837873f
Browse files Browse the repository at this point in the history
  • Loading branch information
sonofmun committed May 12, 2017
2 parents 837873f + 8f537c4 commit 63c4710
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 5 additions & 4 deletions HookTest/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ def run(self):
if len(passing) == 0:
return False, 'The manifest file is empty.\nStopping build.'
self.remove_failing(self.repo_file_list(), passing)
to_zip = [x for x in glob('{}*'.format(self.dest))]
with tarfile.open("{}release.tar.gz".format(self.dest), mode="w:gz") as f:
for file in sorted(to_zip):
f.add(file)
# The following lines, while no longer needed here, could be useful for another build use case
#to_zip = [x for x in glob('{}*'.format(self.dest))]
#with tarfile.open("{}release.tar.gz".format(self.dest), mode="w:gz") as f:
# for file in sorted(to_zip):
# f.add(file)
return True, 'Build successful.'


Expand Down
4 changes: 4 additions & 0 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,16 @@ def test_remove_failing_all(self):
self.assertCountEqual(real, passing_files, "The files copied for the build do not match the expected value.")
self.assertEqual(len(real), self.len_bad_repo, "The number of files copied for the build is incorrect.")

# This test is no longer needed for the Travis CI build.
# But I am keeping it here in case we might want to create a tar file for the build for another use case.
'''
def test_tar_contents(self):
""" Compares the contents of the release.tar.gz file produced to the expected contents"""
self.createTestDir('tests/100PercentRepo')
HookTest.build.Travis(path=self.TESTDIR, dest=self.TESTDIR).run()
with tarfile.open(self.TESTDIR + 'release.tar.gz', mode='r:gz') as f:
self.assertCountEqual(f.getnames(), self.tar_contents)
'''

def test_base_class(self):
""" Tests to make sure a build run on the base class returns and error"""
Expand Down

0 comments on commit 63c4710

Please sign in to comment.