82 Commits

Author SHA1 Message Date
Vanshdeep Singh
7f6782e31d Problem: ABCI server not run for tests (#2138)
Solution: Create seperate test mark for which the ABCI server will be running
2018-04-10 17:29:25 +02:00
codegeschrei
6f69f39ff4 Problem: there are no f-strings in python 3.5 (#2185)
Solution: change f-strings to a compatible format for Python 3.5
2018-04-09 17:02:59 +02:00
Sylvain Bellemare
802cc73d33 Problem: import order does not follow pep8
Solution: follow pep8
2018-03-01 17:50:20 +01:00
Sylvain Bellemare
c85c664215 Problem: fixture with no asset fails
Solution: instantiate the transaction with a dummy asset
2018-03-01 15:11:58 +01:00
Sylvain Bellemare
51d4f0f2d9 Problem: utxoset needs to be updated
Solution: update utxoset via store_transaction
2018-03-01 15:11:58 +01:00
Vanshdeep Singh
5bfa8e29d8 Crash recovery mechanism (#2045)
* Crash recovery mechanism

* Propogate exception

* Added docs and crash receovery during block write

* Fix flake8 issue

* Remove approach 1 for crash recovery, recover db on 'bigchiandb start'

* Fix CI build issues

* Remove documentation
2018-02-21 10:50:12 +01:00
Sylvain Bellemare
1f537b1557 Problem: to get tx utxoset & inputs is cumbersome (#2055)
Solution: add properties to more easily get the utxoset and inputs of a
transaction
2018-02-15 18:23:29 +01:00
vrde
cd6095e854 Problem: test suite doesn't pick up env vars
Solution: call `env_config` from the configuration fixture
2018-02-14 16:43:09 +01:00
Sylvain Bellemare
161ccdda5d Implement UTXO set backend (#2033) 2018-02-14 15:37:19 +01:00
vrde
55073366ec Problem: new env vars are not managed by the conf
Solution: add `BIGCHAINDB_` to new tendermint vars. Reference:
https://github.com/bigchaindb/bigchaindb/pull/2039#discussion_r167880795
2018-02-14 12:18:59 +01:00
Sylvain Bellemare
6e3f9e8f54 Docker compose for travis (#2039)
* Replace double quotes with single quotes (flake8)

* Test event subscriber to tendermint via ws

* Problem: Tendermint is not part of stack for CI

Solution: Add Tendermint to stack for CI. For simplicity's sake
docker-compose is being used.
2018-02-14 10:19:04 +01:00
Sylvain Bellemare
cc069fa640 Add db_context fixture 2018-02-08 15:26:50 +01:00
Sylvain Bellemare
52d0c7024a
Merge branch 'master' into tendermint 2017-12-23 04:58:18 +01:00
Sylvain Bellemare
8bd8dc02a4 Fixes #1969 2017-12-22 18:03:57 +01:00
Sylvain Bellemare
cb268a3832
Merge branch 'master' into tendermint 2017-12-06 16:59:26 +01:00
Sylvain Bellemare
9dd2e026b0 Fixes #1891 2017-12-05 19:38:52 +01:00
vrde
1e104ad2c4
Merge branch 'master' into tendermint 2017-11-30 18:17:36 +01:00
Katha
e377fb57af
Pre commit styling (#1914)
* run pre-commit and fix errors

* mention pre-commit in our guides
2017-11-30 15:04:14 +01:00
kansi
fcfe577813 Added localmongodb marker 2017-11-24 12:30:57 +05:30
kansi
6c3f176122 Integrate asset search 2017-11-23 21:28:51 +05:30
Vanshdeep Singh
5ce2eb1f97 Bypass CI issues for rethinkdb (#1821)
Add custom marker to skip some travis/rdb tests
2017-11-08 19:41:17 +01:00
Krish
3ec4153375 Support for advertised host, port, scheme for Websockets (#1703)
* Support for advertised host, port, scheme for Websockets

* Update docs

* Add a docstring

* Set env vars in Dockerfile-dev too
2017-08-08 12:04:58 +02:00
Krish
e8411fc99e Do not allow duplicate GENESIS block creation - #1556 (#1612)
* Add a check for GENESIS transaction

* Add test and fixture

* Removed database query for GENESIS block

* Undo log level change
2017-07-03 17:21:15 +02:00
Sylvain Bellemare
26f14aadec Parametrize websocket api tests for docker 2017-07-03 15:23:50 +02:00
Krish
f35f01f1cb Add SSL support for MongoDB connections (#1510)
* Add SSL support for MongoDB connections

* Tests for TLS connectivity and other fixes

* Add test for ssl parameters

* Add test for AuthenticationError

* Cleanup branch

* Split env vars as per @r-marques suggestion

* Remove SSL_ENABLED and use BIGCHAINDB_DATABASE_SSL instead

* Changes as per comments from @r-marques

* Remove redundant tests

* Test for ConfigurationError
2017-06-13 12:04:34 +02:00
vrde
3995e22d4a Fail if config file not found 2017-05-18 17:43:44 +02:00
Sylvain Bellemare
eff8e3adf3 Update logging related code and tests after rebase 2017-03-21 11:12:46 +01:00
Brett Sun
f549b00813 Add tests for setting log-level from CLI 2017-03-21 11:12:46 +01:00
Sylvain Bellemare
102406dd35 Add fixtures for alice, bob, and carol 2017-03-16 17:04:50 +01:00
Rodolphe Marques
4740150f6d Updated config fixture
Simplified tests.
2017-01-31 10:57:58 +01:00
Rodolphe Marques
f12264773c bigchaindb configure now requires a positional backend argument.
Created and fixed tests.
Updated `b` fixture
2017-01-23 16:49:59 +01:00
Rodolphe Marques
e7ffcf5705 Added replicaset name to bigchaindb config (#1063)
* Added replicaset name to bigchaindb config

* changed travis replSet to match bigchaindb default

* Updated initialize_replica_set

It now initializes the replica set with the name provided by the
bigchaindb config file.


* initialize_replica_set is now called when creating a mongodb connection.

This way we are sure that a replica set exists when we return a
connection.

* Moved the initialize replica set logic to the connection.

* update the config documentation
2017-01-20 14:05:28 +01:00
Sylvain Bellemare
4d6df06236 Resolves #948 2017-01-16 07:12:25 -05:00
Sylvain Bellemare
1cfd3de60e Fix flake8 errors in tests 2017-01-11 05:13:27 -05:00
Rodolphe Marques
aa6d4fdcc8 small fix to test 2017-01-10 15:31:16 +01:00
Rodolphe Marques
8926178e52 initialize replica set for tests 2017-01-09 13:32:17 +01:00
Brett Sun
9319583ab4 Remove Asset and AssetLink (#982)
* Remove asset.validate_asset and move its validation checks to other areas

* Move Asset.get_asset_id to Transaction

* Remove Asset and AssetLink models

* Add test against creating TRANSFER transactions with bad asset
2016-12-22 10:19:21 +01:00
Sylvain Bellemare
44391da94a Add genesis block fixture and marker 2016-12-21 17:45:14 +01:00
Sylvain Bellemare
3a7fe30a31 Add description for bdb marker 2016-12-20 20:37:28 +01:00
Sylvain Bellemare
57b14c3062 Rename db_name to dbname 2016-12-20 20:37:28 +01:00
Sylvain Bellemare
7db02fa024 Get config from bigchaindb not from fixture
the fixture no longer returns the config, and is meant only to set the
config
2016-12-20 20:37:28 +01:00
Sylvain Bellemare
fa79fe6783 Add session scope test setup for config and db
resolves #966
2016-12-20 20:37:28 +01:00
libscott
7e33f2bd52 Tx ID as Asset ID (#926)
* Allow AssetLinks to be used in place of Assets in the Transaction Model and enforce `Transaction.transfer()` to only take an AssetLink

* Remove AssetLink's inheritance from Asset

* Remove id from the Asset model

* Fix get_txids_by_asset_id query for rethinkdb after removing asset's uuid

Because `CREATE` transactions don't have an asset that contains an id
anymore, one way to find all the transactions related to an asset is to
query the database twice: once for the `CREATE` transaction and another
for the `TRANSFER` transactions.

* Add TODO notice for vote test utils to be fixtures

* Update asset model documentation to reflect usage of transaction id

* Fix outdated asset description in transaction schema
2016-12-20 17:28:15 +01:00
Sylvain Bellemare
6b319cf3d6 Use yield statement instead of finalizer
to specify teardown code
2016-12-17 21:16:47 +01:00
Brett Sun
b4063dd9ad More test abstractions for multiple databases (#950)
* Remove unnecessary import of rethinkdb in a test

* Move test_run_query_util as a rethinkdb-specific test

* Move rethinkdb-specific command tests to own file

* Add __init__.py to new test folders

* Move command tests to their own test module

* Move fixtures out of command tests into separate conftest for commands

* Fix some small flake8 issues with rethinkdb's test_run_query_util

* Add pytest ignore hook to filter out test dirs that are not for the requested backend

* Move backend-specific tests in tests/db/ to tests/backend/
2016-12-16 22:17:13 +01:00
Sylvain Bellemare
c81e7a7479 Merge pull request #954 from sbellem/re-work-test-fixtures-iter-one
Re work test fixtures iter one
2016-12-16 20:59:27 +01:00
Sylvain Bellemare
e10ada0ad4 Cleanup conftest 2016-12-16 18:38:25 +01:00
Brett Sun
27ce18d6ba Remove unused request fixtures in root conftest 2016-12-16 17:58:48 +01:00
Brett Sun
d4ba1ff1c8 Update setup_database fixture to changes in #953 2016-12-16 17:58:48 +01:00
ryan
dcba5421f1 schema fixes 2016-12-16 12:19:10 +01:00