Skip to content

Problem: several tests are skipped#2452

Merged
z-bowen merged 6 commits intobigchaindb:masterfrom
codegeschrei:activating-tests
Aug 22, 2018
Merged

Problem: several tests are skipped#2452
z-bowen merged 6 commits intobigchaindb:masterfrom
codegeschrei:activating-tests

Conversation

@codegeschrei
Copy link
Copy Markdown
Contributor

Solution: activate or remove tests

#2381

  • commands/test_utils.py (activate/remove tests)
  • store_transaction is deprecated, replace it in tests with store_bulk_transaction
  • unskipped one test in test_core

Solution: activate or remove tests
@kansi kansi mentioned this pull request Aug 9, 2018
16 tasks
@codecov-io
Copy link
Copy Markdown

codecov-io commented Aug 9, 2018

Codecov Report

Merging #2452 into master will increase coverage by 1.01%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master   #2452      +/-   ##
=========================================
+ Coverage   89.09%   90.1%   +1.01%     
=========================================
  Files          41      41              
  Lines        2385    2366      -19     
=========================================
+ Hits         2125    2132       +7     
+ Misses        260     234      -26

.sign([alice.private_key])

b.store_transaction(tx)
tx_dict = copy.deepcopy(tx.to_dict())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is deepcopy really needed here? I assume store_bulk_transactions will just write the contents of tx to mongo. That should leave tx unchanged, and you can still perform the comparison in the last assert.

What breaks if you skip the deepcopy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we use store_bulk_transactions we use mongos insert_many. Pymongo automatically inserts an _id field. So now we have more data in the tx and the assert fails.
There is a nice explanation here

tx = Transaction.create([alice.public_key], [([alice.public_key], 1)], asset={'cycle': 'hero'})
tx = tx.sign([alice.private_key])
b.store_transaction(tx)
tx_dict = copy.deepcopy(tx.to_dict())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above, regarding deepcopy

Copy link
Copy Markdown
Contributor

@kansi kansi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also remove store_transaction?

@codegeschrei
Copy link
Copy Markdown
Contributor Author

@kansi will do!

Solution: replace it with store_bulk_transaction


@pytest.mark.bdb
def test_store_transaction(mocker, tb, signed_create_tx,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this test removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we use the store_bulk_transactions now. I can put it in again and switch the store_transaction to store_transactions if you want

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codegeschrei This test is also trying to assert if the transaction was appropriately split and the metadata and asset were stored in their respective collections. It would good to have this test back.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll rewrite it.

Solution: undelete `test_store_transaction`
Solution: merge master and change deprecated store_transaction
@z-bowen z-bowen merged commit 90f2fdf into bigchaindb:master Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants