Commit graph

13 commits

Author SHA1 Message Date
Dave Collins fdfa07b0be
btcec: Consolidate tests into the btcec package.
Putting the test code in the same package makes it easier for forks
since they don't have to change the import paths as much and it also
gets rid of the need for internal_test.go to bridge.

Also, remove the exception from the lint checks about returning the
unexported type since it is no longer required.
2016-10-19 00:55:23 -05:00
Dave Collins 754c4fbe0c
rpctest: Gate rpctest-based behind a build tag.
This adds a new build tag named rpctest which must be set in order for
rpctest-based tests to be executed.  The new build tag is also added to
the goclean.sh script which is executed by Travis during continuous
integration builds.

This change is being made because the rpctest framework requires
additional careful user configuration to ensure the version of btcd
under test can be programmatically launched from the system path with
all of the necessary ports open whereas all of the other tests are
self-contained within the test binary itself.

Since said additional configuration is typically not done, it leads to a
lot of false positives.  Putting the tests behind a build tag allows
them to remain to be available and run during continuous integration
without imposing the additional configuration requirements on users.
2016-09-26 01:20:31 -05:00
Dave Collins 7cf9ec8190
rpctest: Use ports based on the process id.
This modifies the ports that are selected for use for the p2p and rpc
ports to start with a port that is based on the process id instead of a
hard-coded value.  The chosen ports are incremented for each running
instance similar to the previous code except the p2p and rpc ports and
now split into ranges instead of being 2 apart.

This is being done because the previous code only worked for a single
process which means it prevented the ability to run tests in parallel.

The new approach will work with multiple processes, however it must be
stated that there is still a very small probability that the stars could
align resulting in the same ports being selected.

Finally, this also reverts the recent change to run tests serially since
this fixes the underlying cause for that change.
2016-09-20 16:59:37 -05:00
Olaoluwa Osuntokun daac24626e build: execute tests across all packages serially
This modifies the goclean.sh to execute all the tests amongst
the packages serially. The default behavior of the `go test` command is
to execute all tests in parallel amongst the listed packages. This
behavior can at times cause tests which use the `rpctest` package to
fail due to multiple `btcd` nodes attempting to bind to the same port
simultaneously. As only one node can successfully bind to the port, the
btcd processes for the other concurrent harness instances exit silently
causing the RPC clients to fail with connection timeouts as their
target process no longer exists. Executing all tests serially
eliminates such a race condition which can cause non-deterministic test
failures.
2016-09-20 01:16:08 -05:00
Dave Collins 2554caee59 build: Convert project to use glide. (#689)
This converts the project to allow btcd to be used with the glide
package manager in order to provide stable and reproducible builds
without the user having to jump through all of the hoops as they do
today.

It consists of adding a glide.yaml file which identifies the project
dependencies and locations along with a glide.lock file which contains
the complete dependency tree pinned to specific versions.  Glide uses
these files to download the packages (or updates) to a local vendor
directory and checkout the correct pinned versions.  The go tool, in
turn, is used to build/install btcd and will use the pinned versions in
the vendor directory.

This also updates TravisCI to build using glide, removes some of the
exceptions in the lint checks which are no longer required, and updates
the README.md with the new instructions needed to build the project with
glide.
2016-05-06 10:47:53 -05:00
Dave Collins 5a9bac9668 Correct a few style related issues found by golint.
Also, update TravisCI goclean script to remove the special casing which
ignored 'Id' from the lint output since that exception is no longer
needed.  It was previously required due to the old version of btcjson,
but that is no longer in the repo.
2015-10-20 10:34:14 -05:00
Dave Collins e6d5c163d5 Update TravisCI to test against golang 1.5.1.
Also, modify the goclean.sh script to quote the test command arguments
and update the vet test to exclude recent false positives.
2015-09-17 11:01:34 -05:00
Dave Collins 6c12445fd5 build: Make goclean.sh script output more verbose.
This commit makes the goclean script print every line it is executing so
any failures are more obvious where they're coming from.

Closes #361.
2015-04-14 15:12:44 -05:00
Dave Collins 2519ff2856 Prepare lint exceptions for upcoming btcjson merge. 2015-02-19 11:22:02 -06:00
Dave Collins 15aa91514a Correct path to find in TravisCI goclean script.
Fixes #294.
2015-02-10 15:55:45 -06:00
Dave Collins 8134f68a4b Update TravisCI to ignore false positive in btcec.
Also correct format verb found by go vet.
2015-02-06 10:51:13 -06:00
Dave Collins 979d67627f Update for recent TravisCI changes.
Also, override the struct tag checking which is broken in the latest go
vet.
2015-02-05 14:07:27 -06:00
Dave Collins 642e3c741a Update TravisCI to goclean script.
This commit causes TravisCI to run several tools on each pull request and
commit to help ensure the code quality remains high.  This includes gofmt,
goimports, golint, go vet, the race detector, and coverage stats.

Also, it instructs TravisCI to use nicer container-based builds.
2015-01-30 22:21:39 -06:00