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

Move lambda tests into a folder #142

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Dec 30, 2024

Context of this PR series

Right now the Datadog Serverless CloudFormation Macro only supports instrumenting Lambda functions. This series of PRs makes it also support instrumenting Step Functions.

Instead of merging every PR into main branch, I'm going to merge them into a feature branch yiming.luo/step-function to:

  1. respect the holiday production freeze
  2. avoid releasing partial support for step functions

What does this PR do?

Move tests node for Lambda to a lambda folder. Later I will create a step_function folder, so Lambda and Step Function code and tests will be separate and more clear.

Motivation

Testing Guidelines

Run npm test to run existing tests. They still pass.

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@lym953 lym953 requested a review from a team as a code owner December 30, 2024 20:56
return {
CloudWatchLogs: jest.fn().mockImplementation((_) => {
return {
describeLogGroups: (params: DescribeLogGroupsRequest, callback?: any) => {

Choose a reason for hiding this comment

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

Code Quality Violation

Unexpected any. Specify a different type. (...read more)

Do not use the any type, as it is too broad and can lead to unexpected behavior.

View in Datadog  Leave us feedback  Documentation

promise: jest.fn().mockImplementation(() => Promise.resolve([])),
};
},
putSubscriptionFilter: (params: PutSubscriptionFilterRequest, callback?: any) => {

Choose a reason for hiding this comment

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

Code Quality Violation

Unexpected any. Specify a different type. (...read more)

Do not use the any type, as it is too broad and can lead to unexpected behavior.

View in Datadog  Leave us feedback  Documentation

@@ -129,7 +92,7 @@ function mockInputEvent(
} as InputEvent;
}

function mockGovCloudInputEvent(params: any, mappings: any, logGroups?: LogGroupDefinition[]) {
export function mockGovCloudInputEvent(params: any, mappings: any, logGroups?: LogGroupDefinition[]) {

Choose a reason for hiding this comment

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

Code Quality Violation

Unexpected any. Specify a different type. (...read more)

Do not use the any type, as it is too broad and can lead to unexpected behavior.

View in Datadog  Leave us feedback  Documentation

putSubscriptionFilter: (params: PutSubscriptionFilterRequest, callback?: any) => {
return { promise: () => Promise.resolve() };
},
createLogGroup: (params: CreateLogGroupRequest, callback?: any) => {

Choose a reason for hiding this comment

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

Code Quality Violation

Unexpected any. Specify a different type. (...read more)

Do not use the any type, as it is too broad and can lead to unexpected behavior.

View in Datadog  Leave us feedback  Documentation

promise: jest.fn().mockImplementation(() => Promise.resolve(response)),
};
},
describeSubscriptionFilters: (params: DescribeSubscriptionFiltersRequest, callback?: any) => {

Choose a reason for hiding this comment

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

Code Quality Violation

Unexpected any. Specify a different type. (...read more)

Do not use the any type, as it is too broad and can lead to unexpected behavior.

View in Datadog  Leave us feedback  Documentation

Base automatically changed from yiming.luo/step-function-2 to yiming.luo/step-function January 2, 2025 22:11
@lym953 lym953 force-pushed the yiming.luo/step-function-3 branch from c9fcce4 to c1df317 Compare January 3, 2025 21:57
@lym953
Copy link
Contributor Author

lym953 commented Jan 3, 2025

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 3, 2025

Devflow running: /merge

View all feedbacks in Devflow UI.


2025-01-03 21:57:37 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in yiming.luo/step-function is 4m.


2025-01-03 22:00:51 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit c77956b into yiming.luo/step-function Jan 3, 2025
11 checks passed
@dd-mergequeue dd-mergequeue bot deleted the yiming.luo/step-function-3 branch January 3, 2025 22:00
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.

2 participants