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

SAT: check that connectors emit an AirbyteTraceMessage on failure #12796

Merged
merged 7 commits into from
May 17, 2022

Conversation

pedroslopez
Copy link
Contributor

@pedroslopez pedroslopez commented May 11, 2022

What

Verify that connectors emit at least one AirbyteTraceMessage on crash.

closes #12473

How

  • Call the connector's read method with an invalid configured catalog (specifically with a bogus stream name)
  • Check that an AirbyteTraceMessage is present

Recommended reading order

  1. tests/test_core.py
  2. unit_tests/test_core.py
  3. other files

🚨 User Impact 🚨

Connectors will no longer pass the SAT if they do not emit an AirbyteTraceMessage on generic failures. For most cases, this should just mean updating to the latest version of the CDK (>= 0.1.56).

If the connector really shouldn't emit an airbyte trace message, it can opt out of the test by setting expect_trace_message_on_failure=False on the basic_read test config.

Tests

Unit
 unit_tests/test_asserts.py::test_verify_records_schema βœ“                                                                                                                                                                     1% ▏         
 unit_tests/test_asserts.py::test_validate_records_format[record0-configured_catalog0-False] βœ“                                                                                                                                1% β–Ž         
 unit_tests/test_asserts.py::test_validate_records_format[record1-configured_catalog1-False] βœ“                                                                                                                                2% β–Ž         
 unit_tests/test_asserts.py::test_validate_records_format[record2-configured_catalog2-False] βœ“                                                                                                                                2% β–Ž         
 unit_tests/test_asserts.py::test_validate_records_format[record3-configured_catalog3-False] βœ“                                                                                                                                3% ▍         
 unit_tests/test_asserts.py::test_validate_records_format[record4-configured_catalog4-True] βœ“                                                                                                                                 3% ▍         
 unit_tests/test_asserts.py::test_validate_records_format[record5-configured_catalog5-False] βœ“                                                                                                                                4% ▍         
 unit_tests/test_asserts.py::test_validate_records_format[record6-configured_catalog6-True] βœ“                                                                                                                                 4% β–Œ         
 unit_tests/test_asserts.py::test_validate_records_format[record7-configured_catalog7-False] βœ“                                                                                                                                5% β–Œ         
 unit_tests/test_asserts.py::test_validate_records_format[record8-configured_catalog8-False] βœ“                                                                                                                                5% β–‹         
 unit_tests/test_asserts.py::test_validate_records_format[record9-configured_catalog9-True] βœ“                                                                                                                                 6% β–‹         
 unit_tests/test_asserts.py::test_validate_records_format[record10-configured_catalog10-True] βœ“                                                                                                                               6% β–‹         
 unit_tests/test_asserts.py::test_validate_records_format[record11-configured_catalog11-True] βœ“                                                                                                                               7% β–Š         
 unit_tests/test_asserts.py::test_validate_records_format[record12-configured_catalog12-True] βœ“                                                                                                                               8% β–Š         
 unit_tests/test_asserts.py::test_validate_records_format[record13-configured_catalog13-False] βœ“                                                                                                                              8% β–Š         
 unit_tests/test_asserts.py::test_validate_records_format[record14-configured_catalog14-False] βœ“                                                                                                                              9% β–‰         
 unit_tests/test_asserts.py::test_validate_records_format[record15-configured_catalog15-False] βœ“                                                                                                                              9% β–‰         
 unit_tests/test_asserts.py::test_validate_records_format[record16-configured_catalog16-True] βœ“                                                                                                                              10% β–ˆ         
 unit_tests/test_asserts.py::test_validate_records_format[record17-configured_catalog17-False] βœ“                                                                                                                             10% β–ˆ         
 unit_tests/test_asserts.py::test_validate_records_format[record18-configured_catalog18-True] βœ“                                                                                                                              11% β–ˆβ–        
 unit_tests/test_asserts.py::test_validate_records_format[record19-configured_catalog19-True] βœ“                                                                                                                              11% β–ˆβ–Ž        
 unit_tests/test_asserts.py::test_validate_records_format[record20-configured_catalog20-True] βœ“                                                                                                                              12% β–ˆβ–Ž        
 unit_tests/test_asserts.py::test_validate_records_format[record21-configured_catalog21-False] βœ“                                                                                                                             12% β–ˆβ–Ž        
 unit_tests/test_asserts.py::test_validate_records_format[record22-configured_catalog22-False] βœ“                                                                                                                             13% β–ˆβ–        
 unit_tests/test_asserts.py::test_validate_records_format[record23-configured_catalog23-True] βœ“                                                                                                                              14% β–ˆβ–        
 unit_tests/test_asserts.py::test_validate_records_format[record24-configured_catalog24-True] βœ“                                                                                                                              14% β–ˆβ–Œ        
 unit_tests/test_asserts.py::test_validate_records_format[record25-configured_catalog25-False] βœ“                                                                                                                             15% β–ˆβ–Œ        
 unit_tests/test_asserts.py::test_validate_records_format[record26-configured_catalog26-False] βœ“                                                                                                                             15% β–ˆβ–Œ        
 unit_tests/test_asserts.py::test_validate_records_format[record27-configured_catalog27-True] βœ“                                                                                                                              16% β–ˆβ–‹        
 unit_tests/test_asserts.py::test_validate_records_format[record28-configured_catalog28-False] βœ“                                                                                                                             16% β–ˆβ–‹        
 unit_tests/test_asserts.py::test_validate_records_format[record29-configured_catalog29-True] βœ“                                                                                                                              17% β–ˆβ–‹        
 unit_tests/test_asserts.py::test_validate_records_format[record30-configured_catalog30-True] βœ“                                                                                                                              17% β–ˆβ–Š        
 unit_tests/test_asserts.py::test_validate_records_format[record31-configured_catalog31-True] βœ“                                                                                                                              18% β–ˆβ–Š        
 unit_tests/test_core.py::test_discovery[schema0-cursors0-True] βœ“                                                                                                                                                            18% β–ˆβ–‰        
 unit_tests/test_core.py::test_discovery[schema1-cursors1-False] βœ“                                                                                                                                                           19% β–ˆβ–‰        
 unit_tests/test_core.py::test_discovery[schema2-cursors2-True] βœ“                                                                                                                                                            19% β–ˆβ–‰        
 unit_tests/test_core.py::test_discovery[schema3-cursors3-True] βœ“                                                                                                                                                            20% β–ˆβ–ˆ        
 unit_tests/test_core.py::test_discovery[schema4-cursors4-False] βœ“                                                                                                                                                           21% β–ˆβ–ˆβ–       
 unit_tests/test_core.py::test_discovery[schema5-cursors5-True] βœ“                                                                                                                                                            21% β–ˆβ–ˆβ–Ž       
 unit_tests/test_core.py::test_ref_in_discovery_schemas[schema0-False] βœ“                                                                                                                                                     22% β–ˆβ–ˆβ–Ž       
 unit_tests/test_core.py::test_ref_in_discovery_schemas[schema1-True] βœ“                                                                                                                                                      22% β–ˆβ–ˆβ–Ž       
 unit_tests/test_core.py::test_ref_in_discovery_schemas[schema2-True] βœ“                                                                                                                                                      23% β–ˆβ–ˆβ–       
 unit_tests/test_core.py::test_ref_in_discovery_schemas[schema3-True] βœ“                                                                                                                                                      23% β–ˆβ–ˆβ–       
 unit_tests/test_core.py::test_ref_in_discovery_schemas[schema4-False] βœ“                                                                                                                                                     24% β–ˆβ–ˆβ–       
 unit_tests/test_core.py::test_ref_in_discovery_schemas[schema5-True] βœ“                                                                                                                                                      24% β–ˆβ–ˆβ–Œ       
 unit_tests/test_core.py::test_ref_in_discovery_schemas[schema6-True] βœ“                                                                                                                                                      25% β–ˆβ–ˆβ–Œ       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema0-allOf-False] βœ“                                                                                                                                           25% β–ˆβ–ˆβ–‹       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema1-allOf-True] βœ“                                                                                                                                            26% β–ˆβ–ˆβ–‹       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema2-allOf-False] βœ“                                                                                                                                           26% β–ˆβ–ˆβ–‹       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema3-allOf-True] βœ“                                                                                                                                            27% β–ˆβ–ˆβ–Š       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema4-allOf-True] βœ“                                                                                                                                            28% β–ˆβ–ˆβ–Š       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema5-allOf-True] βœ“                                                                                                                                            28% β–ˆβ–ˆβ–Š       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema6-not-True] βœ“                                                                                                                                              29% β–ˆβ–ˆβ–‰       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema7-not-False] βœ“                                                                                                                                             29% β–ˆβ–ˆβ–‰       
 unit_tests/test_core.py::test_keyword_in_discovery_schemas[schema8-not-True] βœ“                                                                                                                                              30% β–ˆβ–ˆβ–ˆ       
 unit_tests/test_core.py::test_read[schema0-record0-False] βœ“                                                                                                                                                                 30% β–ˆβ–ˆβ–ˆ       
 unit_tests/test_core.py::test_read[schema1-record1-False] βœ“                                                                                                                                                                 31% β–ˆβ–ˆβ–ˆβ–      
 unit_tests/test_core.py::test_read[schema2-record2-True] βœ“                                                                                                                                                                  31% β–ˆβ–ˆβ–ˆβ–Ž      
 unit_tests/test_core.py::test_read[schema3-record3-False] βœ“                                                                                                                                                                 32% β–ˆβ–ˆβ–ˆβ–Ž      
 unit_tests/test_core.py::test_read[schema4-record4-True] βœ“                                                                                                                                                                  32% β–ˆβ–ˆβ–ˆβ–Ž      
 unit_tests/test_core.py::test_read[schema5-record5-False] βœ“                                                                                                                                                                 33% β–ˆβ–ˆβ–ˆβ–      
 unit_tests/test_core.py::test_airbyte_trace_message_on_failure[output0-True-False] βœ“                                                                                                                                        34% β–ˆβ–ˆβ–ˆβ–      
 unit_tests/test_core.py::test_airbyte_trace_message_on_failure[output1-True-False] βœ“                                                                                                                                        34% β–ˆβ–ˆβ–ˆβ–Œ      
 unit_tests/test_core.py::test_airbyte_trace_message_on_failure[output2-True-False] βœ“                                                                                                                                        35% β–ˆβ–ˆβ–ˆβ–Œ      
 unit_tests/test_core.py::test_airbyte_trace_message_on_failure[output3-True-True] βœ“                                                                                                                                         35% β–ˆβ–ˆβ–ˆβ–Œ      
 unit_tests/test_core.py::test_airbyte_trace_message_on_failure[output4-True-True] βœ“                                                                                                                                         36% β–ˆβ–ˆβ–ˆβ–‹      
 unit_tests/test_core.py::test_airbyte_trace_message_on_failure[output5-False-False] βœ“                                                                                                                                       36% β–ˆβ–ˆβ–ˆβ–‹      
 unit_tests/test_core.py::test_airbyte_trace_message_on_failure[output6-False-False] βœ“                                                                                                                                       37% β–ˆβ–ˆβ–ˆβ–‹      
 unit_tests/test_core.py::test_airbyte_trace_message_on_failure[output7-False-False] βœ“                                                                                                                                       37% β–ˆβ–ˆβ–ˆβ–Š      
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records0-configured_catalog0-] βœ“                                                                                                                         38% β–ˆβ–ˆβ–ˆβ–Š      
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records1-configured_catalog1-`test1` stream has `\\['/f2'\\]`] βœ“                                                                                         38% β–ˆβ–ˆβ–ˆβ–‰      
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records2-configured_catalog2-] βœ“                                                                                                                         39% β–ˆβ–ˆβ–ˆβ–‰      
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records3-configured_catalog3-] βœ“                                                                                                                         39% β–ˆβ–ˆβ–ˆβ–‰      
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records4-configured_catalog4-`test1` stream has `\\['/f3/\\[\\]'\\]`] βœ“                                                                                  40% β–ˆβ–ˆβ–ˆβ–ˆ      
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records5-configured_catalog5-] βœ“                                                                                                                         41% β–ˆβ–ˆβ–ˆβ–ˆβ–     
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records6-configured_catalog6-`test1` stream has `\\['/f3/f5/\\[\\]'\\]`] βœ“                                                                               41% β–ˆβ–ˆβ–ˆβ–ˆβ–Ž     
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records7-configured_catalog7-`test1` stream has `\\['/f3/f5/\\[\\]/f6', '/f3/f5/\\[\\]/f7/\\[\\]'\\]`] βœ“                                                 42% β–ˆβ–ˆβ–ˆβ–ˆβ–Ž     
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records8-configured_catalog8-] βœ“                                                                                                                         42% β–ˆβ–ˆβ–ˆβ–ˆβ–Ž     
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records9-configured_catalog9-(`test1` stream has `\\['/f3/f5/\\[\\]/f7/\\[\\]']`)|(`test2` `\\['/f8'\\]`)] βœ“                                             43% β–ˆβ–ˆβ–ˆβ–ˆβ–     
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records10-configured_catalog10-] βœ“                                                                                                                       43% β–ˆβ–ˆβ–ˆβ–ˆβ–     
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records11-configured_catalog11-] βœ“                                                                                                                       44% β–ˆβ–ˆβ–ˆβ–ˆβ–     
 unit_tests/test_core.py::test_validate_field_appears_at_least_once[records12-configured_catalog12-`test1` stream has `\\['/f3\\(0\\)/f4', '/f3\\(1\\)/f5\\(0\\)/f6', '/f3\\(1\\)/f5\\(1\\)/f7'\\]`] βœ“                       44% β–ˆβ–ˆβ–ˆβ–ˆβ–Œ     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[record_value0-state_value0-0-True] βœ“                                                                                                                     45% β–ˆβ–ˆβ–ˆβ–ˆβ–Œ     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[record_value1-state_value1-0-False] βœ“                                                                                                                    45% β–ˆβ–ˆβ–ˆβ–ˆβ–‹     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[record_value2-state_value2-1-True] βœ“                                                                                                                     46% β–ˆβ–ˆβ–ˆβ–ˆβ–‹     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[record_value3-state_value3-0-True] βœ“                                                                                                                     46% β–ˆβ–ˆβ–ˆβ–ˆβ–‹     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[record_value4-state_value4-0-False] βœ“                                                                                                                    47% β–ˆβ–ˆβ–ˆβ–ˆβ–Š     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[record_value5-state_value5-1-True] βœ“                                                                                                                     48% β–ˆβ–ˆβ–ˆβ–ˆβ–Š     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[2020-10-10-2020-10-09-0-True] βœ“                                                                                                                          48% β–ˆβ–ˆβ–ˆβ–ˆβ–Š     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[2020-10-10-2020-10-11-0-False] βœ“                                                                                                                         49% β–ˆβ–ˆβ–ˆβ–ˆβ–‰     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[2020-10-10-2020-10-11-1-True] βœ“                                                                                                                          49% β–ˆβ–ˆβ–ˆβ–ˆβ–‰     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[1602288000000-1602201600000-0-True] βœ“                                                                                                                    50% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[1602288000000-1602374400000-0-False] βœ“                                                                                                                   50% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ     
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[1602288000000-1602374400000-1-True] βœ“                                                                                                                    51% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–    
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[1602288000-1602201600-0-True] βœ“                                                                                                                          51% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž    
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[1602288000-1602374400-0-False] βœ“                                                                                                                         52% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž    
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[1602288000-1602374400-1-True] βœ“                                                                                                                          52% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž    
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[aaa-bbb-0-False] βœ“                                                                                                                                       53% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–    
 unit_tests/test_incremental.py::test_compare_cursor_with_threshold[bbb-aaa-0-True] βœ“                                                                                                                                        54% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records10-records20-2020-01-02-0-None-date] βœ“                                                                                                         54% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records10-records20-2020-01-02-0-None-string] βœ“                                                                                                       55% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records11-records21-2020-01-02-0-First incremental sync should produce records younger-date] βœ“                                                        55% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records11-records21-2020-01-02-0-First incremental sync should produce records younger-string] βœ“                                                      56% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records12-records22-2020-01-02-0-None-date] βœ“                                                                                                         56% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records12-records22-2020-01-02-0-None-string] βœ“                                                                                                       57% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records13-records23-2020-01-02-0-Second incremental sync should produce records older-date] βœ“                                                         57% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records13-records23-2020-01-02-0-Second incremental sync should produce records older-string] βœ“                                                       58% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records14-records24-2020-01-03-2-None-date] βœ“                                                                                                         58% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records14-records24-2020-01-03-2-None-string] βœ“                                                                                                       59% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records15-records25-2020-01-02-2-First incremental sync should produce records younger-date] βœ“                                                        59% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records15-records25-2020-01-02-2-First incremental sync should produce records younger-string] βœ“                                                      60% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ    
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records16-records26-2020-01-06-3-Second incremental sync should produce records older-date] βœ“                                                         61% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   
 unit_tests/test_incremental.py::test_incremental_two_sequential_reads[records16-records26-2020-01-06-3-Second incremental sync should produce records older-string] βœ“                                                       61% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž   
 unit_tests/test_json_schema_helper.py::test_simple_path βœ“                                                                                                                                                                   62% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž   
 unit_tests/test_json_schema_helper.py::test_nested_path βœ“                                                                                                                                                                   62% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž   
 unit_tests/test_json_schema_helper.py::test_nested_path_unknown βœ“                                                                                                                                                           63% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   
 unit_tests/test_json_schema_helper.py::test_absolute_path βœ“                                                                                                                                                                 63% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   
 unit_tests/test_json_schema_helper.py::test_json_schema_helper_pydantic_generated βœ“                                                                                                                                         64% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   
 unit_tests/test_json_schema_helper.py::test_get_object_strucutre[object0-pathes0] βœ“                                                                                                                                         64% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ   
 unit_tests/test_json_schema_helper.py::test_get_object_strucutre[object1-pathes1] βœ“                                                                                                                                         65% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ   
 unit_tests/test_json_schema_helper.py::test_get_object_strucutre[object2-pathes2] βœ“                                                                                                                                         65% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹   
 unit_tests/test_json_schema_helper.py::test_get_object_strucutre[object3-pathes3] βœ“                                                                                                                                         66% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹   
 unit_tests/test_json_schema_helper.py::test_get_object_strucutre[object4-pathes4] βœ“                                                                                                                                         66% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹   
 unit_tests/test_json_schema_helper.py::test_get_object_strucutre[object5-pathes5] βœ“                                                                                                                                         67% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š   
 unit_tests/test_json_schema_helper.py::test_get_object_strucutre[object6-pathes6] βœ“                                                                                                                                         68% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š   
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema0-pathes0] βœ“                                                                                                                                68% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š   
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema1-pathes1] βœ“                                                                                                                                69% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰   
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema2-pathes2] βœ“                                                                                                                                69% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰   
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema3-pathes3] βœ“                                                                                                                                70% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema4-pathes4] βœ“                                                                                                                                70% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema5-pathes5] βœ“                                                                                                                                71% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema6-pathes6] βœ“                                                                                                                                71% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž  
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema7-pathes7] βœ“                                                                                                                                72% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž  
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema8-pathes8] βœ“                                                                                                                                72% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž  
 unit_tests/test_json_schema_helper.py::test_get_expected_schema_structure[schema9-pathes9] βœ“                                                                                                                                73% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec0-True] βœ“                                                                                                                                                   74% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec1-True] βœ“                                                                                                                                                   74% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec2-True] βœ“                                                                                                                                                   75% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec3-True] βœ“                                                                                                                                                   75% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec4-False] βœ“                                                                                                                                                  76% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec5-False] βœ“                                                                                                                                                  76% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec6-True] βœ“                                                                                                                                                   77% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec7-True] βœ“                                                                                                                                                   77% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec8-True] βœ“                                                                                                                                                   78% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec9-False] βœ“                                                                                                                                                  78% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰  
 unit_tests/test_spec.py::test_ref_in_spec_schemas[connector_spec10-True] βœ“                                                                                                                                                  79% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰  
 unit_tests/test_spec.py::test_oneof_usage[all_good] βœ“                                                                                                                                                                       79% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰  
 unit_tests/test_spec.py::test_oneof_usage[top_level_node_is_not_of_object_type] βœ“                                                                                                                                           80% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  
 unit_tests/test_spec.py::test_oneof_usage[all_oneof_options_should_have_same_constant_attribute] βœ“                                                                                                                          81% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– 
 unit_tests/test_spec.py::test_oneof_usage[one_of_item_is_not_of_type_object] βœ“                                                                                                                                              81% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž 
 unit_tests/test_spec.py::test_oneof_usage[no_common_property_for_all_oneof_subobjects] βœ“                                                                                                                                    82% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž 
 unit_tests/test_spec.py::test_oneof_usage[two_common_properties_with_const_keyword] βœ“                                                                                                                                       82% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž 
 unit_tests/test_spec.py::test_oneof_usage[default_keyword_in_common_property] βœ“                                                                                                                                             83% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– 
 unit_tests/test_spec.py::test_validate_oauth_flow[connector_spec0-] βœ“                                                                                                                                                       83% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– 
 unit_tests/test_spec.py::test_validate_oauth_flow[connector_spec1-Specified oauth fields are missed from spec schema:] βœ“                                                                                                    84% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– 
 unit_tests/test_spec.py::test_validate_oauth_flow[connector_spec2-] βœ“                                                                                                                                                       84% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ 
 unit_tests/test_spec.py::test_validate_oauth_flow[connector_spec3-Specified oauth fields are missed from spec schema:] βœ“                                                                                                    85% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ 
 unit_tests/test_spec.py::test_validate_oauth_flow[connector_spec4-] βœ“                                                                                                                                                       85% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ 
 unit_tests/test_spec.py::test_validate_oauth_flow[connector_spec5-] βœ“                                                                                                                                                       86% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ 
 unit_tests/test_spec.py::test_validate_oauth_flow[connector_spec6-Specified oauth fields are missed from spec schema:] βœ“                                                                                                    86% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ 
 unit_tests/test_spec.py::test_validate_oauth_flow[connector_spec7-] βœ“                                                                                                                                                       87% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š 
 unit_tests/test_spec_unit.py::TestEnvAttributes.test_correct_connector_image βœ“                                                                                                                                              88% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š 
 unit_tests/test_spec_unit.py::TestEnvAttributes.test_connector_image_without_env βœ“                                                                                                                                          88% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š 
 unit_tests/test_spec_unit.py::TestEnvAttributes.test_docker_image_env_ne_entrypoint βœ“                                                                                                                                       89% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰ 
 unit_tests/test_test_full_refresh.py::test_read_with_ignore_fields[no_ignored_fields_present] βœ“                                                                                                                             89% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰ 
 unit_tests/test_test_full_refresh.py::test_read_with_ignore_fields[with_ignored_field] βœ“                                                                                                                                    90% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 
 unit_tests/test_test_full_refresh.py::test_read_with_ignore_fields[ignore_field_present_but_a_required_is_not] βœ“                                                                                                            90% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 
 unit_tests/test_utils.py::test_compare_two_records_nested_with_different_orders[obj10-obj20-True] βœ“                                                                                                                         91% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–
 unit_tests/test_utils.py::test_compare_two_records_nested_with_different_orders[obj11-obj21-True] βœ“                                                                                                                         91% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž
 unit_tests/test_utils.py::test_compare_two_records_nested_with_different_orders[obj12-obj22-False] βœ“                                                                                                                        92% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž
 unit_tests/test_utils.py::test_compare_two_records_nested_with_different_orders[obj13-obj23-False] βœ“                                                                                                                        92% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž
 unit_tests/test_utils.py::test_compare_two_records_nested_with_different_orders[obj14-obj24-True] βœ“                                                                                                                         93% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–
 unit_tests/test_utils.py::test_compare_two_records_nested_with_different_orders[obj15-obj25-True] βœ“                                                                                                                         94% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–
 unit_tests/test_utils.py::test_compare_two_records_nested_with_different_orders[obj16-obj26-False] βœ“                                                                                                                        94% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ
 unit_tests/test_utils.py::test_exclude_fields βœ“                                                                                                                                                                             95% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ
 unit_tests/test_utils.py::test_successful_logs_reading βœ“                                                                                                                                                                    95% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ{"type": "LOG", "log": {"level": "ERROR", "message": "Docker container was failed, code 1, error:\nSome Container Error"}}

 unit_tests/test_utils.py::test_failed_reading[interal_error] βœ“                                                                                                                                                              96% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹{"type": "LOG", "log": {"level": "ERROR", "message": "Docker container was failed, code 1, error:\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nKeyError: 'bbbb'"}}

 unit_tests/test_utils.py::test_failed_reading[traceback] βœ“                                                                                                                                                                  96% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹{"type": "LOG", "log": {"level": "ERROR", "message": "Docker container was failed, code 1, error:\nLast Container Logs Line"}}

 unit_tests/test_utils.py::test_failed_reading[last_line] βœ“                                                                                                                                                                  97% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹
 unit_tests/test_utils.py::test_docker_runner[standard] βœ“                                                                                                                                                                    97% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š
 unit_tests/test_utils.py::test_docker_runner[waiting] βœ“                                                                                                                                                                     98% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š
 unit_tests/test_utils.py::test_not_found_container βœ“                                                                                                                                                                        98% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰
 unit_tests/test_utils.py::TestLoadYamlOrJsonPath.test_load_json βœ“                                                                                                                                                           99% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰
 unit_tests/test_utils.py::TestLoadYamlOrJsonPath.test_load_yaml βœ“                                                                                                                                                           99% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰
 unit_tests/test_utils.py::TestLoadYamlOrJsonPath.test_load_other βœ“                                                                                                                                                         100% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

