-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/xts-bridge-failures' into develop
- Loading branch information
Showing
8 changed files
with
1,179 additions
and
563 deletions.
There are no files selected for viewing
180 changes: 180 additions & 0 deletions
180
test_project/features/bridge/bridge_one_hub_one_link.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
@fixture.set_workdir | ||
Feature: Bridge table - Base Bridge behaviour with one hub and one/two/three links | ||
|
||
@fixture.bridge | ||
Scenario: [BASE-LOAD] Base load into a bridge table from one hub and one link with the AS_OF date and LDTS equal | ||
Given the BRIDGE_CUSTOMER_ORDER table does not exist | ||
And the raw vault contains empty tables | ||
| HUB | LINK | EFF_SAT | BRIDGE | | ||
| HUB_CUSTOMER | LINK_CUSTOMER_ORDER | EFF_SAT_CUSTOMER_ORDER | BRIDGE_CUSTOMER_ORDER | | ||
And the RAW_CUSTOMER_ORDER table contains data | ||
| CUSTOMER_ID | ORDER_ID | LOAD_DATETIME | END_DATE | SOURCE | | ||
| 1001 | 100 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1002 | 200 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1003 | 300 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1004 | 400 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
And I create the STG_CUSTOMER_ORDER stage | ||
And the AS_OF_DATE table is created and populated with data | ||
| AS_OF_DATE | | ||
| 2018-06-01 00:00:00.000 | | ||
When I load the vault | ||
Then the HUB_CUSTOMER table should contain expected data | ||
| CUSTOMER_PK | CUSTOMER_ID | LOAD_DATETIME | SOURCE | | ||
| md5('1001') | 1001 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002') | 1002 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1003') | 1003 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1004') | 1004 | 2018-06-01 00:00:00.000 | * | | ||
Then the LINK_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_ORDER_PK | CUSTOMER_FK | ORDER_FK | LOAD_DATETIME | SOURCE | | ||
| md5('1001\|\|100') | md5('1001') | md5('100') | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|200') | md5('1002') | md5('200') | 2018-06-01 00:00:00.000 | * | | ||
| md5('1003\|\|300') | md5('1003') | md5('300') | 2018-06-01 00:00:00.000 | * | | ||
| md5('1004\|\|400') | md5('1004') | md5('400') | 2018-06-01 00:00:00.000 | * | | ||
Then the EFF_SAT_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_ORDER_PK | CUSTOMER_FK | ORDER_FK | START_DATE | END_DATE | EFFECTIVE_FROM | LOAD_DATETIME | SOURCE | | ||
| md5('1001\|\|100') | md5('1001') | md5('100') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|200') | md5('1002') | md5('200') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1003\|\|300') | md5('1003') | md5('300') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1004\|\|400') | md5('1004') | md5('400') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
Then the BRIDGE_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_PK | AS_OF_DATE | LINK_CUSTOMER_ORDER_PK | | ||
| md5('1001') | 2018-06-01 00:00:00.000 | md5('1001\|\|100') | | ||
| md5('1002') | 2018-06-01 00:00:00.000 | md5('1002\|\|200') | | ||
| md5('1003') | 2018-06-01 00:00:00.000 | md5('1003\|\|300') | | ||
| md5('1004') | 2018-06-01 00:00:00.000 | md5('1004\|\|400') | | ||
|
||
@fixture.bridge | ||
Scenario: [BASE-LOAD] Base load into a bridge table from one hub and one link with AS_OF dates in the past | ||
Given the BRIDGE_CUSTOMER_ORDER table does not exist | ||
And the raw vault contains empty tables | ||
| HUB | LINK | EFF_SAT | BRIDGE | | ||
| HUB_CUSTOMER | LINK_CUSTOMER_ORDER | EFF_SAT_CUSTOMER_ORDER | BRIDGE_CUSTOMER_ORDER | | ||
And the RAW_CUSTOMER_ORDER table contains data | ||
| CUSTOMER_ID | ORDER_ID | LOAD_DATETIME | END_DATE | SOURCE | | ||
| 1001 | 100 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1002 | 200 | 2018-06-01 12:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1003 | 300 | 2018-06-02 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1004 | 400 | 2018-06-02 12:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
And I create the STG_CUSTOMER_ORDER stage | ||
And the AS_OF_DATE table is created and populated with data | ||
| AS_OF_DATE | | ||
| 2018-05-30 00:00:00.000 | | ||
| 2018-05-31 00:00:00.000 | | ||
When I load the vault | ||
Then the HUB_CUSTOMER table should contain expected data | ||
| CUSTOMER_PK | CUSTOMER_ID | LOAD_DATETIME | SOURCE | | ||
| md5('1001') | 1001 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002') | 1002 | 2018-06-01 12:00:00.000 | * | | ||
| md5('1003') | 1003 | 2018-06-02 00:00:00.000 | * | | ||
| md5('1004') | 1004 | 2018-06-02 12:00:00.000 | * | | ||
Then the LINK_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_ORDER_PK | CUSTOMER_FK | ORDER_FK | LOAD_DATETIME | SOURCE | | ||
| md5('1001\|\|100') | md5('1001') | md5('100') | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|200') | md5('1002') | md5('200') | 2018-06-01 12:00:00.000 | * | | ||
| md5('1003\|\|300') | md5('1003') | md5('300') | 2018-06-02 00:00:00.000 | * | | ||
| md5('1004\|\|400') | md5('1004') | md5('400') | 2018-06-02 12:00:00.000 | * | | ||
Then the EFF_SAT_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_ORDER_PK | CUSTOMER_FK | ORDER_FK | START_DATE | END_DATE | EFFECTIVE_FROM | LOAD_DATETIME | SOURCE | | ||
| md5('1001\|\|100') | md5('1001') | md5('100') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|200') | md5('1002') | md5('200') | 2018-06-01 12:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 12:00:00.000 | 2018-06-01 12:00:00.000 | * | | ||
| md5('1003\|\|300') | md5('1003') | md5('300') | 2018-06-02 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-02 00:00:00.000 | 2018-06-02 00:00:00.000 | * | | ||
| md5('1004\|\|400') | md5('1004') | md5('400') | 2018-06-02 12:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-02 12:00:00.000 | 2018-06-02 12:00:00.000 | * | | ||
Then the BRIDGE_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_PK | AS_OF_DATE | LINK_CUSTOMER_ORDER_PK | | ||
|
||
@fixture.bridge | ||
Scenario: [BASE-LOAD] Base load into a bridge table from one hub and one link with AS_OF dates in the future | ||
Given the BRIDGE_CUSTOMER_ORDER table does not exist | ||
And the raw vault contains empty tables | ||
| HUB | LINK | EFF_SAT | BRIDGE | | ||
| HUB_CUSTOMER | LINK_CUSTOMER_ORDER | EFF_SAT_CUSTOMER_ORDER | BRIDGE_CUSTOMER_ORDER | | ||
And the RAW_CUSTOMER_ORDER table contains data | ||
| CUSTOMER_ID | ORDER_ID | LOAD_DATETIME | END_DATE | SOURCE | | ||
| 1001 | 100 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1002 | 200 | 2018-06-01 12:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1003 | 300 | 2018-06-02 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1004 | 400 | 2018-06-02 12:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
And I create the STG_CUSTOMER_ORDER stage | ||
And the AS_OF_DATE table is created and populated with data | ||
| AS_OF_DATE | | ||
| 2018-06-03 00:00:00.000 | | ||
| 2018-06-04 00:00:00.000 | | ||
When I load the vault | ||
Then the HUB_CUSTOMER table should contain expected data | ||
| CUSTOMER_PK | CUSTOMER_ID | LOAD_DATETIME | SOURCE | | ||
| md5('1001') | 1001 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002') | 1002 | 2018-06-01 12:00:00.000 | * | | ||
| md5('1003') | 1003 | 2018-06-02 00:00:00.000 | * | | ||
| md5('1004') | 1004 | 2018-06-02 12:00:00.000 | * | | ||
Then the LINK_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_ORDER_PK | CUSTOMER_FK | ORDER_FK | LOAD_DATETIME | SOURCE | | ||
| md5('1001\|\|100') | md5('1001') | md5('100') | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|200') | md5('1002') | md5('200') | 2018-06-01 12:00:00.000 | * | | ||
| md5('1003\|\|300') | md5('1003') | md5('300') | 2018-06-02 00:00:00.000 | * | | ||
| md5('1004\|\|400') | md5('1004') | md5('400') | 2018-06-02 12:00:00.000 | * | | ||
Then the EFF_SAT_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_ORDER_PK | CUSTOMER_FK | ORDER_FK | START_DATE | END_DATE | EFFECTIVE_FROM | LOAD_DATETIME | SOURCE | | ||
| md5('1001\|\|100') | md5('1001') | md5('100') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|200') | md5('1002') | md5('200') | 2018-06-01 12:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 12:00:00.000 | 2018-06-01 12:00:00.000 | * | | ||
| md5('1003\|\|300') | md5('1003') | md5('300') | 2018-06-02 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-02 00:00:00.000 | 2018-06-02 00:00:00.000 | * | | ||
| md5('1004\|\|400') | md5('1004') | md5('400') | 2018-06-02 12:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-02 12:00:00.000 | 2018-06-02 12:00:00.000 | * | | ||
Then the BRIDGE_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_PK | AS_OF_DATE | LINK_CUSTOMER_ORDER_PK | | ||
| md5('1001') | 2018-06-03 00:00:00.000 | md5('1001\|\|100') | | ||
| md5('1002') | 2018-06-03 00:00:00.000 | md5('1002\|\|200') | | ||
| md5('1003') | 2018-06-03 00:00:00.000 | md5('1003\|\|300') | | ||
| md5('1004') | 2018-06-03 00:00:00.000 | md5('1004\|\|400') | | ||
| md5('1001') | 2018-06-04 00:00:00.000 | md5('1001\|\|100') | | ||
| md5('1002') | 2018-06-04 00:00:00.000 | md5('1002\|\|200') | | ||
| md5('1003') | 2018-06-04 00:00:00.000 | md5('1003\|\|300') | | ||
| md5('1004') | 2018-06-04 00:00:00.000 | md5('1004\|\|400') | | ||
|
||
@fixture.bridge | ||
Scenario: [BASE-LOAD] Base load into a bridge table from one hub and one link with multiple loads and an encompassing range of AS OF dates | ||
Given the BRIDGE_CUSTOMER_ORDER table does not exist | ||
And the raw vault contains empty tables | ||
| HUB | LINK | EFF_SAT | BRIDGE | | ||
| HUB_CUSTOMER | LINK_CUSTOMER_ORDER | EFF_SAT_CUSTOMER_ORDER | BRIDGE_CUSTOMER_ORDER | | ||
And the RAW_CUSTOMER_ORDER table contains data | ||
| CUSTOMER_ID | ORDER_ID | LOAD_DATETIME | END_DATE | SOURCE | | ||
| 1001 | 100 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1002 | 200 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1002 | 201 | 2018-06-01 12:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1003 | 300 | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
| 1003 | 301 | 2018-06-01 12:00:00.000 | 9999-12-31 23:59:59.999 | * | | ||
And I create the STG_CUSTOMER_ORDER stage | ||
And the AS_OF_DATE table is created and populated with data | ||
| AS_OF_DATE | | ||
| 2018-05-31 00:00:00.000 | | ||
| 2018-06-01 00:00:00.000 | | ||
| 2018-06-02 00:00:00.000 | | ||
When I load the vault | ||
Then the HUB_CUSTOMER table should contain expected data | ||
| CUSTOMER_PK | CUSTOMER_ID | LOAD_DATETIME | SOURCE | | ||
| md5('1001') | 1001 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002') | 1002 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1003') | 1003 | 2018-06-01 00:00:00.000 | * | | ||
Then the LINK_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_ORDER_PK | CUSTOMER_FK | ORDER_FK | LOAD_DATETIME | SOURCE | | ||
| md5('1001\|\|100') | md5('1001') | md5('100') | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|200') | md5('1002') | md5('200') | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|201') | md5('1002') | md5('201') | 2018-06-01 12:00:00.000 | * | | ||
| md5('1003\|\|300') | md5('1003') | md5('300') | 2018-06-01 00:00:00.000 | * | | ||
| md5('1003\|\|301') | md5('1003') | md5('301') | 2018-06-01 12:00:00.000 | * | | ||
Then the EFF_SAT_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_ORDER_PK | CUSTOMER_FK | ORDER_FK | START_DATE | END_DATE | EFFECTIVE_FROM | LOAD_DATETIME | SOURCE | | ||
| md5('1001\|\|100') | md5('1001') | md5('100') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|200') | md5('1002') | md5('200') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1002\|\|201') | md5('1002') | md5('201') | 2018-06-01 12:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 12:00:00.000 | 2018-06-01 12:00:00.000 | * | | ||
| md5('1003\|\|300') | md5('1003') | md5('300') | 2018-06-01 00:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 00:00:00.000 | 2018-06-01 00:00:00.000 | * | | ||
| md5('1003\|\|301') | md5('1003') | md5('301') | 2018-06-01 12:00:00.000 | 9999-12-31 23:59:59.999 | 2018-06-01 12:00:00.000 | 2018-06-01 12:00:00.000 | * | | ||
Then the BRIDGE_CUSTOMER_ORDER table should contain expected data | ||
| CUSTOMER_PK | AS_OF_DATE | LINK_CUSTOMER_ORDER_PK | | ||
| md5('1001') | 2018-06-01 00:00:00.000 | md5('1001\|\|100') | | ||
| md5('1002') | 2018-06-01 00:00:00.000 | md5('1002\|\|200') | | ||
| md5('1003') | 2018-06-01 00:00:00.000 | md5('1003\|\|300') | | ||
| md5('1001') | 2018-06-02 00:00:00.000 | md5('1001\|\|100') | | ||
| md5('1002') | 2018-06-02 00:00:00.000 | md5('1002\|\|200') | | ||
| md5('1002') | 2018-06-02 00:00:00.000 | md5('1002\|\|201') | | ||
| md5('1003') | 2018-06-02 00:00:00.000 | md5('1003\|\|300') | | ||
| md5('1003') | 2018-06-02 00:00:00.000 | md5('1003\|\|301') | |
Oops, something went wrong.