~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to gotesttarfile.py

  • Committer: Martin Packman
  • Date: 2016-04-29 00:19:30 UTC
  • mto: This revision was merged to the branch mainline in revision 1389.
  • Revision ID: martin.packman@canonical.com-20160429001930-yoju030ik6lwqf0e
Add clean_maas.py script for releasing machines

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
    env = dict(os.environ)
70
70
    env['GOPATH'] = gopath
71
71
    env['GOARCH'] = 'amd64'
72
 
    build_cmd = [go_cmd, 'test', '-i', './...']
73
 
    test_cmd = [go_cmd, 'test', '-timeout=1200s', './...']
74
72
    if sys.platform == 'win32':
75
73
        # Ensure OpenSSH is never in the path for win tests.
76
74
        sane_path = [p for p in env['PATH'].split(';') if 'OpenSSH' not in p]
85
83
        if verbose:
86
84
            print_now('Setting environ TMP and TEMP to:')
87
85
            print_now(env['TEMP'])
88
 
        build_cmd = ['powershell.exe', '-Command'] + build_cmd
89
 
        test_cmd = ['powershell.exe', '-Command'] + test_cmd
 
86
        command = ['powershell.exe', '-Command', go_cmd, 'test', './...']
 
87
    else:
 
88
        command = [go_cmd, 'test', './...']
90
89
    package_dir = os.path.join(gopath, 'src', package.replace('/', os.sep))
91
90
    with WorkingDirectory(package_dir):
92
91
        if verbose:
93
 
            print_now('Building test dependencies')
94
 
        returncode = run(build_cmd, env=env)
95
 
        if returncode != 0:
96
 
            return returncode
97
 
        if verbose:
98
92
            print_now('Running unit tests in %s' % package)
99
 
        returncode = run(test_cmd, env=env)
 
93
        returncode = run(command, env=env)
100
94
        if verbose:
101
95
            if returncode == 0:
102
96
                print_now('SUCCESS')