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

Feature/impl factory pattern repos #188

Merged
merged 49 commits into from
Oct 29, 2023

Conversation

takahiromitsui
Copy link
Member

@takahiromitsui takahiromitsui commented Oct 19, 2023

Tasks

  • Analysed existing features (ref: README-feature/existing-features.md).
  • Tested existing codes (ref: README-feature/existing-features.md).
  • Implemented repository patterns (ref: README-feature/impl-repository_pattern.md).
  • Implemented factory pattern on the repositories (ref: README-feature/impl-factory_pattern_repos.md).

Description

Before implementing event-driven architecture on the backend, I have taken four steps to improve existing codes. I branched off the main branch and created four branches for each step.

This merge request includes four steps/branches (1. feature/analysis-existing-fatures => 2. feature/tests-existing-code => 3. feature/impl-repository_pattern => 4. feature/impl-factory_pattern_repos).

I also created README files as a feature on each branch with the same name as the branch name.

Please refer to the README files for review.

Testing

I also wrote unit tests and e2e tests. For unit testing, I used SQLite and tests can be run by pytest command to specify tests/unit dir. For e2e unit testing, you need to pass DB_ENV= testing and other parameters (ref: env.example file)
and create a testing database on PostgreSQL.

Caution

I exempt e2e tests(tests/e2e and tests/api/versions) from CI/CD pipeline. The reason is that I set up local PostgreSQL to test API endpoints, whereas tests/api/versions(old ones) use a Remote database. My e2e tests have insertion and clean-up functions to the database; therefore, the testing can delete/clean up tables from the remote database. Hence, I took a different approach.

Suggestion

tests/api checks remote database. I'm unsure if it is set up for a testing or production database. If we use a production database, I suggest testing a testing database. Or, it might be better to test a local database since the testing process for a remote database takes a lot of time.

@takahiromitsui takahiromitsui added the feature New feature or request label Oct 19, 2023
@takahiromitsui takahiromitsui self-assigned this Oct 19, 2023
@sonarqubecloud
Copy link

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 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@RichardKruemmel RichardKruemmel changed the base branch from main to development October 20, 2023 10:39
@RichardKruemmel RichardKruemmel merged commit 0f01131 into development Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants