Skip to content

Problem: config utils tests are disabled.#2402

Merged
ldmberman merged 1 commit intobigchaindb:masterfrom
ldmberman:reenable-config-utils-tests
Jul 27, 2018
Merged

Problem: config utils tests are disabled.#2402
ldmberman merged 1 commit intobigchaindb:masterfrom
ldmberman:reenable-config-utils-tests

Conversation

@ldmberman
Copy link
Copy Markdown
Contributor

Solution: enable them back, cleanup no longer relevant parts.

@ldmberman ldmberman requested review from kansi and z-bowen July 24, 2018 10:49
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 24, 2018

Codecov Report

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

@@            Coverage Diff             @@
##           master    #2402      +/-   ##
==========================================
+ Coverage   86.83%   88.12%   +1.28%     
==========================================
  Files          38       38              
  Lines        2173     2173              
==========================================
+ Hits         1887     1915      +28     
+ Misses        286      258      -28

@kansi kansi mentioned this pull request Jul 24, 2018
16 tasks
@@ -185,12 +169,7 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch, request, ssl_con
'BIGCHAINDB_WSSERVER_ADVERTISED_HOST': WSSERVER_ADVERTISED_HOST,
'BIGCHAINDB_WSSERVER_ADVERTISED_PORT': WSSERVER_ADVERTISED_PORT,
'BIGCHAINDB_KEYRING': KEYRING,
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 KEYRING still being used?

'BIGCHAINDB_DATABASE_CRLFILE': ssl_context.crl,
'BIGCHAINDB_DATABASE_CERTFILE': ssl_context.cert,
'BIGCHAINDB_DATABASE_KEYFILE': ssl_context.key,
'BIGCHAINDB_DATABASE_KEYFILE_PASSPHRASE': None})
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.

Are we no longer supporting ssl for MongoDB?

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.

I removed it by mistake. It's back now.

@ldmberman ldmberman force-pushed the reenable-config-utils-tests branch from e935f52 to ffd1b7b Compare July 25, 2018 09:25
assert bigchaindb.config['CONFIGURED'] is True


def test_bigchain_instance_raises_when_not_configured(request, monkeypatch):
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.

I couldn't understand why don't we need this test anymore?

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.

Where do you expect ConfigurationError to come from? From the first glance, without a config assigned, it will fail with a different exception. Also, the test setup assigns a config so it does not work either way.

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.

It seems that this test wasn't of much help before. I guess we can do without it then

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.

It seems like the intent of the test is to make sure we fail in a controlled fashion if the config gets dropped in some way. Couldn't we modify it to use a patched autoconfigure with force=True to set a bad config and produce the error that way?

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.

Currently, the function does not raise ConfigurationError in case the config is not set or empty. The contract that was tested here is lost.

Solution: enable them back, cleanup no longer relevant parts.
@ldmberman ldmberman force-pushed the reenable-config-utils-tests branch from ffd1b7b to 884f458 Compare July 27, 2018 14:48
@ldmberman ldmberman merged commit a0670b6 into bigchaindb:master Jul 27, 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