-
Notifications
You must be signed in to change notification settings - Fork 960
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
amundsendatabuilder Tests don't pass on master #605
Comments
If your error set is the same as mine, I found that the failures were due to google authentication errors on the BigQuery extractors. I got around this by doing the following: Create a file named {
"client_id": "",
"client_secret": "",
"refresh_token": "",
"type": "authorized_user"
} Then, reference that file in an env var. I'm using a docker setup for testing that copies the content root into
Not sure how this is resolved in the databuilder Travis CI pipeline however. |
@alevene HUGE help, thank you! That fixes 23 of the errors. Going to commit that fix. The other failure looks unrelated but easy to handle. Will PR both together. |
Hmm, perhaps the CI isn't failing because the Travis CI environment for some reason already has such a credentials file? I'm guessing without that dummy file calling BigQuery Extractor init() will end in calling out to google auth library around https://github.com/lyft/amundsendatabuilder/blob/master/databuilder/extractor/base_bigquery_extractor.py#L58 I noticed a similar thing in the Cassandra test code. There it is handled by patching out like:
|
I'm playing with inserting a dummy |
Sorry I didn't convey it very clearly. If you don't put in neither a dummy file or key it will fall through to: else:
credentials, _ = google.auth.default(scopes=self._DEFAULT_SCOPES) And then with something like below in the BigQuery tests - you avoid calling the real @@ -1,7 +1,7 @@
import logging
import unittest
-from mock import patch, Mock
+from mock import patch, Mock, MagicMock
from pyhocon import ConfigFactory
from databuilder import Scoped
@@ -133,7 +133,8 @@ class MockBigQueryClient():
def tables(self):
return self.tables_method
-
+# patch fallback auth method to avoid actually calling google API during tests
+@patch('google.auth.default', lambda scopes: ['dummy', 'dummy'])
class TestBigQueryMetadataExtractor(unittest.TestCase):
def setUp(self):
# type: () -> None
|
Ah, thanks @jornh, yes I was confused. PR'd at amundsen-io/amundsendatabuilder#313 -- will close this once that lands. Turns out the rest of the failures were from me using Python 3.7. Opened a new issue for that: #606 |
Fixed in amundsen-io/amundsendatabuilder#313 |
* Testing Codeowners file Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Updating Tamika's name, adding Tao Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
* Testing Codeowners file Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Updating Tamika's name, adding Tao Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
* Testing Codeowners file Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com> * Updating Tamika's name, adding Tao Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
When I download a fresh copy of amundsendatabuilder, the unit test suite doesn't pass. I'm actively debugging this, but posting to track and see if anyone else has seen this.
Expected Behavior
Test suite passes.
Current Behavior
Failures:
=== 24 failed, 221 passed in 20.72 seconds ===
I can grab the full list output, but it's extremely long because it includes some function bodies.
Possible Solution
The failures don't seem to follow any clear pattern, it's not immediately clear to me that there's a shared root cause, but I'll keep looking.
Steps to Reproduce
Repro steps in Expected Behavior.
Screenshots (if appropriate)
Context
Your Environment
Some info about my system:
master
The text was updated successfully, but these errors were encountered: