From 9c3a261932098bebe53acfccbf27be3a8ca6ebe0 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 14 Apr 2022 11:02:38 -0500 Subject: [PATCH 1/4] bump expectorate so we get the pretty diff --- Cargo.lock | 21 ++++++++++++--------- common/Cargo.toml | 2 +- gateway/Cargo.toml | 2 +- internal-dns/Cargo.toml | 2 +- nexus/Cargo.toml | 2 +- oximeter/collector/Cargo.toml | 2 +- sled-agent/Cargo.toml | 2 +- test-utils/Cargo.toml | 2 +- 8 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee3c4698838..b52236c21de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -433,7 +433,9 @@ dependencies = [ "encode_unicode", "libc", "once_cell", + "regex", "terminal_size", + "unicode-width", "winapi", ] @@ -877,12 +879,6 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" -[[package]] -name = "difference" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" - [[package]] name = "difflib" version = "0.4.0" @@ -1169,12 +1165,13 @@ dependencies = [ [[package]] name = "expectorate" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804d601ea8a13ddbecf5ab4b6cf75b5d6d0539479c6fb2aea1596e352a5ee27e" +checksum = "5d9b457178b54cf0321a39fb6643ad7b9c705cf483ad4fb6d6092054e9ce839e" dependencies = [ - "difference", + "console", "newline-converter", + "similar", ] [[package]] @@ -4076,6 +4073,12 @@ dependencies = [ "rand_core 0.6.3", ] +[[package]] +name = "similar" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3" + [[package]] name = "siphasher" version = "0.3.10" diff --git a/common/Cargo.toml b/common/Cargo.toml index f7f495ecbce..a15d357e866 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -35,6 +35,6 @@ parse-display = "0.5.4" progenitor = { git = "https://github.com/oxidecomputer/progenitor" } [dev-dependencies] -expectorate = "1.0.4" +expectorate = "1.0.5" serde_urlencoded = "0.7.1" tokio = { version = "1.17", features = [ "test-util" ] } diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index 15de1b0ced4..14242cf69e1 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -31,7 +31,7 @@ version = "1.16" features = [ "full" ] [dev-dependencies] -expectorate = "1.0.4" +expectorate = "1.0.5" http = "0.2.5" omicron-test-utils = { path = "../test-utils" } openapi-lint = { git = "https://github.com/oxidecomputer/openapi-lint", branch = "main" } diff --git a/internal-dns/Cargo.toml b/internal-dns/Cargo.toml index 6abe17b75f0..995c7b0fbb5 100644 --- a/internal-dns/Cargo.toml +++ b/internal-dns/Cargo.toml @@ -25,7 +25,7 @@ trust-dns-proto = "0.21" trust-dns-server = "0.21" [dev-dependencies] -expectorate = "1.0.4" +expectorate = "1.0.5" internal-dns-client = { path = "../internal-dns-client" } omicron-test-utils = { path = "../test-utils" } openapiv3 = "1.0" diff --git a/nexus/Cargo.toml b/nexus/Cargo.toml index 102cb078beb..dbd52ef6699 100644 --- a/nexus/Cargo.toml +++ b/nexus/Cargo.toml @@ -117,7 +117,7 @@ features = [ "serde", "v4" ] [dev-dependencies] criterion = { version = "0.3", features = [ "async_tokio" ] } -expectorate = "1.0.4" +expectorate = "1.0.5" nexus-test-utils-macros = { path = "test-utils-macros" } nexus-test-utils = { path = "test-utils" } omicron-test-utils = { path = "../test-utils" } diff --git a/oximeter/collector/Cargo.toml b/oximeter/collector/Cargo.toml index a14cbd42a92..3e1886545a3 100644 --- a/oximeter/collector/Cargo.toml +++ b/oximeter/collector/Cargo.toml @@ -22,7 +22,7 @@ toml = "0.5.8" uuid = { version = "0.8.2", features = [ "v4", "serde" ] } [dev-dependencies] -expectorate = "1.0.4" +expectorate = "1.0.5" omicron-test-utils = { path = "../../test-utils" } openapiv3 = "1.0" serde_json = "1.0.79" diff --git a/sled-agent/Cargo.toml b/sled-agent/Cargo.toml index 6cc2069fbeb..c557ad53e0b 100644 --- a/sled-agent/Cargo.toml +++ b/sled-agent/Cargo.toml @@ -46,7 +46,7 @@ vsss-rs = { version = "2.0.0-pre0", default-features = false, features = ["std"] zone = "0.1" [dev-dependencies] -expectorate = "1.0.4" +expectorate = "1.0.5" http = "0.2.5" mockall = "0.11" omicron-test-utils = { path = "../test-utils" } diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index ce7a211fc69..0ba8001feef 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -37,7 +37,7 @@ version = "0.7" features = [ "with-chrono-0_4", "with-uuid-0_8" ] [dev-dependencies] -expectorate = "1.0.4" +expectorate = "1.0.5" # Disable doc builds by default for our binaries to work around issue # rust-lang/cargo#8373. These docs would not be very useful anyway. From 283f69f1cf200cf502c7e97af3bfdeea730cadce Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 14 Apr 2022 11:07:54 -0500 Subject: [PATCH 2/4] trigger OpenAPI spec test failure to see diff --- nexus/src/external_api/http_entrypoints.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index ad24c4b7484..9f87dca0e0d 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -1806,7 +1806,7 @@ async fn project_vpcs_get_vpc( apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } -/// Create a VPC in a project. +/// Create a VPC in a project. This will cause a failure in the OpenAPI spec test. #[endpoint { method = POST, path = "/organizations/{organization_name}/projects/{project_name}/vpcs", From 8d560b7ac5e63a9ab58d80d9db564b791e05d8f5 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 14 Apr 2022 12:03:15 -0500 Subject: [PATCH 3/4] Revert "trigger OpenAPI spec test failure to see diff" This reverts commit 283f69f1cf200cf502c7e97af3bfdeea730cadce. --- nexus/src/external_api/http_entrypoints.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index 9f87dca0e0d..ad24c4b7484 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -1806,7 +1806,7 @@ async fn project_vpcs_get_vpc( apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } -/// Create a VPC in a project. This will cause a failure in the OpenAPI spec test. +/// Create a VPC in a project. #[endpoint { method = POST, path = "/organizations/{organization_name}/projects/{project_name}/vpcs", From f0df9da84bda3d35060447548f3428f5627e8776 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 14 Apr 2022 14:26:14 -0500 Subject: [PATCH 4/4] please just run the tests --- nexus/src/external_api/console_api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexus/src/external_api/console_api.rs b/nexus/src/external_api/console_api.rs index 24b53515263..026521608db 100644 --- a/nexus/src/external_api/console_api.rs +++ b/nexus/src/external_api/console_api.rs @@ -62,7 +62,7 @@ pub async fn spoof_login( return Ok(Response::builder() .status(StatusCode::UNAUTHORIZED) .header(header::SET_COOKIE, clear_session_cookie_header_value()) - .body("".into())?); // TODO: failed login response body? + .body("unauthorized".into())?); // TODO: failed login response body? } let user_id = user_id.unwrap();