-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CLI tests with snapshots to generate_shapshots.py
The new saved query CLI tests rely on snapshot generation, but the generate snapshot script will not update them and so our engine tests are difficult to maintain. This adds the relevant tests to the update list and generates the associated snapshot files by way of illustrating that everything works. We might consider moving to a pytest.mark attribute for the modules and test cases that rely on snapshots, but for the time being the list of test paths seems fine.
- Loading branch information
Showing
13 changed files
with
99 additions
and
5 deletions.
There are no files selected for viewing
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
11 changes: 11 additions & 0 deletions
11
metricflow/test/snapshots/test_cli.py/str/BigQuery/test_saved_query__cli_output.txt
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,11 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-01 00:00:00 | 4 | 2 | 1 | | ||
| 2020-01-02 00:00:00 | 4 | 3 | 3 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-18 00:00:00 | 4 | 4 | 2 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-19 00:00:00 | 4 | 6 | 6 | | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | |
5 changes: 5 additions & 0 deletions
5
...cflow/test/snapshots/test_cli.py/str/BigQuery/test_saved_query_with_limit__cli_output.txt
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,5 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-01 00:00:00 | 4 | 2 | 1 | | ||
| 2020-01-02 00:00:00 | 4 | 3 | 3 | |
7 changes: 7 additions & 0 deletions
7
...cflow/test/snapshots/test_cli.py/str/BigQuery/test_saved_query_with_where__cli_output.txt
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,7 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | |
11 changes: 11 additions & 0 deletions
11
metricflow/test/snapshots/test_cli.py/str/Databricks/test_saved_query__cli_output.txt
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,11 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------------|---------------------------:|-----------:|-------------------:| | ||
| 2020-01-02 00:00:00+00:00 | 5 | 1 | 0 | | ||
| 2019-12-19 00:00:00+00:00 | 4 | 6 | 6 | | ||
| 2019-12-01 00:00:00+00:00 | 5 | 1 | 0 | | ||
| 2019-12-20 00:00:00+00:00 | 5 | 2 | 0 | | ||
| 2019-12-19 00:00:00+00:00 | 5 | 2 | 0 | | ||
| 2019-12-18 00:00:00+00:00 | 4 | 4 | 2 | | ||
| 2020-01-02 00:00:00+00:00 | 4 | 3 | 3 | | ||
| 2020-01-03 00:00:00+00:00 | 5 | 1 | 0 | | ||
| 2020-01-01 00:00:00+00:00 | 4 | 2 | 1 | |
5 changes: 5 additions & 0 deletions
5
...low/test/snapshots/test_cli.py/str/Databricks/test_saved_query_with_limit__cli_output.txt
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,5 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------------|---------------------------:|-----------:|-------------------:| | ||
| 2020-01-02 00:00:00+00:00 | 5 | 1 | 0 | | ||
| 2019-12-19 00:00:00+00:00 | 4 | 6 | 6 | | ||
| 2019-12-01 00:00:00+00:00 | 5 | 1 | 0 | |
7 changes: 7 additions & 0 deletions
7
...low/test/snapshots/test_cli.py/str/Databricks/test_saved_query_with_where__cli_output.txt
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,7 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------------|---------------------------:|-----------:|-------------------:| | ||
| 2020-01-02 00:00:00+00:00 | 5 | 1 | 0 | | ||
| 2019-12-01 00:00:00+00:00 | 5 | 1 | 0 | | ||
| 2019-12-20 00:00:00+00:00 | 5 | 2 | 0 | | ||
| 2019-12-19 00:00:00+00:00 | 5 | 2 | 0 | | ||
| 2020-01-03 00:00:00+00:00 | 5 | 1 | 0 | |
11 changes: 11 additions & 0 deletions
11
metricflow/test/snapshots/test_cli.py/str/Redshift/test_saved_query__cli_output.txt
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,11 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-19 00:00:00 | 4 | 6 | 6 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-02 00:00:00 | 4 | 3 | 3 | | ||
| 2020-01-01 00:00:00 | 4 | 2 | 1 | | ||
| 2019-12-18 00:00:00 | 4 | 4 | 2 | |
5 changes: 5 additions & 0 deletions
5
...cflow/test/snapshots/test_cli.py/str/Redshift/test_saved_query_with_limit__cli_output.txt
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,5 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | |
7 changes: 7 additions & 0 deletions
7
...cflow/test/snapshots/test_cli.py/str/Redshift/test_saved_query_with_where__cli_output.txt
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,7 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | |
11 changes: 11 additions & 0 deletions
11
metricflow/test/snapshots/test_cli.py/str/Snowflake/test_saved_query__cli_output.txt
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,11 @@ | ||
| METRIC_TIME__DAY | LISTING__CAPACITY_LATEST | BOOKINGS | INSTANT_BOOKINGS | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-18 00:00:00 | 4 | 4 | 2 | | ||
| 2019-12-19 00:00:00 | 4 | 6 | 6 | | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | | ||
| 2020-01-01 00:00:00 | 4 | 2 | 1 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-02 00:00:00 | 4 | 3 | 3 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | |
5 changes: 5 additions & 0 deletions
5
...flow/test/snapshots/test_cli.py/str/Snowflake/test_saved_query_with_limit__cli_output.txt
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,5 @@ | ||
| METRIC_TIME__DAY | LISTING__CAPACITY_LATEST | BOOKINGS | INSTANT_BOOKINGS | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-18 00:00:00 | 4 | 4 | 2 | | ||
| 2019-12-19 00:00:00 | 4 | 6 | 6 | |
7 changes: 7 additions & 0 deletions
7
...flow/test/snapshots/test_cli.py/str/Snowflake/test_saved_query_with_where__cli_output.txt
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,7 @@ | ||
| METRIC_TIME__DAY | LISTING__CAPACITY_LATEST | BOOKINGS | INSTANT_BOOKINGS | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | |