Skip to content

Commit fdfc38c

Browse files
committed
[spr] initial version
Created using spr 1.3.6-beta.1
2 parents 374ac00 + b23f3ff commit fdfc38c

132 files changed

Lines changed: 843 additions & 497 deletions

File tree

Some content is hidden

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

.config/nextest.toml

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,42 @@
55
# improvements or bugfixes that are present in newer versions of nextest.
66
nextest-version = { required = "0.9.131", recommended = "0.9.131" }
77

8-
experimental = ["benchmarks", "setup-scripts"]
8+
[experimental]
9+
benchmarks = true
10+
setup-scripts = true
11+
12+
[profile.default]
13+
default-filter = "all() - package(omicron-live-tests) - package(end-to-end-tests)"
14+
15+
[[profile.default.overrides]]
16+
# These tests are quite slow and can hold up the run, so run them first.
17+
filter = "package(oximeter-db) and test(=client::tests::test_replicated) + test(test_action_failure_can_unwind)"
18+
priority = 20
19+
20+
[[profile.default.overrides]]
21+
filter = "package(oximeter-db) and test(replicated) + package(omicron-clickhouse-admin)"
22+
test-group = "clickhouse-cluster"
23+
# client::tests::test_replicated is part of this filter, but it's matched with
24+
# the higher priority (20) first. The other tests in this group are run after
25+
# that.
26+
priority = 10
27+
28+
[[profile.default.overrides]]
29+
# These tests can time out under heavy contention.
30+
filter = "binary_id(omicron-nexus::test_all) and test(::schema::)"
31+
threads-required = 4
932

1033
[[profile.default.scripts]]
1134
# Exclude omicron-dev tests from crdb-seed as we explicitly want to simulate an
1235
# environment where the seed file doesn't exist.
1336
# Exclude omicron-live-tests because those don't need this and also don't have
1437
# it available in the environment in which they run.
15-
filter = '(rdeps(nexus-test-utils) + package(nexus-db-schema)) - package(omicron-dev) - package(omicron-live-tests)'
16-
setup = 'crdb-seed'
38+
filter = "(rdeps(nexus-test-utils) + package(nexus-db-schema)) - package(omicron-dev) - package(omicron-live-tests)"
39+
setup = "crdb-seed"
40+
41+
[[profile.default.scripts]]
42+
filter = "package(omicron-clickhouse-admin)"
43+
setup = "clickhouse-cluster"
1744

1845
[profile.ci]
1946
fail-fast = false
@@ -26,17 +53,30 @@ path = "junit.xml"
2653
# output for analysis, not visualization.
2754
flaky-fail-status = "success"
2855

56+
[[profile.ci.overrides]]
57+
# `omicron-test-utils` is included in this block that uses a longer-than-normal
58+
# timeout because under some conditions it waits for CockroachDB to shut down
59+
# gracefully. Note that `omicron-test-utils` depends on `omicron-nexus`, so this
60+
# is redundant, but we do this for future-proofing.
61+
filter = "binary_id(omicron-nexus::test_all) + rdeps(omicron-test-utils)"
62+
# As of 2023-01-08, the slowest test in test_all takes 196s on a Ryzen 7950X.
63+
# 900s is a good upper limit that adds a comfortable buffer.
64+
slow-timeout = { period = "60s", terminate-after = 15 }
65+
66+
[profile.live-tests]
67+
default-filter = "package(omicron-live-tests)"
68+
69+
[[profile.live-tests.overrides]]
70+
filter = "package(omicron-live-tests)"
71+
test-group = "live-tests"
72+
2973
[scripts.setup.crdb-seed]
3074
# Use the test profile for this executable since that's how almost all
3175
# invocations of nextest happen.
32-
command = 'cargo run -p crdb-seed --profile test'
33-
34-
[[profile.default.scripts]]
35-
filter = 'package(omicron-clickhouse-admin)'
36-
setup = 'clickhouse-cluster'
76+
command = "cargo run -p crdb-seed --profile test"
3777

3878
[scripts.setup.clickhouse-cluster]
39-
command = 'cargo run -p clickhouse-cluster-dev'
79+
command = "cargo run -p clickhouse-cluster-dev"
4080

4181
[test-groups]
4282
# The ClickHouse cluster tests currently rely on a hard-coded set of ports for
@@ -49,41 +89,3 @@ clickhouse-cluster = { max-threads = 1 }
4989
# live-tests operate on a more realistic, shared control plane and test
5090
# behaviors that conflict with each other. They need to be run serially.
5191
live-tests = { max-threads = 1 }
52-
53-
[profile.default]
54-
default-filter = 'all() - package(omicron-live-tests) - package(end-to-end-tests)'
55-
56-
[[profile.default.overrides]]
57-
# These tests are quite slow and can hold up the run, so run them first.
58-
filter = 'package(oximeter-db) and test(=client::tests::test_replicated) + test(test_action_failure_can_unwind)'
59-
priority = 20
60-
61-
[[profile.default.overrides]]
62-
filter = 'package(oximeter-db) and test(replicated) + package(omicron-clickhouse-admin)'
63-
test-group = 'clickhouse-cluster'
64-
# client::tests::test_replicated is part of this filter, but it's matched with
65-
# the higher priority (20) first. The other tests in this group are run after
66-
# that.
67-
priority = 10
68-
69-
[[profile.default.overrides]]
70-
# These tests can time out under heavy contention.
71-
filter = 'binary_id(omicron-nexus::test_all) and test(::schema::)'
72-
threads-required = 4
73-
74-
[[profile.ci.overrides]]
75-
# `omicron-test-utils` is included in this block that uses a longer-than-normal
76-
# timeout because under some conditions it waits for CockroachDB to shut down
77-
# gracefully. Note that `omicron-test-utils` depends on `omicron-nexus`, so this
78-
# is redundant, but we do this for future-proofing.
79-
filter = 'binary_id(omicron-nexus::test_all) + rdeps(omicron-test-utils)'
80-
# As of 2023-01-08, the slowest test in test_all takes 196s on a Ryzen 7950X.
81-
# 900s is a good upper limit that adds a comfortable buffer.
82-
slow-timeout = { period = '60s', terminate-after = 15 }
83-
84-
[profile.live-tests]
85-
default-filter = 'package(omicron-live-tests)'
86-
87-
[[profile.live-tests.overrides]]
88-
filter = 'package(omicron-live-tests)'
89-
test-group = 'live-tests'

