-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor clickhouse admin integration tests #7017
Merged
karencfv
merged 20 commits into
oxidecomputer:main
from
karencfv:refactor-clickhouse-admin-tests
Nov 14, 2024
Merged
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6a982a1
initial structure
karencfv 18162e8
setup
karencfv 6d85294
setup nextest
karencfv 97a747b
start cluster during set up
karencfv fbdc52e
Leave myself some notes
karencfv 4b94c90
fmt
karencfv 94792e2
this works I guess
karencfv 4b5c203
clean up a bit
karencfv 789cbd9
clean up a bit
karencfv f6c7f97
deploy full cluster on setup
karencfv 358feb3
start adding tests
karencfv 288de54
start adding tests
karencfv 6186d81
add all the tests
karencfv d8a67b8
clean up
karencfv 1e5c3d2
clippy
karencfv 4a41f1b
clean up
karencfv 1786875
Set default base ports
karencfv aef2718
Clean up
karencfv 21305b9
make linter happy
karencfv 8163b74
Address comments
karencfv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "clickhouse-admin-test-utils" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "MPL-2.0" | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
camino.workspace = true | ||
clickward.workspace = true | ||
dropshot.workspace = true | ||
|
||
omicron-workspace-hack.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
//! Integration testing facilities for clickhouse-admin | ||
|
||
use camino::Utf8PathBuf; | ||
use clickward::{BasePorts, Deployment, DeploymentConfig}; | ||
use dropshot::test_util::{log_prefix_for_test, LogContext}; | ||
use dropshot::{ConfigLogging, ConfigLoggingLevel}; | ||
|
||
pub const DEFAULT_CLICKHOUSE_ADMIN_BASE_PORTS: BasePorts = BasePorts { | ||
keeper: 29000, | ||
raft: 29100, | ||
clickhouse_tcp: 29200, | ||
clickhouse_http: 29300, | ||
clickhouse_interserver_http: 29400, | ||
}; | ||
|
||
pub fn default_clickhouse_cluster_test_deployment( | ||
path: Utf8PathBuf, | ||
) -> Deployment { | ||
let base_ports = DEFAULT_CLICKHOUSE_ADMIN_BASE_PORTS; | ||
|
||
let config = DeploymentConfig { | ||
path, | ||
base_ports, | ||
cluster_name: "oximeter_cluster".to_string(), | ||
}; | ||
|
||
Deployment::new(config) | ||
} | ||
|
||
pub fn default_clickhouse_log_ctx_and_path() -> (LogContext, Utf8PathBuf) { | ||
let logctx = LogContext::new( | ||
"clickhouse_cluster", | ||
&ConfigLogging::StderrTerminal { level: ConfigLoggingLevel::Info }, | ||
); | ||
|
||
let (parent_dir, _prefix) = log_prefix_for_test("clickhouse_cluster"); | ||
let path = parent_dir.join("clickward_test"); | ||
|
||
(logctx, path) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have a constant defined for
oximeter_cluster
somewhere, although maybe not accessible to clickhouse-admin.