Skip to content
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

Add test for multiservice-discovery #100

Merged
merged 31 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
42a0ac5
Add integration test for mainnet targets
pietrodimarco-dfinity Jan 14, 2024
9731e61
Fix test suite
pietrodimarco-dfinity Jan 15, 2024
cb87493
Add Bazel dependencies
pietrodimarco-dfinity Jan 15, 2024
f9be393
Make explicit path to bin
pietrodimarco-dfinity Jan 15, 2024
84acd53
Add tests
pietrodimarco-dfinity Jan 17, 2024
8afac61
Add tests
pietrodimarco-dfinity Jan 17, 2024
dde9850
Add tests
pietrodimarco-dfinity Jan 17, 2024
7299461
Add tests
pietrodimarco-dfinity Jan 17, 2024
9f1525d
Add tests
pietrodimarco-dfinity Jan 17, 2024
6c8cc77
Add tests
pietrodimarco-dfinity Jan 17, 2024
44a994f
Add tests
pietrodimarco-dfinity Jan 17, 2024
96d81e1
test new git index
pietrodimarco-dfinity Jan 17, 2024
6a58c92
Add test data
pietrodimarco-dfinity Jan 23, 2024
5e9be03
Add bazel
pietrodimarco-dfinity Jan 23, 2024
6e12e67
Add IC_NODE test
pietrodimarco-dfinity Jan 23, 2024
39ac63a
Merge branch 'main' into test-service-discovery
pietrodimarco-dfinity Jan 23, 2024
bdc3579
Add test for multiservice-discovery based on large02 testnet
pietrodimarco-dfinity Jan 23, 2024
84d584c
remove unused IC_NODE
pietrodimarco-dfinity Jan 23, 2024
97162ef
refactor child process
pietrodimarco-dfinity Jan 23, 2024
a357e4d
Update checksum
pietrodimarco-dfinity Jan 23, 2024
f8f38bd
Repin bazel
pietrodimarco-dfinity Jan 23, 2024
ef9eb3d
Test ls in bazel
pietrodimarco-dfinity Jan 23, 2024
df93df9
Test ls in bazel
pietrodimarco-dfinity Jan 23, 2024
c5f5399
Test ls in bazel
pietrodimarco-dfinity Jan 23, 2024
695bae7
Test ls in bazel
pietrodimarco-dfinity Jan 23, 2024
82528e9
Test ls in bazel
pietrodimarco-dfinity Jan 23, 2024
d9bca98
Fix Bazel test
pietrodimarco-dfinity Jan 23, 2024
044702c
Add constants
pietrodimarco-dfinity Jan 23, 2024
21392ab
Merge branch 'main' into test-service-discovery-large02
pietrodimarco-dfinity Jan 23, 2024
8d1e590
Merge branch 'main' into test-service-discovery-large02
pietrodimarco-dfinity Jan 23, 2024
2f52a41
Merge branch 'main' into test-service-discovery-large02
pietrodimarco-dfinity Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
610 changes: 606 additions & 4 deletions Cargo.Bazel.lock

Large diffs are not rendered by default.

122 changes: 120 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::collections::{BTreeMap, BTreeSet};

use ic_types::PrincipalId;
use serde::{Serialize, Serializer};
use serde::{Deserialize, Serialize, Serializer};
use service_discovery::job_types::JobType;
use service_discovery::jobs::Job;

use crate::{builders::ConfigBuilder, contracts::target::TargetDto};

#[derive(Serialize, Debug, Clone, PartialEq, PartialOrd, Ord, Eq)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, PartialOrd, Ord, Eq)]
pub struct PrometheusStaticConfig {
pub targets: BTreeSet<String>,
pub labels: BTreeMap<String, String>,
Expand Down Expand Up @@ -51,10 +51,10 @@ fn get_endpoints(target_group: TargetDto, job: JobType) -> BTreeSet<String> {
.collect()
}

const IC_NAME: &str = "ic";
const IC_NODE: &str = "ic_node";
const IC_SUBNET: &str = "ic_subnet";
const JOB: &str = "job";
pub const IC_NAME: &str = "ic";
pub const IC_NODE: &str = "ic_node";
pub const IC_SUBNET: &str = "ic_subnet";
pub const JOB: &str = "job";
// TODO: Re-add the labels below once we resolve the issues with the public dashboard queries
// https://dfinity.atlassian.net/browse/OB-442
// const DC: &str = "dc";
Expand Down
21 changes: 21 additions & 0 deletions rs/ic-observability/multiservice-discovery/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ DEPS = [
"//rs/ic-observability/multiservice-discovery-shared"
]

DEV_DEPENDENCIES = [
"@crate_index_dre//:assert_cmd",
"@crate_index_dre//:tokio",
"@crate_index_dre//:tempdir",
"@crate_index_dre//:anyhow",
"@crate_index_dre//:reqwest",
"@crate_index_dre//:serde_json",
]

rust_binary(
name = "multiservice-discovery",
srcs = glob(["src/**/*.rs"]),
Expand Down Expand Up @@ -40,3 +49,15 @@ rust_test(
normal_dev = True,
) + DEPS,
)

rust_test(
name = "prom_targets_tests",
srcs = ["tests/tests.rs"],
data = [":multiservice-discovery"] + glob(["tests/test_data/**"]),
proc_macro_deps = all_crate_deps(
proc_macro_dev = True,
),
deps = all_crate_deps(
normal_dev = True,
) + DEPS + DEV_DEPENDENCIES,
)
7 changes: 7 additions & 0 deletions rs/ic-observability/multiservice-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ slog-term = { workspace = true }
tokio = { workspace = true }
url = { workspace = true }
warp = { workspace = true }

[dev-dependencies]
tempdir = "0.3.7"
reqwest = "0.11.23"
assert_cmd = "2.0.13"
anyhow = "1.0.79"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��������
Loading