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 19964 add missing tap tester tests #65

Merged
merged 13 commits into from
Aug 29, 2022

Conversation

namrata270998
Copy link
Contributor

@namrata270998 namrata270998 commented Jul 27, 2022

Description of change

  • Updated several test cases according to the code changes
  • Skipped missing fields from the all_fields test case
  • Added assertion for primary keys in the automatic_fields test
  • Added an assertion that replication value is greater than the bookmark in bookmarks test case
  • Added an assertion for no duplicate metadata entry in the discover test case
  • Added an assertion for actual replication that matches our expected replication method in the discover test case
  • Added pagination test case
  • Added replication key is greater or equal to start_date in start_date test
  • Added primary keys assertion in start_date test

Note: Test cases will pass once after all the code of dict-to-class will be merged

Manual QA steps

Risks

Rollback steps

  • revert this branch

@@ -107,7 +58,7 @@ def test_run(self):
##########################################################################

new_states = {'bookmarks': dict()}
simulated_states = self.calculated_states_by_stream(first_sync_bookmarks)
simulated_states = {'forms': {'last_updated_at': '2022-07-22T16:00:47Z'}, 'landings': {'mVn2wE55': {'landed_at': '2022-07-21T00:00:00Z'}, 'xJ8emTTy': {'landed_at': '2022-07-24T16:49:54Z'}}, 'answers': {'mVn2wE55': {'landed_at': '2022-07-21T00:00:00Z'}, 'xJ8emTTy': {'landed_at': '2022-07-24T16:49:54Z'}}}

Choose a reason for hiding this comment

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

Divide this into multiline for better readability.

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 multiline for better readability

for record in second_sync_messages:

# Verify the second sync records respect the previous (simulated) bookmark value
# replication_key_value = [record.get(replication_key) if record.get('_sdc_form_id') == form_key]

Choose a reason for hiding this comment

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

Remove commented code from the test.

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 commented code

@@ -0,0 +1,75 @@
#for tap-typeform pagination

Choose a reason for hiding this comment

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

Remove the above the line.

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 unwanted comments

Comment on lines 23 to 26
• verify that a sync with a later start date has at least one record synced
and less records than the 1st sync with a previous start date
• verify that each stream has less records than the earlier start date sync
• verify all data from later start data has bookmark values >= start_date

Choose a reason for hiding this comment

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

Keep the first character of a sentence in upper case.

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 to uppercase

Comment on lines 162 to 163
else:
continue

Choose a reason for hiding this comment

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

Remove this else part as there is nothing after it inside a for a loop.

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 the else



# Verify the number of records in the 2nd sync is less then the first
if stream != 'answers':

Choose a reason for hiding this comment

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

Add code comment here like why the above stream is excluded for some of the assertions.

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 comments

* TDL-19957 update dict based to class based

* updated while condition

* updated while condition

* removed incremental_range from REQUIRED_CONFIG_KEYS

* updated discover and schema file

* updated to replication_key instead of keys

* updated schemas and added comments

* added unittests for code coverage

* added unittests for sync.py

* added parameterized in setup.py

* added parameterized in config.yml and updated unittests

* updated the replication key to list instead of a single key

* fixed the issue for Keyerror of form_id in answers stream

* updated unittests

* added configurable page size param

* handled page_size for 0 and updated unittests

* resolved bug fixes for pagination and removed incompleted_forms_only param

* added new stream unsubmitted landings

* resolved PR review comments

* added page_size in example config

* added back incremental_range in the tap-tester

* raised exc instead of fatal error message and updated unittests

* resolved PR comments

