Skip to content

PYTHON-2318 Atlas Data Lake testing #500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

prashantmital
Copy link
Contributor

No description provided.

@prashantmital prashantmital marked this pull request as ready for review October 7, 2020 23:36
@prashantmital
Copy link
Contributor Author

Test failures are because the data lake tests are getting run even when we are not connected to data lake. I will implement a skipTest to prevent these but the remainder of this PR can be reviewed in the meantime.

self.client = self._connect(
host, port, username=db_user, password=db_pwd)
self.connected = True
return
Copy link
Member

Choose a reason for hiding this comment

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

This seems like something that should run after _init_client() returns. Is there a reason it is placed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_init_client() relies on DB commands like getCmdLineOpts that are not supported by the mongohoused binary.

Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment about that? And how does this work if mongohoused is configured with tls? Do we not test tls?

Copy link
Contributor Author

@prashantmital prashantmital Dec 17, 2020

Choose a reason for hiding this comment

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

We don't test TLS. Added the comment.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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



test_creator = TestCreator(
create_test, DataLakeTestSpec, _TEST_PATH).create_tests()
Copy link
Member

Choose a reason for hiding this comment

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

Nit: let's remove test_creator =:

TestCreator(create_test, DataLakeTestSpec, _TEST_PATH).create_tests()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed here and in test_crud_v2.

def maybe_skip_scenario(self, test):
# Skip these tests unless connected to data lake.
if not client_context.is_data_lake:
self.skipTest('Not connected to Atlas Data Lake')
Copy link
Member

Choose a reason for hiding this comment

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

This would be more appropriate at the setUpClass level that way we don't need to see every skipped test in the unittest output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


# Default test database and collection names.
TEST_DB = 'test'
TEST_COLLECTION = 'driverdata'
Copy link
Member

Choose a reason for hiding this comment

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

Are these needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The data lake tests confrom to the CRUD v2 format which makes collection and database names optional so I would say, yes, these are needed.

@prashantmital prashantmital force-pushed the PYTHON-2318/datalake-testing branch from 85133b6 to ab07ce7 Compare December 17, 2020 05:56
Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

LGTM, the test failures on latest seem unrelated:

 [2020/12/17 07:24:08.038] FAIL: test_monitor_waits_after_server_check_error (test_streaming_protocol.TestStreamingProtocol)
 [2020/12/17 07:24:08.038] ----------------------------------------------------------------------
 [2020/12/17 07:24:08.038] Traceback (most recent call last):
 [2020/12/17 07:24:08.038]   File "/data/mci/5bc1cda572017d013fc9df6622120780/src/test/__init__.py", line 458, in wrap
 [2020/12/17 07:24:08.038]     return f(*args, **kwargs)
 [2020/12/17 07:24:08.038]   File "/data/mci/5bc1cda572017d013fc9df6622120780/src/test/__init__.py", line 458, in wrap
 [2020/12/17 07:24:08.038]     return f(*args, **kwargs)
 [2020/12/17 07:24:08.038]   File "/data/mci/5bc1cda572017d013fc9df6622120780/src/test/test_streaming_protocol.py", line 167, in test_monitor_waits_after_server_check_error
 [2020/12/17 07:24:08.038]     self.assertGreaterEqual(duration, 2)
 [2020/12/17 07:24:08.038] AssertionError: 0.5085382461547852 not greater than or equal to 2

@prashantmital prashantmital merged commit c673d8b into mongodb:master Dec 17, 2020
@prashantmital prashantmital deleted the PYTHON-2318/datalake-testing branch December 17, 2020 21:58
prashantmital added a commit that referenced this pull request Dec 17, 2020
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.

2 participants