Break runtests back into steps for more granular CI feedback

This commit is contained in:
Dan Buch 2016-05-09 08:58:20 -04:00
parent 2df2fa514d
commit d94fdb3e84
No known key found for this signature in database
GPG Key ID: FAEF12936DD3E3EC
2 changed files with 43 additions and 23 deletions

View File

@ -19,4 +19,6 @@ before_script:
- go get github.com/meatballhat/gfmxr/...
script:
- ./runtests
- ./runtests vet
- ./runtests test
- ./runtests gfmxr

View File

@ -13,10 +13,25 @@ PACKAGE_NAME = os.environ.get(
)
def main():
_run('go vet ./...'.split())
def main(sysargs=sys.argv[:]):
target = 'test'
if len(sysargs) > 1:
target = sysargs[1]
{
'vet': _vet,
'test': _test,
'gfmxr': _gfmxr
}[target]()
return 0
def _test():
if check_output('go version'.split()).split()[2] < 'go1.2':
_run('go test -v ./...'.split())
return
if check_output('go version'.split()).split()[2] >= 'go1.2':
coverprofiles = []
for subpackage in ['', 'altsrc']:
coverprofile = 'cli.coverprofile'
@ -33,11 +48,14 @@ def main():
combined = _combine_coverprofiles(coverprofiles)
_run('go tool cover -func={}'.format(combined.name).split())
combined.close()
else:
_run('go test -v ./...'.split())
def _gfmxr():
_run(['gfmxr', '-c', str(_gfmxr_count()), '-s', 'README.md'])
return 0
def _vet():
_run('go vet ./...'.split())
def _run(command):