Results (4.27s):
     185 passed

streams=[
ConfiguredAirbyteStream(
stream=AirbyteStream(
name="__AIRBYTE__stream_that_does_not_exist",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test assumes that connectors should always crash if we're trying to sync a stream name that does not exist.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense to me!

Are there any other types of failures we might want to check? What about running with an invalid config?

@pedroslopez pedroslopez marked this pull request as ready for review May 12, 2022 21:46
Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

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

I can't speak to the pythonic-ness of this PR, but logically this looks great! I think there might be other types of failures to check for the trace message (invalid config, a random SIGKILL), but those can be added in later PRs.

@@ -144,6 +156,95 @@ def test_read(schema, record, should_fail):
t.test_read(None, catalog, input_config, [], docker_runner_mock, MagicMock())


@pytest.mark.parametrize(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a test mock I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

parametrize is pretty neat - it lets you easily run the same test with different input configurations. https://docs.pytest.org/en/6.2.x/parametrize.html

streams=[
ConfiguredAirbyteStream(
stream=AirbyteStream(
name="__AIRBYTE__stream_that_does_not_exist",
Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense to me!

Are there any other types of failures we might want to check? What about running with an invalid config?

@pedroslopez pedroslopez requested a review from girarda May 13, 2022 20:08
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label May 17, 2022
@pedroslopez
Copy link
Contributor Author

pedroslopez commented May 17, 2022

/publish connector=bases/source-acceptance-test auto-bump-version=false

πŸ•‘ bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/2341077900
πŸš€ Successfully published bases/source-acceptance-test
βœ… bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/2341077900

@pedroslopez pedroslopez merged commit 957a0be into master May 17, 2022
@pedroslopez pedroslopez deleted the pedroslopez/sat-airbytetracemessage branch May 17, 2022 20:43
suhomud pushed a commit that referenced this pull request May 23, 2022
…12796)

* add SAT case for airbyte trace message on failure

* add ability to opt-out

* add tests

* add option to docs

* bump version, update changelog

* fix type errors

* update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SAT Testing confirms that a crash produces at least one AirbyteTraceMessage
3 participants