.config/tombi.toml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Tombi config to apply TOML lints and autoformatting:
2+
#
3+
# * Keep Cargo.toml dependency lines sorted.
4+
# * Standardize things like "" across our configs.
5+
6+
# Cargo supports TOML 1.1, under which tombi wraps > 80-column dependency lines
7+
# into multiline inline tables. However, toml-cli in tools/ci_check_opte_ver.sh
8+
# doesn't currently (as of 2026-07) support that syntax, so we restrict
9+
# ourselves to TOML 1.0 here.
10+
toml-version = "v1.0.0"
11+
12+
[files]
13+
# This controls which files a bare `tombi format`/`tombi lint` applies to.
14+
include = [
15+
"**/Cargo.toml",
16+
".config/nextest.toml",
17+
".config/tombi.toml",
18+
]
19+
# workspace-hack/Cargo.toml is generated and owned by cargo-hakari, so we don't
20+
# try and fight that here.
21+
exclude = ["workspace-hack/Cargo.toml"]
22+
23+
[format.rules]
24+
indent-width = 4
25+
26+
[[schemas]]
27+
toml-version = "v1.0.0"
28+
# Use tombi's embedded cargo schema (tombi://), not the live schemastore URL, so
29+
# tombi can work without a network dependency.
30+
path = "tombi://www.schemastore.org/cargo.json"
31+
include = ["**/Cargo.toml"]
32+
33+
# By default, tombi would sort most tables in Cargo.toml. We mostly care about
34+
# dependency tables, though.
35+
[schemas.format.rules]
36+
array-values-order.enabled = false
37+
table-keys-order.enabled = false
38+
39+
[[schemas.overrides]]
40+
targets = [
41+
"dependencies",
42+
"dev-dependencies",
43+
"build-dependencies",
44+
"workspace.dependencies",
45+
"target.*.dependencies",
46+
"target.*.dev-dependencies",
47+
"target.*.build-dependencies",
48+
]
49+
format.rules.table-keys-order = "version-sort"

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PATH_add out/clickhouse
66
PATH_add out/dendrite-stub/bin
77
PATH_add out/mgd/root/opt/oxide/mgd/bin
88
PATH_add out/mg-ddm/root/opt/oxide/mg-ddm/bin
9+
PATH_add out/tombi
910

1011
if [ "$OMICRON_USE_FLAKE" = 1 ] && nix flake show &> /dev/null
1112
then
@@ -15,6 +16,7 @@ then
1516
watch_file tools/dendrite_version
1617
watch_file tools/clickhouse_version
1718
watch_file tools/cocroachdb_version
19+
watch_file tools/tombi_version
1820
watch_file rust-toolchain.toml
1921
use flake;
2022
fi
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: check-toml-format
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- 'rel/**'
7+
pull_request:
8+
workflow_dispatch:
9+
inputs:
10+
jobs:
11+
check-toml-format:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
with:
16+
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
17+
- name: Install tombi
18+
shell: bash
19+
# Keep this in sync with the dev-tools downloader and flake.nix.
20+
run: |
21+
set -euo pipefail
22+
version="$(cat tools/tombi_version)"
23+
source tools/tombi_checksums
24+
triple="x86_64-unknown-linux-musl"
25+
dirname="tombi-cli-${version}-${triple}"
26+
tarball="${dirname}.tar.gz"
27+
url="https://github.com/tombi-toml/tombi/releases/download/v${version}/${tarball}"
28+
bindir="$HOME/.local/bin"
29+
# Download and extract the tombi binary inside RUNNER_TEMP.
30+
cd "$RUNNER_TEMP"
31+
curl --retry 3 --connect-timeout 15 -fsSL -o "$tarball" "$url"
32+
echo "${CIDL_SHA256_LINUX_X86_64} ${tarball}" | sha256sum -c -
33+
tar -xzf "$tarball"
34+
mkdir -p "$bindir"
35+
cp "${dirname}/tombi" "$bindir/tombi"
36+
chmod +x "$bindir/tombi"
37+
echo "$bindir" >> "$GITHUB_PATH"
38+
- name: Check TOML formatting
39+
shell: bash
40+
run: tombi format --check --offline
41+
- name: Lint TOML files
42+
shell: bash
43+
# Pass in --error-on-warnings because plain tombi lint exits 0 on
44+
# warnings, and we care about them in this context.
45+
run: tombi lint --offline --error-on-warnings

0 commit comments

Comments
 (0)