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

Refactor: Simplify base classes #370

Merged
merged 5 commits into from
Mar 6, 2024

Conversation

andysmith415
Copy link
Collaborator

This PR simplifies some of the base classes by removing the BaseInjector and BaseHandler classes. There is slightly more duplicated code in the handlers, but overall, I think it's a win in terms of easing the cognitive load.

The code compiles and all unit tests, integration tests, end-to-end tests pass locally.

Move entrypoints for each lambda to individual files
@andysmith415 andysmith415 merged commit e8a988f into test-cleanup Mar 6, 2024
2 checks passed
@andysmith415 andysmith415 deleted the refactor_simplify-base-classes branch March 6, 2024 17:01
robert-seitz-uniswap pushed a commit that referenced this pull request Mar 6, 2024
* Refactor: Drop BaseInjector

* Drop base lambda handler

* Drop BaseHandleRequestParams

No longer used.

* Rename base.ts to ErrorCode.ts since it's the only file left.

* Silo handler functions (#371)

Move entrypoints for each lambda to individual files
robert-seitz-uniswap added a commit that referenced this pull request Mar 6, 2024
* Call the existing integration tests end-to-end tests.

Goal of this break-out is to be able to separate unit / integration / end-to-end tests. An e2e test is defined as going through the API gateway. We want to get the unit tests running quicker for future work.

* Create test:integ command with integ/ folder

Move all handlers / repositories over there. Can move them back gradually in debugging the open handles.

* Move most of integ tests over to unit

* Remove unused callWithRetry function

* Run coverage across unit + integration tests

* Add a watch script to the unit tests.

* Move handlers back over to integ

The success cases are all taking 1+ second, so something is systemically
wrong there. Until that is debugged, move them out.

* Fix botched import error.

* Extract HeaderExpectation.

* Rename utils to deleteAllRepoEntries and move it into the integ/repositories folder.

* Globally mock aws-embedded-metrics

This can be overwritten on a per-test basis as needed. The default metricsScope has a fair amount of environment manipulation when it flushes (https://github.com/awslabs/aws-embedded-metrics-node/blob/master/src/logger/MetricsLogger.ts#L42) which was making the handler tests take one second.

* Move more integ handler tests over.

The aws-embedded-metrics mock sped this up.

* Refactor: Simplify base classes (#370)

* Refactor: Drop BaseInjector

* Drop base lambda handler

* Drop BaseHandleRequestParams

No longer used.

* Rename base.ts to ErrorCode.ts since it's the only file left.

* Silo handler functions (#371)

Move entrypoints for each lambda to individual files

---------

Co-authored-by: Andy Smith <andy.smith@uniswap.org>
Co-authored-by: Andy Smith <smith.andy415@gmail.com>
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.

2 participants