mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 20:22:46 +00:00
Clean up artifacts before test runs, not after
When tests fail, artifacts from that tests are necessary to properly debug the failure and determine how to fix the test. This is impossible when artifacts are immediately removed after the test is finished. Instead, the tests should remove old artifacts before the test run begins. Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
This commit is contained in:
parent
25c3aeed71
commit
4f36972414
2 changed files with 8 additions and 3 deletions
10
runtests.py
10
runtests.py
|
@ -15,9 +15,10 @@
|
|||
"""
|
||||
Executes all tests.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
# Make sure we run from the source, this is tricky because the functional
|
||||
# tests need to find both the location of the 'tito' executable script,
|
||||
|
@ -39,4 +40,9 @@ if __name__ == '__main__':
|
|||
print("Using nose %s" % nose.__version__[0:3])
|
||||
print("Running tito tests against: %s" % SRC_DIR)
|
||||
|
||||
# Make sure no older test directories exist
|
||||
for dir in os.listdir(tempfile.gettempdir()):
|
||||
if dir.endswith('-titotest'):
|
||||
shutil.rmtree(os.path.join(tempfile.gettempdir(), dir))
|
||||
|
||||
nose.main()
|
||||
|
|
|
@ -128,7 +128,6 @@ class TitoGitTestFixture(unittest.TestCase):
|
|||
|
||||
def tearDown(self):
|
||||
run_command('chmod -R u+rw %s' % self.repo_dir)
|
||||
shutil.rmtree(self.repo_dir)
|
||||
pass
|
||||
|
||||
def write_file(self, path, contents):
|
||||
|
|
Loading…
Add table
Reference in a new issue