Skip to content

Commit

Permalink
Make it as hard as possible for tests to run ensure_seed_tarball_exists
Browse files Browse the repository at this point in the history
Created using spr 1.3.4
  • Loading branch information
sunshowers committed Oct 5, 2023
2 parents 9f7bddd + c76ca69 commit 5e7528c
Show file tree
Hide file tree
Showing 44 changed files with 311 additions and 115 deletions.
4 changes: 3 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ nextest-version = { required = "0.9.59", recommended = "0.9.59" }
experimental = ["setup-scripts"]

[[profile.default.scripts]]
filter = 'rdeps(nexus-test-utils)'
# Exclude omicron-dev tests from crdb-seed as we explicitly want to simulate an
# environment where the seed file doesn't exist.
filter = 'rdeps(nexus-test-utils) - package(omicron-dev)'
setup = 'crdb-seed'

[profile.ci]
Expand Down
82 changes: 41 additions & 41 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,38 @@
members = [
"api_identity",
"bootstore",
"bootstrap-agent-client",
"caboose-util",
"certificates",
"clients/bootstrap-agent-client",
"clients/ddm-admin-client",
"clients/dns-service-client",
"clients/dpd-client",
"clients/gateway-client",
"clients/installinator-artifact-client",
"clients/nexus-client",
"clients/oxide-client",
"clients/oximeter-client",
"clients/sled-agent-client",
"clients/wicketd-client",
"common",
"ddm-admin-client",
"deploy",
"dev-tools/crdb-seed",
"dev-tools/omdb",
"dev-tools/omicron-dev",
"dev-tools/thing-flinger",
"dev-tools/xtask",
"dns-server",
"dns-service-client",
"dpd-client",
"end-to-end-tests",
"gateway-cli",
"gateway-client",
"gateway-test-utils",
"gateway",
"illumos-utils",
"installinator-artifact-client",
"installinator-artifactd",
"installinator-common",
"installinator",
"internal-dns-cli",
"internal-dns",
"ipcc-key-value",
"key-manager",
"nexus-client",
"nexus",
"nexus/authz-macros",
"nexus/db-macros",
Expand All @@ -40,8 +44,6 @@ members = [
"nexus/test-utils-macros",
"nexus/test-utils",
"nexus/types",
"oxide-client",
"oximeter-client",
"oximeter/collector",
"oximeter/db",
"oximeter/instruments",
Expand All @@ -51,7 +53,6 @@ members = [
"package",
"passwords",
"rpaths",
"sled-agent-client",
"sled-agent",
"sled-hardware",
"sp-sim",
Expand All @@ -62,71 +63,70 @@ members = [
"wicket-common",
"wicket-dbg",
"wicket",
"wicketd-client",
"wicketd",
"workspace-hack",
]

default-members = [
"bootstrap-agent-client",
"bootstore",
"caboose-util",
"certificates",
"clients/bootstrap-agent-client",
"clients/ddm-admin-client",
"clients/dns-service-client",
"clients/dpd-client",
"clients/gateway-client",
"clients/installinator-artifact-client",
"clients/nexus-client",
"clients/oxide-client",
"clients/oximeter-client",
"clients/sled-agent-client",
"clients/wicketd-client",
"common",
"ddm-admin-client",
"dpd-client",
"deploy",
"dev-tools/crdb-seed",
"dev-tools/omdb",
"dev-tools/omicron-dev",
"dev-tools/thing-flinger",
"dev-tools/xtask",
"dns-server",
"dns-service-client",
"gateway",
"gateway-cli",
"gateway-client",
"gateway-test-utils",
"gateway",
"illumos-utils",
"installinator",
"installinator-artifact-client",
"installinator-artifactd",
"installinator-common",
"internal-dns",
"installinator",
"internal-dns-cli",
"internal-dns",
"ipcc-key-value",
"key-manager",
"nexus",
"nexus-client",
"nexus/authz-macros",
"nexus/db-macros",
"nexus/db-model",
"nexus/db-queries",
"nexus/defaults",
"nexus/types",
"oxide-client",
"oximeter-client",
"oximeter/collector",
"oximeter/db",
"oximeter/instruments",
"oximeter/oximeter",
"oximeter/oximeter-macro-impl",
"oximeter/oximeter",
"oximeter/producer",
"package",
"passwords",
"rpaths",
"sled-agent",
"sled-agent-client",
"sled-hardware",
"sp-sim",
"test-utils",
"tufaceous",
"tufaceous-lib",
"tufaceous",
"update-engine",
"wicket",
"wicket-common",
"wicket-dbg",
"wicket",
"wicketd",
"wicketd-client",
]
resolver = "2"

Expand All @@ -146,7 +146,7 @@ bb8 = "0.8.1"
bcs = "0.1.5"
bincode = "1.3.3"
bootstore = { path = "bootstore" }
bootstrap-agent-client = { path = "bootstrap-agent-client" }
bootstrap-agent-client = { path = "clients/bootstrap-agent-client" }
buf-list = { version = "1.0.3", features = ["tokio1"] }
byteorder = "1.4.3"
bytes = "1.5.0"
Expand All @@ -170,16 +170,16 @@ crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "20273
curve25519-dalek = "4"
datatest-stable = "0.1.3"
display-error-chain = "0.1.1"
ddm-admin-client = { path = "ddm-admin-client" }
ddm-admin-client = { path = "clients/ddm-admin-client" }
db-macros = { path = "nexus/db-macros" }
debug-ignore = "1.0.5"
derive_more = "0.99.17"
derive-where = "1.2.5"
diesel = { version = "2.1.1", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] }
diesel-dtrace = { git = "https://github.com/oxidecomputer/diesel-dtrace", branch = "main" }
dns-server = { path = "dns-server" }
dns-service-client = { path = "dns-service-client" }
dpd-client = { path = "dpd-client" }
dns-service-client = { path = "clients/dns-service-client" }
dpd-client = { path = "clients/dpd-client" }
dropshot = { git = "https://github.com/oxidecomputer/dropshot", branch = "main", features = [ "usdt-probes" ] }
either = "1.9.0"
expectorate = "1.1.0"
Expand All @@ -189,7 +189,7 @@ flume = "0.11.0"
foreign-types = "0.3.2"
fs-err = "2.9.0"
futures = "0.3.28"
gateway-client = { path = "gateway-client" }
gateway-client = { path = "clients/gateway-client" }
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "1e180ae55e56bd17af35cb868ffbd18ce487351d", default-features = false, features = ["std"] }
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "1e180ae55e56bd17af35cb868ffbd18ce487351d" }
gateway-test-utils = { path = "gateway-test-utils" }
Expand All @@ -211,7 +211,7 @@ indexmap = "2.0.0"
indicatif = { version = "0.17.6", features = ["rayon"] }
installinator = { path = "installinator" }
installinator-artifactd = { path = "installinator-artifactd" }
installinator-artifact-client = { path = "installinator-artifact-client" }
installinator-artifact-client = { path = "clients/installinator-artifact-client" }
installinator-common = { path = "installinator-common" }
internal-dns = { path = "internal-dns" }
ipcc-key-value = { path = "ipcc-key-value" }
Expand All @@ -225,7 +225,7 @@ macaddr = { version = "1.0.1", features = ["serde_std"] }
mime_guess = "2.0.4"
mockall = "0.11"
newtype_derive = "0.1.6"
nexus-client = { path = "nexus-client" }
nexus-client = { path = "clients/nexus-client" }
nexus-db-model = { path = "nexus/db-model" }
nexus-db-queries = { path = "nexus/db-queries" }
nexus-defaults = { path = "nexus/defaults" }
Expand All @@ -246,7 +246,7 @@ omicron-rpaths = { path = "rpaths" }
omicron-sled-agent = { path = "sled-agent" }
omicron-test-utils = { path = "test-utils" }
omicron-zone-package = "0.8.3"
oxide-client = { path = "oxide-client" }
oxide-client = { path = "clients/oxide-client" }
oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "98d33125413f01722947e322f82caf9d22209434", features = [ "api", "std" ] }
once_cell = "1.18.0"
openapi-lint = { git = "https://github.com/oxidecomputer/openapi-lint", branch = "main" }
Expand All @@ -259,7 +259,7 @@ opte-ioctl = { git = "https://github.com/oxidecomputer/opte", rev = "98d33125413
oso = "0.26"
owo-colors = "3.5.0"
oximeter = { path = "oximeter/oximeter" }
oximeter-client = { path = "oximeter-client" }
oximeter-client = { path = "clients/oximeter-client" }
oximeter-db = { path = "oximeter/db/" }
oximeter-collector = { path = "oximeter/collector" }
oximeter-instruments = { path = "oximeter/instruments" }
Expand Down Expand Up @@ -317,7 +317,7 @@ signal-hook = "0.3"
signal-hook-tokio = { version = "0.3", features = [ "futures-v0_3" ] }
similar-asserts = "1.5.0"
sled = "0.34"
sled-agent-client = { path = "sled-agent-client" }
sled-agent-client = { path = "clients/sled-agent-client" }
sled-hardware = { path = "sled-hardware" }
slog = { version = "2.7", features = [ "dynamic-keys", "max_level_trace", "release_max_level_debug" ] }
slog-async = "2.8"
Expand Down Expand Up @@ -372,7 +372,7 @@ usdt = "0.3"
walkdir = "2.4"
wicket = { path = "wicket" }
wicket-common = { path = "wicket-common" }
wicketd-client = { path = "wicketd-client" }
wicketd-client = { path = "clients/wicketd-client" }
zeroize = { version = "1.6.0", features = ["zeroize_derive", "std"] }
zip = { version = "0.6.6", default-features = false, features = ["deflate","bzip2"] }
zone = { version = "0.2", default-features = false, features = ["async"] }
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! Interface for making API requests to a Bootstrap Agent
progenitor::generate_api!(
spec = "../openapi/bootstrap-agent.json",
spec = "../../openapi/bootstrap-agent.json",
inner_type = slog::Logger,
pre_hook = (|log: &slog::Logger, request: &reqwest::Request| {
slog::debug!(log, "client request";
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions ddm-admin-client/build.rs → clients/ddm-admin-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ use std::path::Path;

fn main() -> Result<()> {
// Find the current maghemite repo commit from our package manifest.
let manifest = fs::read_to_string("../package-manifest.toml")
.context("failed to read ../package-manifest.toml")?;
println!("cargo:rerun-if-changed=../package-manifest.toml");
let manifest = fs::read_to_string("../../package-manifest.toml")
.context("failed to read ../../package-manifest.toml")?;
println!("cargo:rerun-if-changed=../../package-manifest.toml");

let config: Config = toml::from_str(&manifest)
.context("failed to parse ../package-manifest.toml")?;
.context("failed to parse ../../package-manifest.toml")?;
let maghemite = config
.packages
.get("maghemite")
.context("missing maghemite package in ../package-manifest.toml")?;
.context("missing maghemite package in ../../package-manifest.toml")?;

let local_path = match &maghemite.source {
PackageSource::Prebuilt { commit, .. } => {
// Report a relatively verbose error if we haven't downloaded the requisite
// openapi spec.
let local_path =
format!("../out/downloads/ddm-admin-{commit}.json");
format!("../../out/downloads/ddm-admin-{commit}.json");
if !Path::new(&local_path).exists() {
bail!("{local_path} doesn't exist; rerun `tools/ci_download_maghemite_openapi` (after updating `tools/maghemite_openapi_version` if the maghemite commit in package-manifest.toml has changed)");
}
Expand All @@ -42,7 +42,7 @@ fn main() -> Result<()> {

PackageSource::Manual => {
let local_path =
"../out/downloads/ddm-admin-manual.json".to_string();
"../../out/downloads/ddm-admin-manual.json".to_string();
if !Path::new(&local_path).exists() {
bail!("{local_path} doesn't exist, please copy manually built ddm-admin.json there!");
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

progenitor::generate_api!(
spec = "../openapi/dns-server.json",
spec = "../../openapi/dns-server.json",
inner_type = slog::Logger,
derives = [schemars::JsonSchema, Eq, PartialEq],
pre_hook = (|log: &slog::Logger, request: &reqwest::Request| {
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions dpd-client/build.rs → clients/dpd-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ use std::path::Path;

fn main() -> Result<()> {
// Find the current dendrite repo commit from our package manifest.
let manifest = fs::read_to_string("../package-manifest.toml")
.context("failed to read ../package-manifest.toml")?;
println!("cargo:rerun-if-changed=../package-manifest.toml");
let manifest = fs::read_to_string("../../package-manifest.toml")
.context("failed to read ../../package-manifest.toml")?;
println!("cargo:rerun-if-changed=../../package-manifest.toml");

let config: Config = toml::from_str(&manifest)
.context("failed to parse ../package-manifest.toml")?;
.context("failed to parse ../../package-manifest.toml")?;

let dendrite = config
.packages
.get("dendrite-asic")
.context("missing dendrite package in ../package-manifest.toml")?;
.context("missing dendrite package in ../../package-manifest.toml")?;

let local_path = match &dendrite.source {
PackageSource::Prebuilt { commit, .. } => {
// Report a relatively verbose error if we haven't downloaded the requisite
// openapi spec.
let local_path = format!("../out/downloads/dpd-{commit}.json");
// Report a relatively verbose error if we haven't downloaded the
// requisite openapi spec.
let local_path = format!("../../out/downloads/dpd-{commit}.json");
if !Path::new(&local_path).exists() {
bail!("{local_path} doesn't exist; rerun `tools/ci_download_dendrite_openapi` (after updating `tools/dendrite_openapi_version` if the dendrite commit in package-manifest.toml has changed)");
}
Expand All @@ -47,7 +47,7 @@ fn main() -> Result<()> {
}

PackageSource::Manual => {
let local_path = "../out/downloads/dpd-manual.json".to_string();
let local_path = "../../out/downloads/dpd-manual.json".to_string();
if !Path::new(&local_path).exists() {
bail!("{local_path} doesn't exist, please copy manually built dpd.json there!");
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// it is no longer useful to directly expose the JsonSchema types, we can go
// back to reusing `omicron_common`.
progenitor::generate_api!(
spec = "../openapi/gateway.json",
spec = "../../openapi/gateway.json",
inner_type = slog::Logger,
pre_hook = (|log: &slog::Logger, request: &reqwest::Request| {
slog::debug!(log, "client request";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! Interface for making API requests to installinator-artifactd.
progenitor::generate_api!(
spec = "../openapi/installinator-artifactd.json",
spec = "../../openapi/installinator-artifactd.json",
inner_type = slog::Logger,
pre_hook = (|log: &slog::Logger, request: &reqwest::Request| {
slog::debug!(log, "client request";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use std::collections::HashMap;

progenitor::generate_api!(
spec = "../openapi/nexus-internal.json",
spec = "../../openapi/nexus-internal.json",
derives = [schemars::JsonSchema, PartialEq],
inner_type = slog::Logger,
pre_hook = (|log: &slog::Logger, request: &reqwest::Request| {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use trust_dns_resolver::config::{
use trust_dns_resolver::TokioAsyncResolver;

progenitor::generate_api!(
spec = "../openapi/nexus.json",
spec = "../../openapi/nexus.json",
interface = Builder,
tags = Separate,
);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

//! Interface for API requests to an Oximeter metric collection server
omicron_common::generate_logging_api!("../openapi/oximeter.json");
omicron_common::generate_logging_api!("../../openapi/oximeter.json");

impl omicron_common::api::external::ClientError for types::Error {
fn message(&self) -> String {
Expand Down
File renamed without changes.
Loading

0 comments on commit 5e7528c

Please sign in to comment.