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-17511-Add missing test case, TDL-17522-Fix typos in the fields #5

Merged
merged 13 commits into from
Feb 24, 2022

Conversation

umangagrawal-crest
Copy link
Contributor

Description of change

TDL-17511 Add missing tap tester tests

Added following below integration tests:

  • Start Date Test
  • Automatic Fields Test
  • All Fields Test
  • Bookmark Test
  • Discovery Test
    NOTE: Pagination test cases are not written as no stream is using pagination.

TDL-17522 FIx typos in the fields

  • Updated the field name largest_purchase item_price in the schema file of blast_save_list stream.
  • Updated the streams.py file to use the correct replication_key.

NOTE:

  • Removed the test_sync_canary.py file.
  • Added the config.yml file
  • The CircleCI plan is not configured for this tap.

Manual QA steps

Risks

  • No risks

Rollback steps

  • revert this branch

@@ -158,7 +158,7 @@
],
"format": "date-time"
},
"largest_purchase item_price": {
"largest_purchase_item_price": {
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 was not collected for this field largest_purchase_item_price due to a typo issue. So corrected the field name.

@@ -180,9 +180,9 @@ def sync(self,
with metrics.record_counter(self.tap_stream_id) as counter:
for record in self.get_records(bookmark_datetime):
self.date_records_to_datetime(record)
transform_keys_to_snake_case(record)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Transforming record from camel_case to snake_case before retrieving a value of replication key from the record as replication_key is defined in snake_case in the schema file

"properties": {
"date": {
"type": [
"null",
"string"
],
"format": "date-time"
},

Choose a reason for hiding this comment

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

Can you please attach the card related to this bug? To explain this issue in detail.

Copy link
Contributor Author

@umangagrawal-crest umangagrawal-crest Feb 2, 2022

Choose a reason for hiding this comment

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

Here is the bug card: https://jira.talendforge.org/browse/TDL-17522. We have made this change for the "date" field, to maintain consistency in the record.

replication_key = 'Date'
valid_replication_keys = ['Date']
replication_key = 'date'
valid_replication_keys = ['date']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned above, syncing with the schema file.

tests/base.py Outdated
@@ -1,6 +1,11 @@
import os
import unittest

import singer

Choose a reason for hiding this comment

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

This can be removed, it's not used anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Removed.

Comment on lines 58 to 59
new_states = first_sync_bookmarks
menagerie.set_state(conn_id, new_states)

Choose a reason for hiding this comment

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

As written this does nothing. We get the state and put the same state back in menagerie. Ideally we should be moving the bookmarked values backward (decreasing the value) from those saved in state from sync 1. This way we see more data replicated in sync 2 than just the records which were bookmarked on from sync 1.

Copy link
Contributor

@hpatel41 hpatel41 Feb 15, 2022

Choose a reason for hiding this comment

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

@kspeer825 Updated the state between the sync and set a date smaller than bookmark value.

@hpatel41 hpatel41 requested a review from kspeer825 February 15, 2022 09:38
@hpatel41 hpatel41 merged commit dc19925 into crest-work Feb 24, 2022
@hpatel41 hpatel41 mentioned this pull request Feb 24, 2022
KrisPersonal pushed a commit that referenced this pull request Mar 2, 2022
* TDL-17511-Add missing test case, TDL-17522-Fix typos in the fields (#5)

* Added all the integration test cases

* Added one assertion in discovery test

* used pytest with coverage

* removed un-used line from config.yml file

* reverted the change

* updated config.yml file for unittest coverage

* removed user_agent from base test file

* skip blast_query from start date and bookmark tests

* removed unsed imports and updated state bookmark in bookmark test

* removed setuptools

* resolved bookmark test failure

* resolved bookmark test failure

* include blast_query stream in test cases

Co-authored-by: harshpatel4_crest <[email protected]>

* TDL-17521: Fix date_windowing for the purchase_log stream (#9)

* Added all the integration test cases

* updated date window for purchase log stream

* run purchase log stream in start date test

* Added one assertion in discovery test

* used pytest with coverage

* removed un-used line from config.yml file

* reverted the change

* updated config.yml file for unittest coverage

* removed user_agent from base test file

* skip blast_query from start date and bookmark tests

Co-authored-by: Umang Agrawal <[email protected]>

* TDL-17514: Implement request timeout (#6)

* Added request timeout

* Resolved review comments

* run CCi build

* updated config,yml file for unittest reports

* removed user_agent and imported tap tester libs in base test file

Co-authored-by: harshpatel4_crest <[email protected]>

* TDL-17515: Verify credentials in discover mode (#7)

* Added credentials check in discover mode

* updated unittest and run CCi

* removed user_agent from base file test

* imported runner in base test file

* imported menagerie in base test file

Co-authored-by: harshpatel4_crest <[email protected]>

* TDL-17516: Add custom exception handling (#8)

* added exception handling

* updated 404 error message

* added 500 error class and comments

* run CCi build and updated unittest assertion

* updated config.yml file

* updated config.yml file

* removed user_agent from base test file

* imported tap tester libs in base

* TDL-17520: Primary Key is not unique for the purchase_log stream (#10)

* updated primary key for purchase_log stream

* removed user_agent from base test file

* imported tap_tester in base test file

* added channel in the primary key for purchase log

* resolve pylint error

* resolve unittest failure

* skip 403 and 99 error, updated automatic test case for purchase_log stream

Co-authored-by: Umang Agrawal <[email protected]>
Co-authored-by: Umang Agrawal <[email protected]>
Co-authored-by: savan-chovatiya <[email protected]>
@KrisPersonal KrisPersonal mentioned this pull request Mar 2, 2022
@somethingmorerelevant somethingmorerelevant deleted the TDL-17511-Add-missing-tap-teseter-test branch February 15, 2023 14:57
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.

7 participants