Commit ba4e5190 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.
parent 3ba2ca38
Pipeline #7514 failed with stage
in 0 seconds
......@@ -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