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

#2322 - IER12 E2E Tests Additional Scenarios #2474

Merged

Conversation

andrewsignori-aot
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot commented Nov 3, 2023

  • Created two more scenarios from the previous PR (#2322 - IER12 E2E Tests - First scenarios #2461) to-do list.

    • Has full-time disbursement feedback errors (DISE).
    • Has a disbursement that withheld funding due to a restriction (DISW).
  • The first E2E above is invoking the processor without specifying the date as per previous PR comment.

  • New E2E factory created createDisbursementFeedbackError.

  • Added an exception in case getUploadedFile was invoked but it was never called. The tests were failing with a not-so-clear error.

  • Fixed an error in the IER12 query BETWEEN operator and removed a code TODO.

const [errorCode] = FULL_TIME_DISBURSEMENT_FEEDBACK_ERRORS;
const [disbursementSchedule] =
application.currentAssessment.disbursementSchedules;
const feedbackError = createDisbursementFeedbackError(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor. Should we follow the naming convention of createFake*?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed.

// Queued job.
// No date provided as it is expected that the disbursement feedback error
// date would ensure the IER12 record is generated.
const job = createIER12SchedulerJobMock();
Copy link
Collaborator

@dheepak-aot dheepak-aot Nov 3, 2023

Choose a reason for hiding this comment

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

IER here is running based on current date -1 and picking the IER record based on feedback error table.
Amazing to see this level of validation in E2E ❤️

@@ -50,6 +50,11 @@ export function getUploadedFile(
sshClientMock: DeepMocked<Client>,
): UploadedFile {
const uploadedFile = {} as UploadedFile;
if (!sshClientMock.put.mock.calls.length) {
throw new Error(
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

const startDate = new Date(date);
startDate.setHours(0, 0, 0, 0);
const endDate = addDays(1, startDate);
return And(MoreThanOrEqual(startDate), LessThan(endDate));
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Great to see the level of validation for IER12. Approving with one very minor comment.

I believe there is going to be an upcoming PR for multiple institutions scenario right?

@andrewsignori-aot
Copy link
Collaborator Author

Great to see the level of validation for IER12. Approving with one very minor comment.

I believe there is going to be an upcoming PR for multiple institutions scenario right?

Yes, the idea is still the same: try to finish what we can inside the sprint. I will take this scenario as a priority for the upcoming PR 😉

@@ -50,6 +50,11 @@ export function getUploadedFile(
sshClientMock: DeepMocked<Client>,
): UploadedFile {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a part of this PR but maybe we can update the comment to: "Get the parameters provided to the put method of the SSH client that represents the remote file path and the data that would be uploaded to the SFTP in a real scenario."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed.

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.

Nice work 👍 @andrewsignori-aot

@@ -217,10 +220,8 @@ describe(describeProcessorRootTest(QueueNames.IER12Integration), () => {

// Act
const ier12Results = await processor.processIER12File(job);
db.application.createQueryBuilder();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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.

Nice work @andrewsignori-aot 👍

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link

sonarqubecloud bot commented Nov 3, 2023

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

Copy link

github-actions bot commented Nov 3, 2023

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 52.62% ( 341 / 648 )
Methods: 50% ( 40 / 80 )
Lines: 56.85% ( 282 / 496 )
Branches: 26.39% ( 19 / 72 )

Copy link

github-actions bot commented Nov 3, 2023

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 76.94% ( 564 / 733 )
Methods: 71.59% ( 63 / 88 )
Lines: 78.75% ( 493 / 626 )
Branches: 42.11% ( 8 / 19 )

Copy link

github-actions bot commented Nov 3, 2023

E2E SIMS API Coverage Report

Totals Coverage
Statements: 55.53% ( 4084 / 7354 )
Methods: 52.88% ( 505 / 955 )
Lines: 60.25% ( 3310 / 5494 )
Branches: 29.72% ( 269 / 905 )

Copy link

github-actions bot commented Nov 3, 2023

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 18.17% ( 2341 / 12882 )
Methods: 9.28% ( 151 / 1628 )
Lines: 20.69% ( 2016 / 9744 )
Branches: 11.52% ( 174 / 1510 )

Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

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

LGTM

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.

6 participants