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

chore(pipes-sources): update integration tests to use SqsTarget #31589

Closed
wants to merge 8 commits into from

Conversation

msambol
Copy link
Contributor

@msambol msambol commented Sep 28, 2024

This incorporates feedback from #30756 so all integration tests are uniform.

Related to #31588.

@github-actions github-actions bot added p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Sep 28, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team September 28, 2024 04:03
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 28, 2024
@msambol
Copy link
Contributor Author

msambol commented Sep 28, 2024

@moelasmar Likewise here, could you review please :)

@@ -1,5 +1,7 @@
import { randomUUID } from 'crypto';
import { ITarget, InputTransformation, Pipe, TargetConfig } from '@aws-cdk/aws-pipes-alpha';
import { InputTransformation, Pipe } from '@aws-cdk/aws-pipes-alpha';
// eslint-disable-next-line import/no-extraneous-dependencies
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure the proper way to handle this. If I add @aws-cdk/aws-pipes-targets-alphs to devDependencies, it creates a circular dependency. is eslint-disable-next-line import/no-extraneous-dependencies OK to have here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@moelasmar I may need your input here. Do I need to go back to those TestClasses?

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry @msambol I missed checking this PR, I will take a look to it tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! The build is failing but those look like good imports to me in the integration test?

@aws-cdk/aws-pipes-sources-alpha: /codebuild/output/src3454251283/src/github.com/aws/aws-cdk/packages/@aws-cdk/aws-pipes-sources-alpha/test/integ.dynamodb.ts
@aws-cdk/aws-pipes-sources-alpha:   3:27  error  Unable to resolve path to module '@aws-cdk/aws-pipes-targets-alpha'  import/no-unresolved
@aws-cdk/aws-pipes-sources-alpha: /codebuild/output/src3454251283/src/github.com/aws/aws-cdk/packages/@aws-cdk/aws-pipes-sources-alpha/test/integ.kinesis.ts
@aws-cdk/aws-pipes-sources-alpha:   3:27  error  Unable to resolve path to module '@aws-cdk/aws-pipes-targets-alpha'  import/no-unresolved
@aws-cdk/aws-pipes-sources-alpha: /codebuild/output/src3454251283/src/github.com/aws/aws-cdk/packages/@aws-cdk/aws-pipes-sources-alpha/test/integ.sqs.ts
@aws-cdk/aws-pipes-sources-alpha:   4:27  error  Unable to resolve path to module '@aws-cdk/aws-pipes-targets-alpha'  import/no-unresolved
@aws-cdk/aws-pipes-sources-alpha: ✖ 3 problems (3 errors, 0 warnings)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@moelasmar Wondering if I should revert some of these changes and do one test-classes.ts file that contains an SqsSource in the targets directory and an SqsTarget in the sources directory, that way there are no dependencies between the two.

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry @msambol for the late response. It appears I initially overlooked the splitting of this service into the main module and the source and target modules that depend on it.

I now understand why we avoided using actual resources or targets in the integ test cases. I agree with your suggestion to include the test-classes.ts file in both the source and target modules.

Could you also add a comment to clarify why we’ve taken this approach, along with a note suggesting we revisit this once we graduate these modules?"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@moelasmar The more I look at this, I prefer to leave the TestTarget in the integration file. I would like to close this PR in favor of #31980. I will then make similar changes in pipes-targets so it is consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking that you will move the TestTarget to the test-classes.ts that already exist in the testing directory, and keep using it instead of the real SqsTarget or any other real Targets.

Also, just add a comment on it for why we choose this direction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@moelasmar I made the change locally, but it didn't feel right to me. I would need to put two different implementations in that file, since one has an input transformation. And the current class in test-classes.ts is used for unit tests. I think I prefer to keep all the code for individual integration tests in one file...

mergify bot pushed a commit that referenced this pull request Oct 8, 2024
This incorporates feedback from #30756 so all integration tests are uniform.

Related to #31589.
@moelasmar moelasmar self-assigned this Oct 9, 2024
@msambol
Copy link
Contributor Author

msambol commented Oct 28, 2024

@moelasmar Any thoughts here? Would love to keep going on these Pipes PRs.

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the BUILD FAILING state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: c4d049f
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@msambol
Copy link
Contributor Author

msambol commented Nov 1, 2024

I'm going to start a fresh PR with cleanup to pipes sources/targets integration tests.

@msambol msambol closed this Nov 1, 2024
Copy link

github-actions bot commented Nov 1, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants