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/backend/emailing bugs #91

Merged
merged 61 commits into from
Jun 29, 2024
Merged

Conversation

Rethakgetse-Manaka
Copy link
Contributor

@Rethakgetse-Manaka Rethakgetse-Manaka commented Jun 26, 2024

Description

Updated integration testing for 80% of api-endpoints, changed structures. Need to update docs before merge.

Fixes # (issue)
#94

Type of change

Added more validation in api-endpoint functions.
Added more integration tests
Fixed database models.

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Integration test ran for 80% functions. Did an invalid request, valid request and a 404 test.

  • Invalid Request Test
  • Valid request Test
  • 404 Not found test

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

waveyboym and others added 30 commits June 25, 2024 23:18
…-monitoring-badges

Feat/documentation/adding monitoring badges
… yaml files to facilitate and make development easier for test, dev-local, dev-deployed and prod environments
…yaml files for easier development and environment management
…env-environments

Fix/backend/reorganizing env environments
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 4 lines in your changes missing coverage. Please review.

Project coverage is 85.76%. Comparing base (cd8241a) to head (3bb8b0b).
Report is 152 commits behind head on develop.

Files Patch % Lines
occupi-backend/pkg/utils/utils.go 92.30% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #91      +/-   ##
===========================================
+ Coverage    84.23%   85.76%   +1.53%     
===========================================
  Files            5        5              
  Lines          241      295      +54     
===========================================
+ Hits           203      253      +50     
- Misses          28       30       +2     
- Partials        10       12       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

<img src="https://raw.githubusercontent.com/COS301-SE-2024/occupi/develop/presentation/Occupi/Occupi-black.png" alt="Business Banner" style="width:100%;">
<p>140 Lunnon Road, Hillcrest, Pretoria. PO Box 14679, Hatfield, 0028</p>
</div>
return `
Copy link
Member

Choose a reason for hiding this comment

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

@Rethakgetse-Manaka did you verify that the styling of this footer looks alright? Because I noticed that you are using fixed width's like 600px which may cause issues on people who have monitors that are really wide

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I did test it to verify on the other one was very big and looked weird

@@ -52,3 +54,65 @@ func SendMultipleEmailsConcurrently(emails []string, subject, body string) []str

return emailErrors
}

Copy link
Member

Choose a reason for hiding this comment

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

@Rethakgetse-Manaka , I noticed that you are still sending emails using concurrent methods, which we had highlighted might slow api response times significantly if say an email was to be sent out to 1000 people.
Did you consider using bcc to send the email to multiple people. If it did not work, could I suggest you creating some other branch and writing unit tests to ensure this function is stable, and doesn't get blocked by google if we say try to send many emails in seconds

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'll do that

@waveyboym
Copy link
Member

@Rethakgetse-Manaka , now that we have a working local mongodb to test with, could you consider making a new branch once you have merged this branch to make integration tests for api handlers

@Rethakgetse-Manaka
Copy link
Contributor Author

Okay cool. @waveyboym The reason why I requested your review is because of that linting fail I am experiencing. I wanted your perspective

@waveyboym
Copy link
Member

@Rethakgetse-Manaka , It's saying that for the two test functions you wrote, TestCheckIn and TestCancelBooking, the programming logic is the same so either one of them have to be deleted.
I would suggested instead taking the test cases from either one of the functions and merging them into one test function because from what I can see, the only place where these two test functions differ is the test cases and the linter doesn't like that.

@Rethakgetse-Manaka Rethakgetse-Manaka marked this pull request as ready for review June 29, 2024 22:24
@Rethakgetse-Manaka Rethakgetse-Manaka merged commit a9d0a4a into develop Jun 29, 2024
8 checks passed
@Rethakgetse-Manaka Rethakgetse-Manaka deleted the fix/backend/Emailing-Bugs branch June 29, 2024 22:26
waveyboym pushed a commit that referenced this pull request Aug 12, 2024
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.

3 participants