From 1e40a58e788c81bec7ed20fb131fcdb197b17c57 Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 25 Sep 2022 17:14:12 -0400 Subject: [PATCH] Upgrade insta dependency Update insta, and updates a failing test due to breaking serialization change. Issue for the serialization change: https://github.com/mitsuhiko/insta/issues/290 --- Cargo.lock | 8 +-- Cargo.toml | 2 +- ...ations__publication_data_operations-2.snap | 28 ++++++--- ..._discovers__tests__response_swizzling.snap | 4 +- ...nel__test__extended_endpoint_schema-2.snap | 21 +------ ...unnel__test__extended_endpoint_schema.snap | 60 +------------------ ...erive__pipeline__test__pipeline_stats.snap | 5 +- 7 files changed, 33 insertions(+), 95 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec460cc9ec..71654406f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1715,18 +1715,18 @@ dependencies = [ [[package]] name = "insta" -version = "1.14.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "689960f187c43c01650c805fb6bc6f55ab944499d86d4ffe9474ad78991d8e94" +checksum = "58a931b01c76064c5be919faa2ef0dc570e9a889dcd1e5fef08a8ca6eb4d6c0b" dependencies = [ "console", + "linked-hash-map", "once_cell", "pest", "pest_derive", "serde", - "serde_json", - "serde_yaml", "similar", + "yaml-rust", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f02e46fc09..57d5c89ea4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,7 +104,7 @@ zstd = "0.11.2" # Used exclusively as dev-dependencies assert_cmd = "2.0" # TODO: upgrade insta. Version 1.15 seems to contain a breaking change to the serialization of RawValue, so holding off until I can confirm that's all it is. -insta = { version = "1.14.0", features = ["redactions"]} +insta = { version = "1.20", features = ["redactions", "json", "yaml"]} criterion = "0.3" glob = "0.3" diff --git a/crates/agent-sql/tests/snapshots/publications__publication_data_operations-2.snap b/crates/agent-sql/tests/snapshots/publications__publication_data_operations-2.snap index 2f30a7fab1..26be5da405 100644 --- a/crates/agent-sql/tests/snapshots/publications__publication_data_operations-2.snap +++ b/crates/agent-sql/tests/snapshots/publications__publication_data_operations-2.snap @@ -5,13 +5,17 @@ expression: resolved [ { "catalog_name": "aliceCo/First/Thing", - "draft_spec": 2, + "draft_spec": { + "$serde_json::private::RawValue": "2" + }, "draft_spec_id": "1100000000000000", "draft_type": "Collection", "expect_pub_id": null, "last_build_id": "bbbbbbbbbbbbbbbb", "last_pub_id": "bbbbbbbbbbbbbbbb", - "live_spec": 1, + "live_spec": { + "$serde_json::private::RawValue": "1" + }, "live_spec_id": "", "live_type": "Collection", "spec_capabilities": [ @@ -41,7 +45,9 @@ expression: resolved "expect_pub_id": null, "last_build_id": "bbbbbbbbbbbbbbbb", "last_pub_id": "bbbbbbbbbbbbbbbb", - "live_spec": 1, + "live_spec": { + "$serde_json::private::RawValue": "1" + }, "live_spec_id": "", "live_type": "Collection", "spec_capabilities": [ @@ -65,13 +71,17 @@ expression: resolved }, { "catalog_name": "aliceCo/Test/Fixture", - "draft_spec": 2, + "draft_spec": { + "$serde_json::private::RawValue": "2" + }, "draft_spec_id": "5500000000000000", "draft_type": "Test", "expect_pub_id": null, "last_build_id": "bbbbbbbbbbbbbbbb", "last_pub_id": "bbbbbbbbbbbbbbbb", - "live_spec": 1, + "live_spec": { + "$serde_json::private::RawValue": "1" + }, "live_spec_id": "", "live_type": "Test", "spec_capabilities": [ @@ -95,7 +105,9 @@ expression: resolved }, { "catalog_name": "aliceCo/New/Thing", - "draft_spec": 2, + "draft_spec": { + "$serde_json::private::RawValue": "2" + }, "draft_spec_id": "3300000000000000", "draft_type": "Collection", "expect_pub_id": null, @@ -125,7 +137,9 @@ expression: resolved }, { "catalog_name": "otherCo/Not/AliceCo", - "draft_spec": 2, + "draft_spec": { + "$serde_json::private::RawValue": "2" + }, "draft_spec_id": "4400000000000000", "draft_type": "Collection", "expect_pub_id": null, diff --git a/crates/agent/src/snapshots/agent__discovers__tests__response_swizzling.snap b/crates/agent/src/snapshots/agent__discovers__tests__response_swizzling.snap index d76e3c5822..c58d6dc031 100644 --- a/crates/agent/src/snapshots/agent__discovers__tests__response_swizzling.snap +++ b/crates/agent/src/snapshots/agent__discovers__tests__response_swizzling.snap @@ -46,7 +46,9 @@ expression: catalog "endpoint": { "connector": { "image": "ghcr.io/foo/bar/source-potato:v1.2.3", - "config": {"some":"config"} + "config": { + "$serde_json::private::RawValue": "{\"some\":\"config\"}" + } } }, "bindings": [ diff --git a/crates/connector_proxy/src/libs/snapshots/flow_connector_proxy__libs__network_tunnel__test__extended_endpoint_schema-2.snap b/crates/connector_proxy/src/libs/snapshots/flow_connector_proxy__libs__network_tunnel__test__extended_endpoint_schema-2.snap index 88807dff62..76878e152d 100644 --- a/crates/connector_proxy/src/libs/snapshots/flow_connector_proxy__libs__network_tunnel__test__extended_endpoint_schema-2.snap +++ b/crates/connector_proxy/src/libs/snapshots/flow_connector_proxy__libs__network_tunnel__test__extended_endpoint_schema-2.snap @@ -1,26 +1,7 @@ --- source: crates/connector_proxy/src/libs/network_tunnel.rs -assertion_line: 156 expression: "NetworkTunnel::extend_endpoint_schema(schema).unwrap()" --- { - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Generic Database Connection Spec", - "type": "object", - "required": [ - "credentials", - "hostname" - ], - "properties": { - "credentials": { - "description": "Some login credentials or something.", - "type": "string", - "secret": true - }, - "hostname": { - "title": "Server Hostname", - "description": "The hostname at which the server can be reached.", - "type": "string" - } - } + "$serde_json::private::RawValue": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"title\": \"Generic Database Connection Spec\",\n \"type\": \"object\",\n \"required\": [\n \"credentials\",\n \"hostname\"\n ],\n \"properties\": {\n \"credentials\": {\n \"description\": \"Some login credentials or something.\",\n \"type\": \"string\",\n \"secret\": true\n },\n \"hostname\": {\n \"title\": \"Server Hostname\",\n \"description\": \"The hostname at which the server can be reached.\",\n \"type\": \"string\"\n }\n }\n}" } diff --git a/crates/connector_proxy/src/libs/snapshots/flow_connector_proxy__libs__network_tunnel__test__extended_endpoint_schema.snap b/crates/connector_proxy/src/libs/snapshots/flow_connector_proxy__libs__network_tunnel__test__extended_endpoint_schema.snap index 1c770dcb56..f1c4c6de12 100644 --- a/crates/connector_proxy/src/libs/snapshots/flow_connector_proxy__libs__network_tunnel__test__extended_endpoint_schema.snap +++ b/crates/connector_proxy/src/libs/snapshots/flow_connector_proxy__libs__network_tunnel__test__extended_endpoint_schema.snap @@ -1,65 +1,7 @@ --- source: crates/connector_proxy/src/libs/network_tunnel.rs -assertion_line: 160 expression: "NetworkTunnel::extend_endpoint_schema(schema).unwrap()" --- { - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Generic Database Connection Spec", - "type": "object", - "required": [ - "address", - "credentials" - ], - "properties": { - "address": { - "title": "Server Address", - "description": "The host or host:port at which the database can be reached.", - "type": "string" - }, - "credentials": { - "description": "Some login credentials or something.", - "type": "string", - "secret": true - }, - "networkTunnel": { - "title": "Network Tunneling", - "description": "Setup a network tunnel to access systems on a private network", - "oneOf": [ - { - "title": "SSH Forwarding", - "type": "object", - "properties": { - "sshForwarding": { - "title": "SSH Tunnel", - "description": "Connect to your system through an SSH server that acts as a bastion host for your network.", - "type": "object", - "required": [ - "privateKey", - "sshEndpoint" - ], - "properties": { - "privateKey": { - "title": "SSH Private Key", - "description": "Private key to connect to the remote SSH server.", - "type": "string", - "multiline": true, - "secret": true - }, - "sshEndpoint": { - "description": "Endpoint of the remote SSH server that supports tunneling, in the form of ssh://user@hostname[:port]", - "type": "string" - } - } - } - } - }, - { - "title": "Disabled", - "type": "null" - } - ], - "advanced": true - } - } + "$serde_json::private::RawValue": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"title\": \"Generic Database Connection Spec\",\n \"type\": \"object\",\n \"required\": [\n \"address\",\n \"credentials\"\n ],\n \"properties\": {\n \"address\": {\n \"title\": \"Server Address\",\n \"description\": \"The host or host:port at which the database can be reached.\",\n \"type\": \"string\"\n },\n \"credentials\": {\n \"description\": \"Some login credentials or something.\",\n \"type\": \"string\",\n \"secret\": true\n },\n \"networkTunnel\": {\n \"title\": \"Network Tunneling\",\n \"description\": \"Setup a network tunnel to access systems on a private network\",\n \"oneOf\": [\n {\n \"title\": \"SSH Forwarding\",\n \"type\": \"object\",\n \"properties\": {\n \"sshForwarding\": {\n \"title\": \"SSH Tunnel\",\n \"description\": \"Connect to your system through an SSH server that acts as a bastion host for your network.\",\n \"type\": \"object\",\n \"required\": [\n \"privateKey\",\n \"sshEndpoint\"\n ],\n \"properties\": {\n \"privateKey\": {\n \"title\": \"SSH Private Key\",\n \"description\": \"Private key to connect to the remote SSH server.\",\n \"type\": \"string\",\n \"multiline\": true,\n \"secret\": true\n },\n \"sshEndpoint\": {\n \"description\": \"Endpoint of the remote SSH server that supports tunneling, in the form of ssh://user@hostname[:port]\",\n \"type\": \"string\"\n }\n }\n }\n }\n },\n {\n \"title\": \"Disabled\",\n \"type\": \"null\"\n }\n ],\n \"advanced\": true\n }\n }\n}" } diff --git a/crates/derive/src/pipeline/snapshots/derive__pipeline__test__pipeline_stats.snap b/crates/derive/src/pipeline/snapshots/derive__pipeline__test__pipeline_stats.snap index 723b1aea01..f464b667e6 100644 --- a/crates/derive/src/pipeline/snapshots/derive__pipeline__test__pipeline_stats.snap +++ b/crates/derive/src/pipeline/snapshots/derive__pipeline__test__pipeline_stats.snap @@ -1,6 +1,5 @@ --- source: crates/derive/src/pipeline/mod.rs -assertion_line: 590 expression: actual --- - input: {} @@ -8,7 +7,7 @@ expression: actual output: docs: 6 bytes: 1000 - totalSeconds: 3.0 + totalSeconds: 3 publish: output: {} - input: {} @@ -25,5 +24,5 @@ expression: actual output: docs: 3 bytes: 8192 - totalSeconds: 3.0 + totalSeconds: 3