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

Integration tests for newly added tickets stream #219

Conversation

sgandhi1311
Copy link
Member

@sgandhi1311 sgandhi1311 commented Feb 10, 2023

Description of change

  • Add the get, create, and update functionality in client.py
  • Update base.py and test cases

Note - Dependent on #https://github.com/stitchdata/environments/pull/764

Manual QA steps

  • All integration tests are passed on dev-vm.

Risks

Rollback steps

  • revert this branch

tests/client.py Outdated Show resolved Hide resolved
tests/client.py Outdated Show resolved Hide resolved
tests/client.py Outdated Show resolved Hide resolved
tests/client.py Show resolved Hide resolved
tests/client.py Show resolved Hide resolved
tests/client.py Outdated
Comment on lines 683 to 689
records.extend(
[
record
for record in response["results"]
if record[replication_key] >= self.start_date_strf.replace('.Z', '.000Z')
]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
records.extend(
[
record
for record in response["results"]
if record[replication_key] >= self.start_date_strf.replace('.Z', '.000Z')
]
)
records.extend([record
for record in response["results"]
if record[replication_key] >= self.start_date_strf.replace('.Z', '.000Z')])

Copy link
Contributor

Choose a reason for hiding this comment

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

This code has mix coding styles but for list comprehession lets use above style like used elsewhere in the same file.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines 41 to 44
tickets_bookmark = self.timedelta_formatted(
reference_state['bookmarks']['engagements']['lastUpdated'],
days=-1, str_format=self.BASIC_DATE_FORMAT
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tickets_bookmark = self.timedelta_formatted(
reference_state['bookmarks']['engagements']['lastUpdated'],
days=-1, str_format=self.BASIC_DATE_FORMAT
)
tickets_bookmark = self.timedelta_formatted(
reference_state['bookmarks']['engagements']['lastUpdated'],
days=-1, str_format=self.BASIC_DATE_FORMAT)

Copy link
Contributor

Choose a reason for hiding this comment

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

Also why are we handlling tickets stream separately?

Copy link
Member Author

@sgandhi1311 sgandhi1311 Feb 15, 2023

Choose a reason for hiding this comment

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

we are setting the bookmark value for tickets stream in this way. Followed the existing pattern.

@sgandhi1311 sgandhi1311 force-pushed the integration-tests-tickets-stream branch from 8cd3259 to d7d3f1a Compare February 15, 2023 12:58
@sgandhi1311 sgandhi1311 force-pushed the integration-tests-tickets-stream branch from d7d3f1a to 072f126 Compare February 15, 2023 15:42
@sgandhi1311 sgandhi1311 merged commit 7c911b0 into TDL-21819-tickets-stream-dev-changes Feb 15, 2023
sgandhi1311 added a commit that referenced this pull request Feb 16, 2023
* created the tickets schema file

* introduced new stream tickets in the hubspot tap implementation

* Changes in tickets stream implementation

* pylint issues fixed

* pylint issues

* added unit test to test sync_tickets

* Added unit test cases in test_tickets.py

* refactoring

* added null as one of the types for the non-primary fields in tickets stream schema

* added object type in tickets.json

* addressed PR comments

* removed spaces in tickets.json

* changes in tickets.json file

* added new line at the end

* changed type from integer to string of some of the fields

* add logic to transform the records

* Integration tests for newly added tickets stream (#219)

* add tickets stream in base.py file

* get ticket records

* add create ticket function for integration test case

* test tickets stream in interrupt sync mode

* Changes:
- add page limit
- add functions to get, create, and update the tickets stream

* modify get logic for tickets in client.py and update sync offset test

* address review comments and reformat the client.py as per the standards

* Formatting changes in client.py and bookmark key change in interrupt sync test

* bump related changes

---------

Co-authored-by: Sourabh Gandhi <[email protected]>
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.

4 participants