def run(self): """Find all Terraform tests and run them.""" import_tests(self.logger, self.tests_dir, 'test_*') tests = [test(self.logger) for test in Terraform.__subclasses__()] self.logger.debug('FOUND TESTS: %s', tests) self.set_environment('dev') return execute_tests(tests, self.logger)
def main(self): """Import and run tests.""" import_tests(self.logger, self.working_dir, self.test_to_run) errs = self.run_tests() if errs > 0: self.logger.error('Tests failed; Check logs.') return 1 if errs > 0 else 0
def run(self): """Find all tests and run them.""" import_tests(self.logger, self.tests_dir, 'test_*') tests = [test(self.logger) for test in TestSources.__subclasses__()] self.logger.debug('FOUND TESTS: %s', tests) self.set_environment('dev') err_count = execute_tests(tests, self.logger) assert err_count == 0 return err_count
def main(self): """Main entry.""" if os.environ.get('DEBUG'): logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) import_tests(self, self.WORKING_DIR) errs = self.run_tests() if errs > 0: self.LOGGER.error('Tests failed; Check logs.') return 1 if errs > 0 else 0
def run(self): """Find all Serverless tests and run them.""" import_tests(self.logger, self.base_dir, 'serverless_test') serverless_test = Serverless.__subclasses__()[0] tests = [] for template in os.listdir(self.templates_dir): if os.path.isdir(os.path.join(self.templates_dir, template)): self.logger.info('Found template "%s"', template) test = serverless_test(template, self.templates_dir, self.environment, self.logger) tests.append(test) else: self.logger.warning('"%s" is not a directory, skipping...', template) return execute_tests(tests, self.logger)
def init(self): """Initialize backend.""" import_tests(self, self.tests_dir, 'test_*')