Commit be43abd9 authored by Jérome Perrin's avatar Jérome Perrin

caddy-frontend/test: fix snapshot in error cases

Because we were simply using "setupClass", all classes where storing
snapshots in the same folder, so if more than one class failed we also
had an error in storing snapshot.

/reviewed-on nexedi/slapos!683
parent e5aa01b7
Pipeline #7561 failed with stage
......@@ -534,7 +534,7 @@ class SlaveHttpFrontendTestCase(SlapOSInstanceTestCase):
cls.startServerProcess()
except BaseException:
cls.logger.exception("Error during setUpClass")
cls._cleanup('setUpClass')
cls._cleanup("{}.{}.setUpClass".format(cls.__module__, cls.__name__))
cls.setUp = lambda self: self.fail('Setup Class failed.')
raise
......@@ -559,7 +559,9 @@ class SlaveHttpFrontendTestCase(SlapOSInstanceTestCase):
cls.waitForCaddy()
except BaseException:
cls.logger.exception("Error during setUpClass")
cls._cleanup('setUpClass')
# "{}.{}.setUpClass".format(cls.__module__, cls.__name__) is already used by SlapOSInstanceTestCase.setUpClass
# so we use another name for snapshot, to make sure we don't store another snapshot in same directory.
cls._cleanup("{}.SlaveHttpFrontendTestCase.{}.setUpClass".format(cls.__module__, cls.__name__))
cls.setUp = lambda self: self.fail('Setup Class failed.')
raise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment