Skip to content

Commit d0c79b6

Browse files
authored
add expectorate tests to manage changes to API dependencies (#6831)
1 parent b0a88d5 commit d0c79b6

File tree

4 files changed

+114
-0
lines changed

4 files changed

+114
-0
lines changed

Cargo.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/ls-apis/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ petgraph.workspace = true
1818
serde.workspace = true
1919
toml.workspace = true
2020
omicron-workspace-hack.workspace = true
21+
22+
[dev-dependencies]
23+
expectorate.workspace = true
24+
omicron-test-utils.workspace = true
25+
subprocess.workspace = true
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Bootstrap Agent (client: bootstrap-agent-client)
2+
consumed by: omicron-sled-agent (omicron/sled-agent)
3+
consumed by: wicketd (omicron/wicketd)
4+
5+
Clickhouse Cluster Admin (client: clickhouse-admin-client)
6+
consumed by: omicron-nexus (omicron/nexus)
7+
8+
CockroachDB Cluster Admin (client: cockroach-admin-client)
9+
consumed by: omicron-nexus (omicron/nexus)
10+
11+
Crucible Agent (client: crucible-agent-client)
12+
consumed by: omicron-nexus (omicron/nexus)
13+
14+
Crucible Control (for testing only) (client: crucible-control-client)
15+
16+
Crucible Pantry (client: crucible-pantry-client)
17+
consumed by: omicron-nexus (omicron/nexus)
18+
19+
Maghemite DDM Admin (client: ddm-admin-client)
20+
consumed by: installinator (omicron/installinator)
21+
consumed by: mgd (maghemite/mgd)
22+
consumed by: omicron-sled-agent (omicron/sled-agent)
23+
consumed by: wicketd (omicron/wicketd)
24+
25+
DNS Server (client: dns-service-client)
26+
consumed by: omicron-nexus (omicron/nexus)
27+
consumed by: omicron-sled-agent (omicron/sled-agent)
28+
29+
Dendrite DPD (client: dpd-client)
30+
consumed by: ddmd (maghemite/ddmd)
31+
consumed by: mgd (maghemite/mgd)
32+
consumed by: omicron-nexus (omicron/nexus)
33+
consumed by: omicron-sled-agent (omicron/sled-agent)
34+
consumed by: tfportd (dendrite/tfportd)
35+
consumed by: wicketd (omicron/wicketd)
36+
37+
Downstairs Controller (debugging only) (client: dsc-client)
38+
39+
Management Gateway Service (client: gateway-client)
40+
consumed by: dpd (dendrite/dpd)
41+
consumed by: omicron-nexus (omicron/nexus)
42+
consumed by: omicron-sled-agent (omicron/sled-agent)
43+
consumed by: wicketd (omicron/wicketd)
44+
45+
Wicketd Installinator (client: installinator-client)
46+
consumed by: installinator (omicron/installinator)
47+
48+
Maghemite MG Admin (client: mg-admin-client)
49+
consumed by: omicron-nexus (omicron/nexus)
50+
consumed by: omicron-sled-agent (omicron/sled-agent)
51+
52+
Nexus Internal API (client: nexus-client)
53+
consumed by: dpd (dendrite/dpd)
54+
consumed by: omicron-nexus (omicron/nexus)
55+
consumed by: omicron-sled-agent (omicron/sled-agent)
56+
consumed by: oximeter-collector (omicron/oximeter/collector)
57+
consumed by: propolis-server (propolis/bin/propolis-server)
58+
59+
External API (client: oxide-client)
60+
61+
Oximeter (client: oximeter-client)
62+
consumed by: omicron-nexus (omicron/nexus)
63+
64+
Propolis (client: propolis-client)
65+
consumed by: omicron-nexus (omicron/nexus)
66+
consumed by: omicron-sled-agent (omicron/sled-agent)
67+
68+
Crucible Repair (client: repair-client)
69+
consumed by: crucible-downstairs (crucible/downstairs)
70+
71+
Sled Agent (client: sled-agent-client)
72+
consumed by: dpd (dendrite/dpd)
73+
consumed by: omicron-nexus (omicron/nexus)
74+
consumed by: omicron-sled-agent (omicron/sled-agent)
75+
76+
Wicketd (client: wicketd-client)
77+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
//! The tests here are intended help us catch cases where we're introducing new
6+
//! API dependencies, and particular circular API dependencies. It's okay if
7+
//! API dependencies change, but it's important to make sure we're not
8+
//! introducing new barriers to online upgrade.
9+
//!
10+
//! This isn't (supposed to be) a test for the `ls-apis` tool itself.
11+
12+
use omicron_test_utils::dev::test_cmds::assert_exit_code;
13+
use omicron_test_utils::dev::test_cmds::path_to_executable;
14+
use omicron_test_utils::dev::test_cmds::run_command;
15+
use omicron_test_utils::dev::test_cmds::EXIT_SUCCESS;
16+
17+
/// name of the "ls-apis" executable
18+
const CMD_LS_APIS: &str = env!("CARGO_BIN_EXE_ls-apis");
19+
20+
#[test]
21+
fn test_api_dependencies() {
22+
let cmd_path = path_to_executable(CMD_LS_APIS);
23+
let exec = subprocess::Exec::cmd(cmd_path).arg("apis");
24+
let (exit_status, stdout_text, stderr_text) = run_command(exec);
25+
assert_exit_code(exit_status, EXIT_SUCCESS, &stderr_text);
26+
27+
println!("stderr:\n------\n{}\n-----", stderr_text);
28+
expectorate::assert_contents("tests/api_dependencies.out", &stdout_text);
29+
}

0 commit comments

Comments
 (0)