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

fix(test): Create mock for calling lambdas #973

Merged
merged 11 commits into from
Jan 7, 2025
Merged

fix(test): Create mock for calling lambdas #973

merged 11 commits into from
Jan 7, 2025

Conversation

thetif
Copy link
Collaborator

@thetif thetif commented Jan 6, 2025

🎫 Linked Ticket

OY2-32118

💬 Description / Notes

Removed vi.mocks for lambda related functions. Created msw handlers and test data to use in their place. Updated the tests that used those vi.mocks to use msw. Updated a couple of the lambda handlers to have callbacks.

🛠 Changes

Created msw endpoints for:

  • cloudformation notifications
  • cognito admin
    • create user
    • set password
    • get user
  • aws security token service
  • aws lambda
    • list event source mapping
    • create event source mapping
    • get event source mapping
    • delete event source mapping
  • aws step function execution
  • opensearch index
    • create index
    • update field mapping
    • delete index
  • opensearch security roles mapping

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 75.54% 6557 / 8680
🔵 Statements 74.73% 6871 / 9194
🔵 Functions 69.35% 1971 / 2842
🔵 Branches 43.36% 1241 / 2862
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
lib/vitest.setup.ts 100% 100% 100% 100%
lib/lambda/cfnNotify.test.ts 100% 100% 100% 100%
lib/lambda/cfnNotify.ts 100% 100% 100% 100%
lib/lambda/checkConsumerLag.test.ts 100% 100% 100% 100%
lib/lambda/checkConsumerLag.ts 100% 94.44% 100% 100%
lib/lambda/createTriggers.test.ts 100% 100% 100% 100%
lib/lambda/createTriggers.ts 90.62% 70% 50% 93.54% 70-71
lib/lambda/deleteIndex.test.ts 100% 100% 100% 100%
lib/lambda/deleteTriggers.test.ts 100% 100% 100% 100%
lib/lambda/deleteTriggers.ts 90.32% 50% 66.66% 93.33% 52-53
lib/lambda/mapRole.test.ts 100% 100% 100% 100%
lib/lambda/mapRole.ts 90.47% 83.33% 100% 90.47% 36-37
lib/lambda/runReindex.test.ts 100% 100% 100% 100%
lib/lambda/runReindex.ts 100% 83.33% 100% 100%
lib/lambda/setupIndex.test.ts 100% 100% 100% 100%
lib/libs/sink-lib.test.ts 100% 100% 100% 100%
lib/libs/sink-lib.ts 100% 95.65% 100% 100%
Generated in workflow #1351 for commit a1eadb3 by the Vitest Coverage Report Action

@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 19:42 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 19:42 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-app January 6, 2025 19:42 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-kibana January 6, 2025 19:42 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 19:42 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 20:06 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 20:06 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 20:10 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 20:10 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-app January 6, 2025 20:10 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-kibana January 6, 2025 20:10 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 20:10 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 21:37 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 21:37 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 21:40 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-app January 6, 2025 21:40 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 21:40 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-kibana January 6, 2025 21:40 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 21:40 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 21:47 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 21:47 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 21:50 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-app January 6, 2025 21:50 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-kibana January 6, 2025 21:50 — with GitHub Actions Inactive
@thetif thetif marked this pull request as ready for review January 6, 2025 22:37
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 22:38 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 22:38 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 22:41 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 22:41 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-kibana January 6, 2025 22:41 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda-app January 6, 2025 22:41 — with GitHub Actions Inactive
@thetif thetif temporarily deployed to mock-test-lambda January 6, 2025 22:41 — with GitHub Actions Inactive
Copy link
Collaborator

@13bfrancis 13bfrancis left a comment

Choose a reason for hiding this comment

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

This looks good to me. I don't see any issue with being explicit with region. Should be good to go if everything is passing

@thetif thetif merged commit 097d933 into main Jan 7, 2025
28 of 29 checks passed
@thetif thetif deleted the mock-test-lambda branch January 7, 2025 16:38
Copy link
Collaborator

@thwalker6 thwalker6 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

github-actions bot commented Jan 8, 2025

🎉 This PR is included in version 1.5.0-val.102 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

RanyeM pushed a commit that referenced this pull request Jan 9, 2025
* Added msw endpoints for Lambda, Step Functions, Secure Token Services, and other related services
* Added/updated test data to support new endpoints
* Updated tests to use the new endpoints instead of mocking individually
RanyeM added a commit that referenced this pull request Jan 9, 2025
* feature: adding new FAQ to FAQ page

* feature: question should open corresponding section

* fix: corrected code back to faq page direct link

* fix: removed id

* fix: #5 and #6 to expanded section

* fix: test coverage

* revert package json to what is on main

* fix(email): Fixes an issue with Outlook not correctly displaying the OneMAC logo and header (#972)

* fixed index test

* fix(test): Create mock for calling lambdas (#973)

* Added msw endpoints for Lambda, Step Functions, Secure Token Services, and other related services
* Added/updated test data to support new endpoints
* Updated tests to use the new endpoints instead of mocking individually

* fix(email): switch email logo back to using url

* fix(schema): remove logic for determining next business day for `submissionDate` (#980)

* fix: remove logic for determining next business day for `submissionDate`

* fix: update `submissionDate` value

* feat(ui): Remove status date from package details pages for all users (#965)

* fix(initial verbiage fix): Email verbiage fixes from qa (#974)

* correct verbage for med and chip spa

* fix issues with verbiage need confirmation

* remove comment

* add date and attachment logic

* update snapshots

* Update ChipSpaState.tsx

* test(email): proces email test (#979)

* feat(test)proces email test

* Removed console.log

* linter correction

* removed a ine

* remove brackets

* add region

* Address change reqeust

* feat(test)-submit lambda (#987)

* feat(test)-submit lambda

* Update withdrawpackage to withdrawrai

* linter corrections

* Fix some test

* Test for malformed objects

* Remove import vs code added in

* remove console.log

* Updatign to use get requestcontext

* feat(test) fix email test (#991)

* feat(test) fix email test
* Update processEmails.test.ts

* fix(os) helpers for getting domain and index for opensearch (#992)

* created helpers for getting domain and index for opensearch
* fixed import

* feat(test) updates to s3 calls on backend (#985)

* updates to s3 calls on backend

* feat(test)-unauthorized submission test (#996)

* feat(amend): Add waiver amendment emails (#993)

* Feat(playwright performance): Pw perf tests (#959)

* feat: initial perf tests for routes

fix: refactor

* Fix: updated per review comments

---------

Co-authored-by: asharonbaltazar <58940073+asharonbaltazar@users.noreply.github.com>

---------

Co-authored-by: 13bfrancis <40218571+13bfrancis@users.noreply.github.com>
Co-authored-by: Ty Bolt <tybolt@gmail.com>
Co-authored-by: Tiffany Forkner <thetif@gmail.com>
Co-authored-by: asharonbaltazar <58940073+asharonbaltazar@users.noreply.github.com>
Co-authored-by: James Dinh <jdinh8124@gmail.com>
Co-authored-by: Thomas Walker <thomas.e.walker88@gmail.com>
Co-authored-by: Benjamin Paige <benjamin.paige@gmail.com>
Co-authored-by: Jon Schaffer <jschaffer@gswell.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants