US-EPA-CAMD / easey-ui

Project Management repo for EPA Clean Air Markets Division (CAMD) Business Suite of applications
MIT License
0 stars 0 forks source link

Test: Submission failure emails #6390

Open annalbrecht opened 2 months ago

annalbrecht commented 2 months ago

Based on info in #6205.

We need a way to fail whole submissions and individual submissions in a set.

yonatan-dp commented 4 weeks ago

Scenario 1: Failure During Submission Processing

Objective: Simulate a failure during submission procssing.


Steps:

1. Identify a Submission Set on the Dev Database.
2. Corrupt a Submission Queue Record:
UPDATE camdecmpsaux.submission_queue
SET process_cd = 'XYZ'
WHERE 
submission_set_id = '7767f6e7-d700-8a34-6561-368d79ea13420'
and process_cd = 'MP'
3. Set the Submission Set Status to 'QUEUED':
UPDATE camdecmpsaux.submission_set
SET status_cd = 'QUEUED'
WHERE submission_set_id = '7767f6e7-d700-8a34-6561-368d79ea13420';

3. Wait for the Quartz job to pick up the submission set.


Expected Outcome:

4. Restore the submission_set record to its original value

UPDATE camdecmpsaux.submission_set SET process_cd = 'MP' WHERE submission_set_id = '7767f6e7-d700-8a34-6561-368d79ea13420';

Scenario 2: Failure for specific qa test records

Objective: Simulate failure for selected qa_test, qce, or tee submission queue records.


Steps:

1. Identify a Submission Set:
2. Make sure the submission set has a qa_test, qce, or tee submission queue record.
select * from camdecmpsaux.submission_queue sq 
where sq.submission_set_id = '7767f6e7-d700-8a34-6561-368d79ea13420'
3. Corrupt a reporting entry in the camdaux.datatable for the desired report type (qa_test, qce, or tee)
select sql_statement FROM camdaux.datatable WHERE dataset_cd = 'TEE_FEEDBACK';
  1. Update the sql_statement value to something incorrect (see example given below).
    UPDATE camdaux.datatable 
    set sql_statement = 'SELECT * FROM {SCHEMA}.xyz_abc_feedback($1)'
    WHERE dataset_cd = 'TEE_FEEDBACK';
3. Set the Submission Set Status to 'QUEUED':
UPDATE camdecmpsaux.submission_set
SET status_cd = 'QUEUED'
WHERE submission_set_id = '7767f6e7-d700-8a34-6561-368d79ea13420';

3. Wait for the Quartz job to pick up the submission set.

Expected Outcome:

4. Restore the camdaux.datatable sql_statement value to its original value


UPDATE camdaux.datatable 
set sql_statement = 'SELECT * FROM {SCHEMA}.get_test_extension_exemption_feedback($1)'
WHERE dataset_cd = 'TEE_FEEDBACK';
mxtomoto1 commented 13 hours ago

Scenario 1 as described above was followed for testing. Tester / submitter received a failure email (unable to ascertain if ECMPS Support received failure email). The submission_set status was updated to 'ERROR', and the note field contained the error details and note_time indicated when the error occurred. Screenshot 2024-11-25 072057