cc-tracking/tasks/archive/comcarde/bridge-906/commit.md
2019-05-21 16:40:16 +01:00

2.6 KiB

BRIDGE-906 Request Id should implemented in the Activity Log

Summary

  • The Morgan string was extended to include the BridgeUniqueId if available
  • When the log is written to the database, the BridgeUniqueId is extraxted as reqID
  • The string is reconstituded without the BridgeUniqueId at the end so as not to interfere with log readers
  • The reqId is added to ActivityLog
  • Morgan-mongo-spec.js was updated to test the new reqID

Test Plan

  • Run All tests
  • Run Morgan mongo stream
Morgan mongo stream PASSED
    With an online database PASSED
    ✓ Test logs the record to stdout PASSED
    ✓ Test writes stream records to the database PASSED
    ✓ Test adds timestamp to the record stored in the database PASSED
    
    With an offline database PASSED
        That stays offline for 1000 records PASSED
            Then recovers PASSED
                ✓ Test logs the record to stdout PASSED
                ✓ Test writes all records (including ones cached when offline) to the database PASSED
                
        Then receives a 1001st record with offline db PASSED
            Then recovers PASSED
                ✓ Test logs the record to stdout PASSED
                ✓ Test writes all cached records and the new record, but not the 1001st one, to the database PASSED
                ✓ Test still logs the incoming record to stdout PASSED
                ✓ Test reports a data loss warning on stderr PASSED
                ✓ Test still logs the incoming records to stdout PASSED
                ✓ Test doesn't report any errors PASSED
                ✓ Test logs the record to stdout PASSED
                ✓ Test does not attempt to stream records to the database PASSED
                
    With a pending database write PASSED
        With another write after the pending one resolves successfully PASSED
            ✓ Test logs the one buffered during the pending, and the new one PASSED
            
        With another write after the pending one resolves unsuccessfully PASSED
            ✓ Test logs the pending record that failed + the one bufferd during pending, and the new one PASSED
            ✓ Test logs the pending and subsequent record to stdout PASSED
            ✓ Test does not attempt to stream the subsequent record to the database PASSED
            
    It can process the requestId correctly PASSED
        ✓ Test logs the record to stdout PASSED
        ✓ Test writes stream records to the database PASSED
        ✓ Test adds timestamp to the record stored in the database PASSED
        ✓ Test is an object-mode stream PASSED
21 Of 21 Passing