Skip to content

Commit

Permalink
Source Mixpanel: enable high test strictness level in SAT (#21510)
Browse files Browse the repository at this point in the history
* Enable high test strictness

* Updated expected_records.jsonl

* Updated expected records

* Increased timeout

* Updated abnormal state

* Updated cursor_path

* Updated acceptance tests config
  • Loading branch information
lazebnyi authored Jan 25, 2023
1 parent 0e3d2ba commit 6801049
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 73 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-mixpanel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integrat
Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named.
First install test dependencies into your virtual environment:
```
pip install .[tests]
pip install .'[tests]'
```
### Unit Tests
To run unit tests locally, from the connector directory run:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,49 @@
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-mixpanel:dev
tests:
test_strictness_level: "high"
acceptance_tests:
spec:
- spec_path: "source_mixpanel/spec.json"
backward_compatibility_tests_config:
disable_for_version: "0.1.23"
tests:
- spec_path: "source_mixpanel/spec.json"
connection:
- config_path: "secrets/config_old.json"
status: "succeed"
- config_path: "secrets/config_project_secret.json"
status: "succeed"
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
tests:
- config_path: "secrets/config_old.json"
status: "succeed"
- config_path: "secrets/config_project_secret.json"
status: "succeed"
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
discovery:
- config_path: "secrets/config.json"
backward_compatibility_tests_config:
disable_for_version: "0.1.23"
timeout_seconds: 60
tests:
- config_path: "secrets/config_old.json"
timeout_seconds: 60
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
timeout_seconds: 3600
empty_streams: ['export', 'annotations']
tests:
- config_path: "secrets/config.json"
timeout_seconds: 9000
expect_records:
path: "integration_tests/expected_records.jsonl"
extra_fields: no
exact_order: no
extra_records: yes
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
timeout_seconds: 3600
tests:
- config_path: "secrets/config_old.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
timeout_seconds: 9000
incremental:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
future_state_path: "integration_tests/abnormal_state.json"
cursor_paths:
cohorts: ["created"]
export: ["time"]
funnels: ["8901755", "date"]
revenue: ["date"]
cohort_members": ["last_seen"]
timeout_seconds: 3600
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog_incremental.json"
future_state:
future_state_path: "integration_tests/abnormal_state.json"
cursor_paths:
cohorts: ["created"]
export: ["time"]
funnels: ["36152117", "date"]
revenue: ["date"]
cohort_members": ["last_seen"]
timeout_seconds: 9000
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"type": "STREAM",
"stream": {
"stream_state": { "8901755": { "date": "2030-01-01" } },
"stream_state": { "36152117": { "date": "2030-01-01" } },
"stream_descriptor": { "name": "funnels" }
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@
"stream": {
"name": "funnels",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["funnel_id"], ["date"]]
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "engage",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["last_seen"],
"source_defined_primary_key": [["distinct_id"]]
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["last_seen"]
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
Expand All @@ -38,49 +31,37 @@
"stream": {
"name": "export",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["time"]
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "cohorts",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created"],
"source_defined_primary_key": [["id"]]
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "cohort_members",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["last_seen"],
"source_defined_primary_key": [["distinct_id"]]
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["last_seen"]
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "revenue",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["date"]]
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"streams": [
{
"stream": {
"name": "funnels",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["date"],
"source_defined_primary_key": [["funnel_id"], ["date"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "export",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["time"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "cohorts",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["created"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "cohort_members",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": false,
"default_cursor_field": ["last_seen"],
"source_defined_primary_key": [["distinct_id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["last_seen"]
}
]
}
Loading

0 comments on commit 6801049

Please sign in to comment.