Skip to content

Commit

Permalink
Removed test functionality from build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross McDonald authored and geodimm committed Mar 10, 2016
1 parent 73a0c8e commit 0c5c1bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 44 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
- [#781](https://github.com/influxdata/telegraf/pull/781): Fix mqtt_consumer username not being set. Thanks @chaton78!
- [#786](https://github.com/influxdata/telegraf/pull/786): Fix mqtt output username not being set. Thanks @msangoi!
- [#773](https://github.com/influxdata/telegraf/issues/773): Fix duplicate measurements in snmp plugin. Thanks @titilambert!
- [#708](https://github.com/influxdata/telegraf/issues/708): packaging: build ARM package
- [#713](https://github.com/influxdata/telegraf/issues/713): packaging: insecure permissions error on log directory

## v0.10.4.1

Expand Down
48 changes: 4 additions & 44 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ def go_get(branch, update=False, no_stash=False):
run("{}/bin/gdm restore".format(os.environ.get("GOPATH")))
return True

def run_tests(race, parallel, timeout, no_vet):
# Currently a NOOP for Telegraf
return True

################
#### All Telegraf-specific content above this line
################
Expand Down Expand Up @@ -324,50 +328,6 @@ def upload_packages(packages, bucket_name=None, nightly=False):
print("")
return 0

def run_tests(race, parallel, timeout, no_vet):
print("Downloading vet tool...")
sys.stdout.flush()
run("go get golang.org/x/tools/cmd/vet")
print("Running tests:")
print("\tRace: {}".format(race))
if parallel is not None:
print("\tParallel: {}".format(parallel))
if timeout is not None:
print("\tTimeout: {}".format(timeout))
sys.stdout.flush()
p = subprocess.Popen(["go", "fmt", "./..."], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if len(out) > 0 or len(err) > 0:
print("Code not formatted. Please use 'go fmt ./...' to fix formatting errors.")
print(out)
print(err)
return False
if not no_vet:
p = subprocess.Popen(go_vet_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if len(out) > 0 or len(err) > 0:
print("Go vet failed. Please run 'go vet ./...' and fix any errors.")
print(out)
print(err)
return False
else:
print("Skipping go vet ...")
sys.stdout.flush()
test_command = "go test -v"
if race:
test_command += " -race"
if parallel is not None:
test_command += " -parallel {}".format(parallel)
if timeout is not None:
test_command += " -timeout {}".format(timeout)
test_command += " ./..."
code = os.system(test_command)
if code != 0:
print("Tests Failed")
return False
else:
print("Tests Passed")
return True

def build(version=None,
branch=None,
Expand Down

0 comments on commit 0c5c1bf

Please sign in to comment.