Skip to content

Commit e39e189

Browse files
Expected Records to .jsonl format (#20850)
* Expected Records to `.jsonl` format * fix formatting template * remove endline * update templates * Update docs/connector-development/testing-connectors/source-acceptance-tests-reference.md Co-authored-by: Pedro S. Lopez <[email protected]> Co-authored-by: Pedro S. Lopez <[email protected]>
1 parent e5392ee commit e39e189

File tree

155 files changed

+474
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+474
-463
lines changed

airbyte-integrations/bases/source-acceptance-test/sample_files/acceptance-test-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tests:
1414
configured_catalog_path: "sample_files/configured_catalog.json"
1515
empty_streams: []
1616
expect_records:
17-
path: "integration_tests/expected_records.txt"
17+
path: "integration_tests/expected_records.jsonl"
1818
extra_fields: no
1919
exact_order: no
2020
extra_records: yes

airbyte-integrations/bases/source-acceptance-test/unit_tests/test_global_fixtures.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def test_empty_streams_fixture(mocker, test_strictness_level, basic_read_test_co
9797
TEST_CONFIGURED_CATALOG,
9898
{EmptyStreamConfiguration(name="test_stream_b"), EmptyStreamConfiguration(name="test_stream_c")},
9999
[{"stream": "test_stream_a", "data": {"k": "foo"}, "emitted_at": 1634387507000}],
100-
ExpectedRecordsConfig(path="expected_records.json"),
100+
ExpectedRecordsConfig(path="expected_records.jsonl"),
101101
False,
102102
id="High strictness level: test_stream_b and test_stream_c are declared as empty streams, expected records only contains test_stream_a record -> Not failing",
103103
),
@@ -106,7 +106,7 @@ def test_empty_streams_fixture(mocker, test_strictness_level, basic_read_test_co
106106
TEST_CONFIGURED_CATALOG,
107107
set(),
108108
[{"stream": "test_stream_a", "data": {"k": "foo"}, "emitted_at": 1634387507000}],
109-
ExpectedRecordsConfig(path="expected_records.json"),
109+
ExpectedRecordsConfig(path="expected_records.jsonl"),
110110
True,
111111
id="High strictness level: test_stream_b and test_stream_c are not declared as empty streams, expected records only contains test_stream_a record -> Failing",
112112
),
@@ -115,7 +115,7 @@ def test_empty_streams_fixture(mocker, test_strictness_level, basic_read_test_co
115115
TEST_CONFIGURED_CATALOG,
116116
{EmptyStreamConfiguration(name="test_stream_b")},
117117
[{"stream": "test_stream_a", "data": {"k": "foo"}, "emitted_at": 1634387507000}],
118-
ExpectedRecordsConfig(path="expected_records.json"),
118+
ExpectedRecordsConfig(path="expected_records.jsonl"),
119119
True,
120120
id="High strictness level: test_stream_b is declared as an empty stream, test_stream_c is not declared as empty streams, expected records only contains test_stream_a record -> Failing",
121121
),
@@ -142,7 +142,7 @@ def test_empty_streams_fixture(mocker, test_strictness_level, basic_read_test_co
142142
TEST_CONFIGURED_CATALOG,
143143
set(),
144144
[{"stream": "test_stream_a", "data": {"k": "foo"}, "emitted_at": 1634387507000}],
145-
ExpectedRecordsConfig(path="expected_records.json"),
145+
ExpectedRecordsConfig(path="expected_records.jsonl"),
146146
False,
147147
id="Low strictness level, no empty stream, incomplete expected records -> Not failing",
148148
),
@@ -154,7 +154,7 @@ def test_expected_records_by_stream_fixture(
154154
mocker.patch.object(conftest.pytest, "fail")
155155

156156
base_path = tmp_path
157-
with open(f"{base_path}/expected_records.json", "w") as expected_records_file:
157+
with open(f"{base_path}/expected_records.jsonl", "w") as expected_records_file:
158158
for record in expected_records:
159159
expected_records_file.write(json.dumps(record) + "\n")
160160

airbyte-integrations/connector-templates/source_acceptance_test_files/acceptance-test-config.yml.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ acceptance_tests:
2121
empty_streams: []
2222
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
2323
# expect_records:
24-
# path: "integration_tests/expected_records.txt"
24+
# path: "integration_tests/expected_records.jsonl"
2525
# extra_fields: no
2626
# exact_order: no
2727
# extra_records: yes

airbyte-integrations/connectors/source-activecampaign/acceptance-test-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tests:
1717
empty_streams: []
1818
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
1919
# expect_records:
20-
# path: "integration_tests/expected_records.txt"
20+
# path: "integration_tests/expected_records.jsonl"
2121
# extra_fields: no
2222
# exact_order: no
2323
# extra_records: yes

airbyte-integrations/connectors/source-aha/acceptance-test-config.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ acceptance_tests:
1919
- config_path: "secrets/config.json"
2020
configured_catalog_path: "integration_tests/configured_catalog.json"
2121
empty_streams: []
22-
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
23-
# expect_records:
24-
# path: "integration_tests/expected_records.txt"
25-
# extra_fields: no
26-
# exact_order: no
27-
# extra_records: yes
28-
incremental:
22+
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
23+
# expect_records:
24+
# path: "integration_tests/expected_records.jsonl"
25+
# extra_fields: no
26+
# exact_order: no
27+
# extra_records: yes
28+
incremental:
2929
bypass_reason: "This connector does not implement incremental sync"
30-
# TODO uncomment this block this block if your connector implements incremental sync:
31-
# tests:
32-
# - config_path: "secrets/config.json"
33-
# configured_catalog_path: "integration_tests/configured_catalog.json"
34-
# future_state_path: "integration_tests/abnormal_state.json"
30+
# TODO uncomment this block this block if your connector implements incremental sync:
31+
# tests:
32+
# - config_path: "secrets/config.json"
33+
# configured_catalog_path: "integration_tests/configured_catalog.json"
34+
# future_state_path: "integration_tests/abnormal_state.json"
3535
full_refresh:
3636
tests:
3737
- config_path: "secrets/config.json"

airbyte-integrations/connectors/source-amazon-ads/acceptance-test-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tests:
1515
- config_path: "secrets/config.json"
1616
configured_catalog_path: "integration_tests/configured_catalog.json"
1717
expect_records:
18-
path: "integration_tests/expected_records.txt"
18+
path: "integration_tests/expected_records.jsonl"
1919
extra_fields: no
2020
exact_order: no
2121
extra_records: no
@@ -47,4 +47,4 @@ tests:
4747
configured_catalog_path: "integration_tests/configured_catalog_report.json"
4848
ignored_fields:
4949
"sponsored_products_report_stream": ["updatedAt"]
50-
timeout_seconds: 3600
50+
timeout_seconds: 3600

airbyte-integrations/connectors/source-amazon-sqs/acceptance-test-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tests:
1616
configured_catalog_path: "integration_tests/configured_catalog.json"
1717
empty_streams: []
1818
# expect_records:
19-
# path: "integration_tests/expected_records.txt"
19+
# path: "integration_tests/expected_records.jsonl"
2020
# extra_fields: no
2121
# exact_order: no
2222
# extra_records: yes

airbyte-integrations/connectors/source-appsflyer/acceptance-test-config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ tests:
1515
- config_path: "secrets/config.json"
1616
configured_catalog_path: "integration_tests/configured_catalog.json"
1717
empty_streams: []
18-
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
19-
# expect_records:
20-
# path: "integration_tests/expected_records.txt"
21-
# extra_fields: no
22-
# exact_order: no
23-
# extra_records: yes
18+
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
19+
# expect_records:
20+
# path: "integration_tests/expected_records.jsonl"
21+
# extra_fields: no
22+
# exact_order: no
23+
# extra_records: yes
2424
incremental: # TODO if your connector does not implement incremental sync, remove this block
2525
- config_path: "secrets/config.json"
2626
configured_catalog_path: "integration_tests/configured_catalog.json"

0 commit comments

Comments
 (0)