diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-08-03 10:03:29 +0000 |
---|---|---|
committer | Baserock Gerrit <gerrit@baserock.org> | 2015-09-01 08:25:24 +0000 |
commit | 0b50b9ceca5fc604550537297e786d876d28508a (patch) | |
tree | cdc599c2e293ff8269e612c8b265648c9ac505d1 /morphlib/stagingarea_tests.py | |
parent | 41cbcdf6b5c0f823ac5589faaf6da3651ad69dab (diff) | |
download | morph-0b50b9ceca5fc604550537297e786d876d28508a.tar.gz |
Stop moving staging areas of failed builds
Stop moving staging areas of failed builds from the 'staging' directory
to the 'failed' directory. Moving staging areas make it very difficult
to debug build failures on the build essential chunks, as the paths set
on the configure scripts and some environment variables (e.g.
STAGE2_SYSROOT, DESTDIR) will be invalid after moving the staging area.
This change will also make it easier to create scripts that chroot n
environment similiar to the one where the build failure occurred.
To make it still possible to safely do a build an run `morph gc` in
parallel, we use flock(2) to control access to the staging area
directory.
Also, move the `test_supports_non_isolated_mode` test into a different
class, as it requires a different SetUp() routine (the staging area is
contructed with different parameters).
Change-Id: I06c3c435ad05c12afabc0adc2a9d4f8a284ccc02
Diffstat (limited to 'morphlib/stagingarea_tests.py')
-rw-r--r-- | morphlib/stagingarea_tests.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/morphlib/stagingarea_tests.py b/morphlib/stagingarea_tests.py index 97d78236..f08a3989 100644 --- a/morphlib/stagingarea_tests.py +++ b/morphlib/stagingarea_tests.py @@ -135,8 +135,19 @@ class StagingAreaTests(unittest.TestCase): self.sa.remove() self.assertFalse(os.path.exists(self.staging)) - def test_supports_non_isolated_mode(self): - sa = morphlib.stagingarea.StagingArea( + +class StagingAreaNonIsolatedTests(unittest.TestCase): + + def setUp(self): + self.tempdir = tempfile.mkdtemp() + self.staging = os.path.join(self.tempdir, 'staging') + self.build_env = FakeBuildEnvironment() + self.sa = morphlib.stagingarea.StagingArea( object(), self.staging, self.build_env, use_chroot=False) + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def test_supports_non_isolated_mode(self): filename = os.path.join(self.staging, 'foobar') - self.assertEqual(sa.relative(filename), filename) + self.assertEqual(self.sa.relative(filename), filename) |