Skip to content

fix: add timestamp conversion mock - #2763

Merged
ItsSudip merged 3 commits into
chore.refactor-testcasesfrom
fix.add-timestamp-mocks
Oct 25, 2023
Merged

ItsSudip merged 3 commits into
chore.refactor-testcasesfrom
fix.add-timestamp-mocks

Conversation

@sanpj2292

@sanpj2292 sanpj2292 commented Oct 21, 2023 •

Copy link
Copy Markdown

Description of the change

Changes only applicable for GAOC tests

  • move timestamp conversion logic to helper & use the helper object
  • include common mock logic
  • add mocks for all relevant test-cases
  • clean-up unnecessary imports

Resolves INT-886

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

- move timestamp conversion logic to helper & use the helper object
- include common mock logic
- add mocks for all relevant test-cases
- clean-up unnecessary imports

Signed-off-by: Sai Sankeerth <[email protected]>
@sanpj2292
sanpj2292 requested review from a team and sivashanmukh as code owners October 21, 2023 19:07
@sanpj2292
sanpj2292 requested review from a team, ItsSudip, koladilip, krishna2020, saikumarrs and yashasvibajpai and removed request for a team October 21, 2023 19:07
@sanpj2292 sanpj2292 self-assigned this Oct 21, 2023
Signed-off-by: Sai Sankeerth <[email protected]>
@codecov

codecov Bot commented Oct 22, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (chore.refactor-testcases@c22130d). Click here to learn what that means.

Additional details and impacted files
@@                     Coverage Diff                     @@
##             chore.refactor-testcases    #2763   +/-   ##
===========================================================
  Coverage                            ?   87.05%           
===========================================================
  Files                               ?      716           
  Lines                               ?    28258           
  Branches                            ?     6647           
===========================================================
  Hits                                ?    24601           
  Misses                              ?     3320           
  Partials                            ?      337           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sanpj2292

sanpj2292 commented Oct 22, 2023 •

Copy link
Copy Markdown
Author

Used moment-timezone instead of moment to make it easy for us to write tests.

My Observations:

  • moment-timezone imports moment & returns moment in tz object. So moment functionality is not lost.
  • moment-timezone provides us with capability of choosing timezones at will which makes it a lot powerful

@ItsSudip
ItsSudip merged commit ef430fd into chore.refactor-testcases Oct 25, 2023
@sanpj2292
sanpj2292 deleted the fix.add-timestamp-mocks branch December 14, 2023 05:24
@ItsSudip ItsSudip mentioned this pull request Sep 28, 2026
3 of 10 tasks
ItsSudip added a commit that referenced this pull request Sep 28, 2026
## What are the changes introduced in this PR?

Merges the Topsort feature branch into `develop`. It contains:

- #5606 (contributed by Topsort): deterministic event ids so retries are
idempotent (`<messageId>`, or `<messageId>-<index>` for events fanned
out from `properties.products`), removal of the `additionalAttribution`
mapping, and chunking at the Events API's per-array cap of 50.
- #5618: moves Topsort fully onto the batching framework.
- Registers `TOPSORT: { routerTransform: true, batching: true,
transformerProxy: true }` in `src/features.ts`.
- Removes the legacy `process` / `processRouterDest` transform and the
processor test fixtures; the destination is router-only.
  - Converts the destination to TypeScript.
  - Requires `messageId` in the input schema.
- Sends impressions, clicks and purchases in one request, each array
capped at 50.
- Adds `delivery.ts`: a 400 from the Events API retries each job on its
own with `dontBatch: true`; a job already sent alone is aborted.

## What is the related Linear task?

Resolves INT-7228

## Please explain the objectives of your changes below

**Dependent change:** rudder-integrations-config #2763 (`transformAtV1:
"router"` for Topsort) is merged. It must be released before this PR,
because this PR removes the processor `process` transform.

### Any changes to existing capabilities/behaviour, mention the reason &
what are the changes ?

- Topsort is router-only; the processor route
(`/v0/destinations/topsort`) is no longer supported.
- The `id` sent for events carrying a `products` array changes to
`<messageId>-<index>`.
- `additionalAttribution` is no longer mapped.
- Events of different types share a request.
- A message without `messageId` fails with `message.messageId:
Required`.
- A 400 from Topsort retries each job alone (`dontBatch`) instead of
aborting the batch.

### Any new dependencies introduced with this change?

N/A

### Any new generic utility introduced or modified. Please explain the
changes.

N/A

### Any technical or performance related pointers to consider with the
change?

N/A

<hr>

### Developer checklist

- [x] My code follows the style guidelines of this project

- [ ] **No breaking changes are being introduced.**

- [ ] All related docs linked with the PR?

- [ ] All changes manually tested?

- [ ] Any documentation changes needed with this change?

- [ ] Is the PR limited to 10 file changes?

- [x] Is the PR limited to one linear task?

- [x] Are relevant unit and component test-cases added in **new
readability format**?

### Reviewer checklist

- [ ] Is the type of change in the PR title appropriate as per the
changes?

- [ ] Verified that there are no credentials or confidential data
exposed with the changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: bernirosas <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Bernardita Rosas <[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