예제 #1
0
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
예제 #2
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
예제 #3
0
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
예제 #4
0
 def test_gitrepo(self):
     git = repository.gitrepo(Arguments.base_dir)
     self.assertEqual(git, GIT_EXP)
예제 #5
0
 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'))
예제 #6
0
 def test_gitrepo_remotes(self):
     git = repository.gitrepo(Arguments.base_dir)
     self.assertEqual(git['remotes'], GIT_EXP['remotes'])
예제 #7
0
 def test_gitrepo_head(self):
     git = repository.gitrepo(Arguments.base_dir)
     self.assertEqual(git['head'], GIT_EXP['head'])
예제 #8
0
 def test_gitrepo_branch(self):
     git = repository.gitrepo(Arguments.base_dir)
     self.assertTrue(git['branch'] in (GIT_EXP['branch'], 'HEAD'))
예제 #9
0
 def test_gitrepo_head(self):
     git = repository.gitrepo(Arguments.base_dir)
     self.assertEqual(git['head'], GIT_EXP['head'])
예제 #10
0
 def test_gitrepo_branch(self):
     git = repository.gitrepo(Arguments.base_dir)
     self.assertTrue(git['branch'] in (GIT_EXP['branch'], 'HEAD'))
예제 #11
0
 def test_gitrepo_remotes(self):
     git = repository.gitrepo(Arguments.base_dir)
     self.assertEqual(git['remotes'], GIT_EXP['remotes'])
예제 #12
0
 def test_gitrepo_branch(self):
     git = repository.gitrepo(Arguments.base_dir)
     self.assertTrue(git["branch"] in (GIT_EXP["branch"], "HEAD"))
예제 #13
0
 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'))
예제 #14
0
 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"))