Skip to content
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

TDL-14989: Check best practices #66

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Conversation

hpatel41
Copy link
Contributor

@hpatel41 hpatel41 commented Aug 24, 2021

Description of change

TDL-14989: Check best practices

  • Updated the tap-tester image tap-tester-v4 -> stitch-tap-tester

  • Updated the sandbox -> tap_tester_sandbox

  • Updated singer-python 5.9.0 -> 5.12.1

  • Added Integration tests for:

    • All fields
    • Bookmark
    • Sync
  • NOTE:

    • On upgrading to singer-python 5.12.1, SortImports error was coming ,as per the discussion on updating pylint version, the error was resolved, but another error occurred posonlyargs and as per the discussion , updating the astroid version got it resolved.
    • Updated exit with sys.exit because pylint was failing.
    • Updated the super used in the code with Python 3 style super() without arguments as pylint was filing by using super with arguments.

Manual QA steps

Risks

Rollback steps

  • revert this branch

@hpatel41 hpatel41 changed the title Added best practices TDL-14989: Check best practices Aug 24, 2021
with self.subTest(stream=stream):

# # expected values
# expected_automatic_keys = self.expected_automatic_fields().get(stream)

Choose a reason for hiding this comment

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

Why we commented this line? Can we remove the line if not required?

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

expected_all_keys.remove('SendClassification') # not retrievable
expected_all_keys.remove('PartnerProperties') # not retrievable
elif stream == 'subscriber':
expected_all_keys.remove('CustomerKey') # not retrievable

Choose a reason for hiding this comment

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

Create a list and run a loop for this.

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

@hpatel41 hpatel41 requested a review from dbshah1212 August 27, 2021 08:31
@hpatel41 hpatel41 marked this pull request as ready for review August 27, 2021 09:33
### Update Start Date
##########################################################################

self.START_DATE = '2021-01-01T00:00:00Z'

Choose a reason for hiding this comment

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

For the Bookmark test why we are updating start_date? We need to update the state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the code change to use state.

tests/base.py Outdated
return {
"campaign": {
"primary-key": {"id"},
"replication": "FULL"

Choose a reason for hiding this comment

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

Instead of using primary-key, replication, replication-key, FULL, INCREMENTAL, create constants of those and use those. use FULL_TABLE instead of FULL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the code.

@@ -21,21 +21,15 @@ jobs:
name: 'pylint'
command: |
source /usr/local/share/virtualenvs/tap-exacttarget/bin/activate
pylint tap_exacttarget -d no-else-return,wrong-import-order,pointless-string-statement,invalid-name,deprecated-method,bad-whitespace,line-too-long
pylint tap_exacttarget -d no-else-return,wrong-import-order,pointless-string-statement,invalid-name,deprecated-method,bad-whitespace,line-too-long,consider-using-sys-exit

Choose a reason for hiding this comment

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

Why do we need to update the pylint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a NOTE about that in the PR description.

setup.py Outdated
'python-dateutil==2.6.0',
'voluptuous==0.10.5',
'Salesforce-FuelSDK==1.3.0'
],
extras_require={
'dev': [
'ipdb==0.11',
'pylint==2.1.1',
'astroid==2.1.0',
'pylint==2.4.4',

Choose a reason for hiding this comment

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

Any special requirement to upgrade pylint and astroid?

Choose a reason for hiding this comment

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

@harshpatel4crest Please update both the modules to their latest versions currently available on pypi

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

@@ -1,101 +0,0 @@
import datetime
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of removing the discovery test, could you update it to meet current standards https://github.com/stitchdata/tap-tester/blob/master/reference/expectations/saas_taps.md#test_discoverypy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is added as part of PR #68.

setup.py Outdated
Comment on lines 21 to 24
'dev': [
'ipdb==0.11',
'pylint==2.1.1',
'astroid==2.1.0',
'pylint==2.10.2',
'astroid==2.7.3',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you actually separate these into a two groups: dev and test. The test group should have astroid and nose and we should install that group as part of the circleci build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the code.

Comment on lines +66 to +68
if stream == "subscriber":
continue

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you elaborate on why this stream cannot be tested. If we cannot get a replication key value from the api, we should consider making this stream Full Table.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am still not clear on why this stream cannot be tested 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.

Subscriber (child stream) will not have any bookmark as it only syncs the provided list of subscribers keys and the subscribers key will be created from the list_subscribers (parent stream) based on the records returned from the API.

As discussed here

tests/base.py Show resolved Hide resolved
hpatel41 and others added 3 commits October 13, 2021 11:44
…nResetErrors (#71)

* added backoff for certain errors

* resolve pylint

* updated decorator location

* added unittests

* added comment

* added comments
* updated error message when generating auth_stub

* made changes according to the comments

* updated the code acording to the comments

* updated the tap tester image

* updated pylint and astroid to latest version

* updated the code as, on updating tap tester image it was throwing cascading errors

* updated config.yml file

* updated the start date for integration tests as per the params

* removed scenario as new tap-tester version does not support it

* updated start date in the base file test
@hpatel41 hpatel41 mentioned this pull request Oct 13, 2021
Copy link
Contributor

@kspeer825 kspeer825 left a comment

Choose a reason for hiding this comment

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

Can this PR be closed, it is mentioned in a different already merged PR.

@dbshah1212
Copy link

Can this PR be closed, it is mentioned in a different already merged PR.

@KrisPersonal will you close these kinds of PRs? As we are merging one master(crest-master) branch only.

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.

5 participants