def wear(args=None): from coveralls.control import coveralls from coveralls.repository import gitrepo from coveralls.api import post import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger('coveralls') args = args or parse_args() coverage = coveralls(data_file=args.data_file, config_file=args.config_file) coverage.load() response = post( url=args.coveralls_url, repo_token=args.repo_token, service_job_id=args.service_job_id, service_name=args.service_name, git=gitrepo(args.base_dir) if not args.nogit else {}, source_files=coverage.coveralls(args.base_dir, ignore_errors=args.ignore_errors, merge_file=args.merge_file), parallel=args.parallel, ) logger.info(response.status_code) logger.info(response.text) return 1 if 'error' in response.json() else 0
def wear(args=None): from coveralls.control import coveralls from coveralls.repository import gitrepo from coveralls.api import post args = args or parse_args() coverage = coveralls(data_file=args.data_file, config_file=args.config_file) coverage.load() response = post( url=args.coveralls_url, repo_token=args.repo_token, service_job_id=args.service_job_id, service_name=args.service_name, git=gitrepo(args.base_dir), source_files=coverage.coveralls(args.base_dir), ) print(response.text) return response
def wear(args=None): from coveralls.control import coveralls from coveralls.repository import gitrepo from coveralls.api import post import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger('coveralls') args = args or parse_args() coverage = coveralls(data_file=args.data_file, config_file=args.config_file) coverage.load() response = post( url=args.coveralls_url, repo_token=args.repo_token, service_job_id=args.service_job_id, service_name=args.service_name, git=gitrepo(args.base_dir), source_files=coverage.coveralls(args.base_dir, ignore_errors=args.ignore_errors), ) logger.info(response.status_code) logger.info(response.text) return 1 if 'error' in response.json() else 0
def test_gitrepo(self): git = repository.gitrepo(Arguments.base_dir) self.assertEqual(git, GIT_EXP)
def test_gitrepo(self): git = repository.gitrepo(Arguments.base_dir) self.assertEqual(git['head'], GIT_EXP['head']) self.assertEqual(git['remotes'], GIT_EXP['remotes']) self.assertTrue(git['branch'] in (GIT_EXP['branch'], 'HEAD'))
def test_gitrepo_remotes(self): git = repository.gitrepo(Arguments.base_dir) self.assertEqual(git['remotes'], GIT_EXP['remotes'])
def test_gitrepo_head(self): git = repository.gitrepo(Arguments.base_dir) self.assertEqual(git['head'], GIT_EXP['head'])
def test_gitrepo_branch(self): git = repository.gitrepo(Arguments.base_dir) self.assertTrue(git['branch'] in (GIT_EXP['branch'], 'HEAD'))
def test_gitrepo_branch(self): git = repository.gitrepo(Arguments.base_dir) self.assertTrue(git["branch"] in (GIT_EXP["branch"], "HEAD"))
def test_gitrepo(self): git = repository.gitrepo(Arguments.base_dir) self.assertEqual(git["head"], GIT_EXP["head"]) self.assertEqual(git["remotes"], GIT_EXP["remotes"]) self.assertTrue(git["branch"] in (GIT_EXP["branch"], "HEAD"))