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

#1723 - E2E/Units Tests - Review Workers E2E Tests #1941

Merged
merged 12 commits into from
May 25, 2023

Conversation

andrepestana-aot
Copy link
Contributor

@andrepestana-aot andrepestana-aot commented May 17, 2023

  • Added a createTestingAppModule for Workers E2E tests;
  • Moved disbursement.controller.saveDisbursementSchedules.e2e-spec to e2e folder;
  • Create the following tests:
    • apps/workers/src/controllers/program-info-request/tests/e2e/program-info-request.controller-updateApplicationStatus.e2e-spec.ts
      ProgramInfoRequestController(e2e)-updateApplicationStatus
      ✓ Should update application PIR status when not set. (67 ms)
      ✓ Should not update application PIR status when already set. (22 ms)
      ✓ Should have job error status when could not find the application. (2 ms)

    • apps/workers/src/controllers/supporting-user/test/e2e/supporting-user.controller.createSupportingUsers.e2e-spec.ts
      SupportingUserController(e2e)-createSupportingUsers
      ✓ Should create parent supporting users when requested. (87 ms)
      ✓ Should create partner supporting user when requested. (39 ms)
      ✓ Should not create supporting users when application already has one. (45 ms)

    • apps/workers/src/controllers/application/tests/e2e/application.controller-updateStatus.e2e-spec.ts
      ApplicationController(e2e)-updateStatus
      ✓ Should update application status when it receives the correct original status. (80 ms)
      ✓ Should not update application status and return error when it does not receive the correct original status. (35 ms)
      ✓ Should return error when it does not find the application. (2 ms)

    • apps/workers/src/controllers/application/tests/e2e/application.controller-verifyApplicationExceptions.e2e-spec.ts
      ApplicationController(e2e)-verifyApplicationExceptions
      ✓ Should create and associate application exceptions when there are some exceptions for the application. (57 ms)
      ✓ Should not create any application exception when there is no application exception in application data. (13 ms)
      ✓ Should return error when it does not find the application. (3 ms)

    • apps/workers/test/app.e2e-spec.ts
      WorkersController (e2e)
      ✓ Should be able to initialize workers module (564 ms)

@andrepestana-aot andrepestana-aot self-assigned this May 17, 2023
@andrepestana-aot andrepestana-aot linked an issue May 18, 2023 that may be closed by this pull request
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe not part of the PR since the main goal was to start the E2E for workers but the scenario where "The exceptions were already processed for this application." is important to ensure the idempotency of the process.
We can add it to this PR os create a new ticket to capture the next ones.

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 created a test for this case: "Should not create an application exception when there is already one for the application."


describe("Disbursement Schedule Service - Create disbursement", () => {
let userRepo: Repository<User>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Really great simplification. This one serves as an example of how the use of the E2EDataSources can make the E2E code cleaner 😉

Copy link
Contributor

@ann-aot ann-aot left a comment

Choose a reason for hiding this comment

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

some minor comments added

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Thanks for doing the changes. Please take a look at the last minor comments.

@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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 17.67% ( 2052 / 11616 )
Methods: 7.85% ( 117 / 1491 )
Lines: 20.46% ( 1804 / 8816 )
Branches: 10.01% ( 131 / 1309 )

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 68.15% ( 383 / 562 )
Methods: 57.75% ( 41 / 71 )
Lines: 70.27% ( 338 / 481 )
Branches: 40% ( 4 / 10 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 49.81% ( 267 / 536 )
Methods: 41.56% ( 32 / 77 )
Lines: 55.33% ( 218 / 394 )
Branches: 26.15% ( 17 / 65 )

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 40.97% ( 2851 / 6958 )
Methods: 34.11% ( 308 / 903 )
Lines: 46.31% ( 2406 / 5195 )
Branches: 15.93% ( 137 / 860 )

Copy link
Contributor

@ann-aot ann-aot left a comment

Choose a reason for hiding this comment

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

Thanks for doing the changes 👍 Good work @andrepestana-aot

Copy link
Collaborator

@sh16011993 sh16011993 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Thanks for doing the changes, looks good 👍

@andrepestana-aot andrepestana-aot merged commit 4b15a15 into main May 25, 2023
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:08 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot deleted the 1723_review_workers_e2e_tests branch May 25, 2023 00:08
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:10 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:10 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:10 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:10 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:10 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:26 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:37 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:37 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:37 — with GitHub Actions Inactive
@andrepestana-aot andrepestana-aot temporarily deployed to DEV May 25, 2023 00:37 — with GitHub Actions Inactive
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.

E2E/Units Tests - Review Workers E2E Tests
4 participants