Commit Graph

13 Commits

Author SHA1 Message Date
R.B. Boyer 05c7373a28 bulk rewrite using this script
set -euo pipefail

    unset CDPATH

    cd "$(dirname "$0")"

    for f in $(git grep '\brequire := require\.New(' | cut -d':' -f1 | sort -u); do
        echo "=== require: $f ==="
        sed -i '/require := require.New(t)/d' $f
        # require.XXX(blah) but not require.XXX(tblah) or require.XXX(rblah)
        sed -i 's/\brequire\.\([a-zA-Z0-9_]*\)(\([^tr]\)/require.\1(t,\2/g' $f
        # require.XXX(tblah) but not require.XXX(t, blah)
        sed -i 's/\brequire\.\([a-zA-Z0-9_]*\)(\(t[^,]\)/require.\1(t,\2/g' $f
        # require.XXX(rblah) but not require.XXX(r, blah)
        sed -i 's/\brequire\.\([a-zA-Z0-9_]*\)(\(r[^,]\)/require.\1(t,\2/g' $f
        gofmt -s -w $f
    done

    for f in $(git grep '\bassert := assert\.New(' | cut -d':' -f1 | sort -u); do
        echo "=== assert: $f ==="
        sed -i '/assert := assert.New(t)/d' $f
        # assert.XXX(blah) but not assert.XXX(tblah) or assert.XXX(rblah)
        sed -i 's/\bassert\.\([a-zA-Z0-9_]*\)(\([^tr]\)/assert.\1(t,\2/g' $f
        # assert.XXX(tblah) but not assert.XXX(t, blah)
        sed -i 's/\bassert\.\([a-zA-Z0-9_]*\)(\(t[^,]\)/assert.\1(t,\2/g' $f
        # assert.XXX(rblah) but not assert.XXX(r, blah)
        sed -i 's/\bassert\.\([a-zA-Z0-9_]*\)(\(r[^,]\)/assert.\1(t,\2/g' $f
        gofmt -s -w $f
    done
2022-01-20 10:46:23 -06:00
Mike Morris c44b54dea7
api: restore Leader() and Peers() to avoid breaking function signatures (#8395)
api: add TestAPI_StatusLeaderWithQueryOptions and TestAPI_StatusPeersWithQueryOptions
api: make TestAPI_Status* error messages more verbose
2020-07-29 12:09:15 -04:00
spooner bad3b6e305
Added QueryOptions for status api (#7818)
* Added QueryOptions & Tests for status api
2020-07-28 12:26:50 -04:00
Pierre Souchay 61870be137 [Travis][UnstableTests] Fixed unstable tests in travis (#5013)
* [Travis][UnstableTests] Fixed unstable tests in travis as seen in https://travis-ci.org/hashicorp/consul/jobs/460824602

* Fixed unstable tests in https://travis-ci.org/hashicorp/consul/jobs/460857687
2018-12-12 12:09:42 -08:00
Frank Schroeder 97b7578ccd api: refactor: prefix all API tests with API_ 2017-07-07 09:22:34 +02:00
Ryan Uber 234466b412 api: run tests in parallel 2015-05-08 10:27:24 -07:00
Ryan Uber 0af4bd8b23 testutil: initial pass at moving test server harness into testutil 2015-03-19 17:03:06 -07:00
Ryan Uber 7c6455e1ba api: simple test for unix socket connectivity 2015-01-16 10:56:47 -08:00
Ryan Uber ad19c0afc2 agent: beginning refactor 2015-01-16 00:45:03 -08:00
Jeff Mitchell 9bd66c70e5 Ensure a socket is created for permissions adjustment tests and fix some
items pointed out in the code review

This code is copyright 2014 Akamai Technologies, Inc. <opensource@akamai.com>
2015-01-15 14:33:44 +00:00
Jeff Mitchell 5cd607b89a Unix socket-based HTTP API test functionality. As a consequence this
also required making some hardcoded values into more generic
functionality, which is generally a good thing. I verified that each
test function that I modified still passed.:

This code is copyright 2014 Akamai Technologies, Inc. <opensource@akamai.com>
2015-01-14 19:49:37 +00:00
Ryan Uber 1faf1110aa api: add harnessing for tests
This is necessary as consul-api's tests require a real consul instance
to be running. We can't directly import an agent to fire up an instance,
due to the way this would create an import cycle. These tests instead
will start a consul instance using the binary in $PATH (if it exists).
2015-01-06 15:52:06 -08:00
Ryan Uber 5172b21ee8 api: initial import from armon/consul-api 2015-01-06 10:40:00 -08:00