* fixed the issue when page_size not passed in config
@prijendev prijendev merged commit d06cb08 into crest-master Aug 29, 2022
@prijendev prijendev mentioned this pull request Sep 2, 2022
somethingmorerelevant pushed a commit that referenced this pull request Sep 20, 2022
* Tdl 19964 add missing tap tester tests (#65)

* TDL-19964 Added missing tap-tester commits

* updated tap-tester tests

* updated bookmarks tap-tester test

* Updated and removed extra comments

* updated start date as per format

* updated pagination test case

* resolved review comments

* added new stream in tap-tester

* fixed the cci issues

* added missing assertion for all fields

* removed get_logger()

* added logger instead of print

* TDL-19957 Update dict based to class based implementation (#64)

* TDL-19957 update dict based to class based

* updated while condition

* updated while condition

* removed incremental_range from REQUIRED_CONFIG_KEYS

* updated discover and schema file

* updated to replication_key instead of keys

* updated schemas and added comments

* added unittests for code coverage

* added unittests for sync.py

* added parameterized in setup.py

* added parameterized in config.yml and updated unittests

* updated the replication key to list instead of a single key

* fixed the issue for Keyerror of form_id in answers stream

* updated unittests

* added configurable page size param

* handled page_size for 0 and updated unittests

* resolved bug fixes for pagination and removed incompleted_forms_only param

* added new stream unsubmitted landings

* resolved PR review comments

* added page_size in example config

* added back incremental_range in the tap-tester

* raised exc instead of fatal error message and updated unittests

* resolved PR comments

* fixed the issue when page_size not passed in config

* TDL-19801: Tap fetch data for sub-questions (#62)

* TDL-19801: Tap does not support fetching data for the questions nested within a Question Group.

* addressed the comments

* add unittest

* modify funciton comment

* formated test_case value in unittest

* formated expected_case

* Updated schema in questions.json

* resolved build fail error

* resolve build fail error

* updated unittest

* updated setup.py

* add parameterized

* change start date in start_date_test

* make change in bookmark test

* Updated unit test case.

* Updated schemas and keyerror.

Co-authored-by: Jay Tilala <jay.tilala@CDSYS.LOCAL>
Co-authored-by: prijendev <prijen.khokhani@crestdatasys.com>

* TDL-19959 added missing fields (#63)

* added missing fields

* TDL-19957 update dict based to class based

* updated while condition

* updated while condition

* removed incremental_range from REQUIRED_CONFIG_KEYS

* TDL-19964 Added missing tap-tester commits

* updated discover and schema file

* updated tap-tester tests

* updated to replication_key instead of keys

* updated schemas and added comments

* added unittests for code coverage

* updated bookmarks tap-tester test

* added unittests for sync.py

* added parameterized in setup.py

* added parameterized in config.yml and updated unittests

* updated the replication key to list instead of a single key

* Updated and removed extra comments

* fixed the issue for Keyerror of form_id in answers stream

* updated unittests

* updated start date as per format

* added configurable page size param

* updated pagination test case

* handled page_size for 0 and updated unittests

* resolved review comments

* resolved bug fixes for pagination and removed incompleted_forms_only param

* updated array type schema

* added new stream unsubmitted landings

* added new stream in tap-tester

* updated indentation

* resolved PR review comments

* updated indentation to use 2 spaces

* added page_size in example config

* added back incremental_range in the tap-tester

* fixed the cci issues

* added missing fields to a dict

* added missing assertion for all fields

* updated comment

* raised exc instead of fatal error message and updated unittests

* removed get_logger()

* added logger instead of print

* Updated schema for questions.

* Removed duplicate assertion in all_fields test.

Co-authored-by: prijendev <prijen.khokhani@crestdatasys.com>

* Updated schema for answers stream.

Co-authored-by: namrata270998 <75604662+namrata270998@users.noreply.github.com>
Co-authored-by: jtilala <104966482+jtilala@users.noreply.github.com>
Co-authored-by: Jay Tilala <jay.tilala@CDSYS.LOCAL>
nitingaikwad1 pushed a commit that referenced this pull request Sep 29, 2022
* Tdl 19964 add missing tap tester tests (#65)

* TDL-19964 Added missing tap-tester commits

* updated tap-tester tests

* updated bookmarks tap-tester test

* Updated and removed extra comments

* updated start date as per format

* updated pagination test case

* resolved review comments

* added new stream in tap-tester

* fixed the cci issues

* added missing assertion for all fields

* removed get_logger()

* added logger instead of print

* TDL-19957 Update dict based to class based implementation (#64)

* TDL-19957 update dict based to class based

* updated while condition

* updated while condition

* removed incremental_range from REQUIRED_CONFIG_KEYS

* updated discover and schema file

* updated to replication_key instead of keys

* updated schemas and added comments

* added unittests for code coverage

* added unittests for sync.py

* added parameterized in setup.py

* added parameterized in config.yml and updated unittests

* updated the replication key to list instead of a single key

* fixed the issue for Keyerror of form_id in answers stream

* updated unittests

* added configurable page size param

* handled page_size for 0 and updated unittests

* resolved bug fixes for pagination and removed incompleted_forms_only param

* added new stream unsubmitted landings

* resolved PR review comments

* added page_size in example config

* added back incremental_range in the tap-tester

* raised exc instead of fatal error message and updated unittests

* resolved PR comments

* fixed the issue when page_size not passed in config

* TDL-19801: Tap fetch data for sub-questions (#62)

* TDL-19801: Tap does not support fetching data for the questions nested within a Question Group.

* addressed the comments

* add unittest

* modify funciton comment

* formated test_case value in unittest

* formated expected_case

* Updated schema in questions.json

* resolved build fail error

* resolve build fail error

* updated unittest

* updated setup.py

* add parameterized

* change start date in start_date_test

* make change in bookmark test

* Updated unit test case.

* Updated schemas and keyerror.

Co-authored-by: Jay Tilala <jay.tilala@CDSYS.LOCAL>
Co-authored-by: prijendev <prijen.khokhani@crestdatasys.com>

* TDL-19959 added missing fields (#63)

* added missing fields

* TDL-19957 update dict based to class based

* updated while condition

* updated while condition

* removed incremental_range from REQUIRED_CONFIG_KEYS

* TDL-19964 Added missing tap-tester commits

* updated discover and schema file

* updated tap-tester tests

* updated to replication_key instead of keys

* updated schemas and added comments

* added unittests for code coverage

* updated bookmarks tap-tester test

* added unittests for sync.py

* added parameterized in setup.py

* added parameterized in config.yml and updated unittests

* updated the replication key to list instead of a single key

* Updated and removed extra comments

* fixed the issue for Keyerror of form_id in answers stream

* updated unittests

* updated start date as per format

* added configurable page size param

* updated pagination test case

* handled page_size for 0 and updated unittests

* resolved review comments

* resolved bug fixes for pagination and removed incompleted_forms_only param

* updated array type schema

* added new stream unsubmitted landings

* added new stream in tap-tester

* updated indentation

* resolved PR review comments

* updated indentation to use 2 spaces

* added page_size in example config

* added back incremental_range in the tap-tester

* fixed the cci issues

* added missing fields to a dict

* added missing assertion for all fields

* updated comment

* raised exc instead of fatal error message and updated unittests

* removed get_logger()

* added logger instead of print

* Updated schema for questions.

* Removed duplicate assertion in all_fields test.

Co-authored-by: prijendev <prijen.khokhani@crestdatasys.com>

* Updated schema for answers stream.

* update version and changelog

* changelog update for v2.0.0

* changelog update for v2.0.0

* minor changelog update

Co-authored-by: namrata270998 <75604662+namrata270998@users.noreply.github.com>
Co-authored-by: jtilala <104966482+jtilala@users.noreply.github.com>
Co-authored-by: Jay Tilala <jay.tilala@CDSYS.LOCAL>
Co-authored-by: prijendev <prijen.khokhani@crestdatasys.com>
Co-authored-by: kethan1122 <kcherukuri@talend.com>
Co-authored-by: rdeshmukh15 <107538720+rdeshmukh15@users.noreply.github.com>
@kethan1122 kethan1122 deleted the TDL-19964-add-missing-tap-tester-tests branch April 28, 2023 09:40
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