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 flaky tests #845

Merged
merged 2 commits into from
Dec 14, 2022
Merged

Fix flaky tests #845

merged 2 commits into from
Dec 14, 2022

Conversation

shalapatil
Copy link
Contributor

@shalapatil shalapatil commented Dec 13, 2022

Notion card

Summary

Fixed the following flaky specs:

  1. Spec - spec/requests/internal_api/v1/team_members/details/update_spec.rb:

InternalApi::V1::TeamMembers::DetailsController::#update when Employee wants to update his own details is successful Failure/Error: expect(response).to have_http_status(:ok) expected the response to have status code :ok (200) but it was :unprocessable_entity ([42](https://github.com/saeloun/miru-web/actions/runs/3673181224/jobs/6212369080#step:20:43)2) # ./spec/requests/internal_api/v1/team_members/details/update_spec.rb:83:in block (3 levels) in <top (required)>'`

Problem was, in lastname param, we expect only alphabets and sometimes faker was adding ' in the string while generating last name

  1. Spec - spec/requests/internal_api/v1/reports/time_entry/download_spec.rb
    Fix: Spec was not able to get document from the ES, added index refresh call.

Preview

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor (non-breaking and retains same 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?

Checklist:

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have annotated changes in the PR that are relevant to the reviewer
  • I have added automated tests for my code

@shalapatil shalapatil changed the title Fix /spec/requests/internal_api/v1/team_members/details/update_spec.r… Fix team flaky test Dec 13, 2022
@github-actions
Copy link

Current Code Coverage Percent of this PR:

90.13 %

Files having coverage below 100%

Impacted Files Coverage
/lib/custom_failure.rb 80.0 %
/app/helpers/application_helper.rb 95.24 %
/app/controllers/home_controller.rb 66.67 %
/app/controllers/invitations/accept_controller.rb 94.12 %
/app/controllers/invoices/payments_controller.rb 90.48 %
/app/controllers/users/sessions_controller.rb 85.71 %
/app/controllers/webhooks/stripe_controller.rb 87.5 %
/lib/stripe_checkout.rb 11.11 %
/app/controllers/internal_api/v1/invitations_controller.rb 68.18 %
/app/controllers/internal_api/v1/payment_settings_controller.rb 93.33 %
/app/controllers/internal_api/v1/profile_controller.rb 96.88 %
/app/controllers/internal_api/v1/payments/providers_controller.rb 94.74 %
/app/controllers/internal_api/v1/reports/client_revenues_controller.rb 95.0 %
/app/controllers/internal_api/v1/wise/recipients_controller.rb 90.0 %
/app/models/invitation.rb 97.56 %
/app/models/project.rb 97.5 %
/app/policies/invitation_policy.rb 72.73 %
/app/policies/project_member_policy.rb 75.0 %
/app/services/create_invited_user_service.rb 98.36 %
/app/services/date_range_service.rb 91.3 %
/app/services/weekly_reminder_for_missed_entries_service.rb 31.82 %
/app/services/invoice_payment/pdf_generation.rb 56.1 %
/app/services/invoice_payment/stripe_checkout_fulfillment.rb 86.96 %
/app/services/invoice_payment/stripe_payment_intent.rb 83.33 %
/app/services/reports/time_entries/result.rb 97.06 %
/lib/benchmarking/benchmarker.rb 0.0 %

@shalapatil shalapatil changed the title Fix team flaky test Fix flaky tests Dec 13, 2022
@shalapatil shalapatil requested a review from swaathi December 13, 2022 08:49
Copy link
Contributor

@swaathi swaathi left a comment

Choose a reason for hiding this comment

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

Approving and merging. Updating user factory in another PR.

@shalapatil shalapatil merged commit 589be05 into develop Dec 14, 2022
@shalapatil shalapatil deleted the fix-flaky-team-member-test branch December 14, 2022 18:40
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