Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion ic-os/guestos/envs/dev/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ file_size_check(
# Export checksums & build artifacts for update images
artifact_bundle(
name = "bundle-update",
testonly = True,
inputs = [
icos_images.update_image,
icos_images.update_image_test,
Expand Down
1 change: 0 additions & 1 deletion ic-os/hostos/envs/dev/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ icos_images = icos_build(
# Export checksums & build artifacts for update images
artifact_bundle(
name = "bundle-update",
testonly = True,
inputs = [
icos_images.update_image,
icos_images.update_image_test,
Expand Down
1 change: 0 additions & 1 deletion ic-os/hostos/envs/prod/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ file_size_check(
# (image is used for HostOS upgrades)
artifact_bundle(
name = "bundle-update",
testonly = True,
inputs = [
icos_images.update_image,
icos_images.update_image_test,
Expand Down
1 change: 0 additions & 1 deletion ic-os/setupos/envs/dev/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ launch_bare_metal(
# Export checksums & build artifacts
artifact_bundle(
name = "bundle",
testonly = True,
inputs = [":dev"],
prefix = "setup-os/disk-img-dev",
visibility = ["//visibility:public"],
Expand Down
1 change: 0 additions & 1 deletion ic-os/setupos/envs/prod/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ launch_bare_metal(
# (image is used as the IC-OS installation image downloaded by Node Providers)
artifact_bundle(
name = "bundle",
testonly = True,
inputs = [":prod"],
prefix = "setup-os/disk-img",
visibility = ["//visibility:public"],
Expand Down
10 changes: 1 addition & 9 deletions publish/binaries/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,7 @@ ALL_BINARIES = {
# test binaries or binaries using test utils
TESTONLY_BINARIES = [
# Keep sorted
"e2e-test-driver",
"ic-admin",
"ic-boundary",
"ic-https-outcalls-adapter",
"ic-nns-init",
"ic-prep",
"ic-test-state-machine",
"pocket-ic",
"replicated-state-test",
"state-layout-test",
"types-test",
Expand Down Expand Up @@ -88,8 +81,7 @@ TEST_BINARIES = [
binary = ALL_BINARIES[name],
) for name in TEST_BINARIES]

# all targets below are tesonly because the targets violating the testonly flag
# would error at this point
# targets below use testonly conditionally for the remaining test-only binaries

[
genrule(
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/iccsa/test_utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package(default_visibility = [

rust_library(
name = "test_utils",
testonly = True,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of them, like this one, is in a directory containing test_utils. Shouldn't we keep them for those?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I'll need to double check this. Might have been too zealous.

srcs = glob(["src/**"]),
crate_name = "ic_crypto_iccsa_test_utils",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/internal/csp_test_utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package(default_visibility = ["//rs/crypto:__subpackages__"])

rust_library(
name = "csp_test_utils",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_crypto_internal_csp_test_utils",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/test_utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ load("@rules_rust//rust:defs.bzl", "rust_library")

rust_library(
name = "test_utils",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_crypto_test_utils",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/test_utils/canister_threshold_sigs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package(default_visibility = ["//visibility:public"])

rust_library(
name = "canister_threshold_sigs",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_crypto_test_utils_canister_threshold_sigs",
proc_macro_deps = [
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/test_utils/crypto_returning_ok/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package(default_visibility = ["//visibility:public"])

rust_library(
name = "crypto_returning_ok",
testonly = True,
srcs = glob(["src/**/*.rs"]),
crate_name = "ic_crypto_test_utils_crypto_returning_ok",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/test_utils/ni-dkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ ALIASES = {}

rust_library(
name = "ni-dkg",
testonly = True,
srcs = glob(["src/**/*.rs"]),
aliases = ALIASES,
crate_name = "ic_crypto_test_utils_ni_dkg",
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/test_utils/reproducible_rng/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package(default_visibility = ["//visibility:public"])

rust_library(
name = "reproducible_rng",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_crypto_test_utils_reproducible_rng",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/test_utils/vetkd/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package(default_visibility = ["//visibility:public"])

rust_library(
name = "vetkd",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_crypto_test_utils_vetkd",
version = "0.1.0",
Expand Down
2 changes: 0 additions & 2 deletions rs/https_outcalls/adapter/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ rust_library(
# Same target as above but allows the adapter to make HTTP calls.
rust_library(
name = "adapter_with_http",
testonly = True,
srcs = glob(
["src/**"],
exclude = [
Expand Down Expand Up @@ -99,7 +98,6 @@ rust_binary(
# This target is used for local testing (e.g. DFX)
rust_binary(
name = "ic-outcalls-adapter-with-http",
testonly = True,
srcs = [
"src/cli.rs",
"src/main.rs",
Expand Down
15 changes: 9 additions & 6 deletions rs/nns/init/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,30 @@ load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
LIB_DEPENDENCIES = [
# Keep sorted.
"//rs/canister_client",
"//rs/interfaces/registry",
"//rs/ledger_suite/icp:icp_ledger",
"//rs/nns/common",
"//rs/nns/constants",
"//rs/nns/test_utils",
"//rs/registry/local_store",
"//rs/registry/proto_data_provider",
"//rs/registry/transport",
"//rs/rust_canisters/canister_test",
"//rs/sys",
"//rs/test_utilities/identity",
"//rs/types/base_types",
"@crate_index//:clap",
"@crate_index//:tokio",
"@crate_index//:url",
]

DEPENDENCIES = LIB_DEPENDENCIES + [
# Keep sorted.
"//rs/nns/test_utils",
"//rs/rust_canisters/canister_test",
"//rs/test_utilities/identity",
]

MACRO_DEPENDENCIES = []

ALIASES = {}
Expand All @@ -35,13 +39,12 @@ MACRO_DEV_DEPENDENCIES = []

rust_library(
name = "init",
testonly = True,
srcs = glob(["src/**/*.rs"]),
aliases = ALIASES,
crate_name = "ic_nns_init",
proc_macro_deps = MACRO_DEPENDENCIES,
version = "0.9.0",
deps = DEPENDENCIES,
deps = LIB_DEPENDENCIES,
)

rust_binary(
Expand Down
11 changes: 5 additions & 6 deletions rs/nns/init/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//! initial payloads and install nns canisters in a fresh IC.
//! Was used at genesis, but now only used to install the nns in testnets.

use canister_test::Wasm;
use ic_canister_client::Sender;
use ic_interfaces_registry::{RegistryDataProvider, ZERO_REGISTRY_VERSION};
use ic_nns_constants::NNS_CANISTER_WASMS;
Expand Down Expand Up @@ -154,12 +153,12 @@ pub fn set_up_env_vars_for_all_canisters<P: AsRef<Path>>(wasm_dir: P) {
let mut path = wasm_dir.as_ref().to_path_buf();
path.push(file_part.as_str());
if path.is_file() {
// Sets up the env var following the pattern expected by
// WASM::from_location_specified_by_env_var
// Set the env var in a way that is expected by consumers
// TODO: Audit that the environment access only happens in single-threaded code.
unsafe {
std::env::set_var(Wasm::env_var_name(canister, &[]), path.to_str().unwrap())
};
let env_var = format!("{}_WASM_PATH", canister)
.replace('-', "_")
.to_uppercase();
unsafe { std::env::set_var(env_var, path.to_str().unwrap()) };
continue 'outer;
}
}
Expand Down
2 changes: 0 additions & 2 deletions rs/pocket_ic_server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ MAINNET_NNS_CANISTER_ENV = {
[
rust_library(
name = "pocket-ic-server-lib" + name_suffix,
testonly = True,
srcs = [
"src/beta_features.rs",
"src/external_canister_types.rs",
Expand All @@ -290,7 +289,6 @@ MAINNET_NNS_CANISTER_ENV = {
[
rust_binary(
name = "pocket-ic-server" + name_suffix,
testonly = True,
srcs = ["src/main.rs"],
compile_data = ["//:mainnet-routing-table.json"],
proc_macro_deps = MACRO_DEPENDENCIES,
Expand Down
3 changes: 0 additions & 3 deletions rs/prep/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ ALIASES = {}

rust_library(
name = "prep",
testonly = True,
srcs = glob(["src/**/*.rs"]),
aliases = ALIASES,
crate_name = "ic_prep_lib",
Expand All @@ -71,7 +70,6 @@ rust_library(

rust_binary(
name = "ic-prep",
testonly = True,
srcs = ["src/bin/prep.rs"],
aliases = ALIASES,
proc_macro_deps = MACRO_DEPENDENCIES,
Expand All @@ -80,7 +78,6 @@ rust_binary(

rust_binary(
name = "ic-principal-id",
testonly = True,
srcs = ["src/bin/principal_id.rs"],
aliases = ALIASES,
proc_macro_deps = MACRO_DEPENDENCIES,
Expand Down
3 changes: 1 addition & 2 deletions rs/registry/admin/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ cargo_build_script(

rust_binary(
name = "ic-admin",
testonly = True,
srcs = glob(["bin/**/*.rs"]),
proc_macro_deps = [
# Keep sorted.
Expand Down Expand Up @@ -69,10 +68,10 @@ rust_binary(
"//rs/nns/constants",
"//rs/nns/governance/api",
"//rs/nns/governance/conversions",
"//rs/nns/handlers/lifeline/interface",
"//rs/nns/handlers/root/impl:root",
"//rs/nns/init",
"//rs/nns/sns-wasm",
"//rs/nns/test_utils",
"//rs/prep",
"//rs/protobuf",
"//rs/registry/canister",
Expand Down
2 changes: 1 addition & 1 deletion rs/registry/admin/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ use ic_nns_governance_api::{
subnet_rental::{RentalConditionId, SubnetRentalRequest},
};
use ic_nns_governance_conversions::convert_guest_launch_measurements_from_pb_to_api;
use ic_nns_handler_lifeline_interface::{HardResetNnsRootToVersionPayload, UpgradeRootProposal};
use ic_nns_handler_root::root_proposals::{GovernanceUpgradeRootProposal, RootProposalBallot};
use ic_nns_init::make_hsm_sender;
use ic_nns_test_utils::governance::{HardResetNnsRootToVersionPayload, UpgradeRootProposal};
use ic_protobuf::registry::replica_version::v1::GuestLaunchMeasurements;
use ic_protobuf::registry::{
api_boundary_node::v1::ApiBoundaryNodeRecord,
Expand Down
2 changes: 0 additions & 2 deletions rs/state_machine_tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ DEPENDENCIES = [

rust_library(
name = "state_machine_tests",
testonly = True,
srcs = [
"src/lib.rs",
"src/tests.rs",
Expand Down Expand Up @@ -119,7 +118,6 @@ MACRO_DEV_DEPENDENCIES = [

rust_binary(
name = "ic-test-state-machine",
testonly = True,
srcs = ["src/main.rs"],
proc_macro_deps = MACRO_DEPENDENCIES,
deps = BIN_DEPENDENCIES,
Expand Down
1 change: 0 additions & 1 deletion rs/test_utilities/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package(default_visibility = ["//visibility:public"])

rust_library(
name = "test_utilities",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_test_utilities",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/test_utilities/consensus/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ DEPENDENCIES = [

rust_library(
name = "consensus",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_test_utilities_consensus",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/test_utilities/logger/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package(default_visibility = ["//visibility:public"])

rust_library(
name = "logger",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_test_utilities_logger",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/test_utilities/registry/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ DEPENDENCIES = [

rust_library(
name = "registry",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_test_utilities_registry",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/test_utilities/state/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ DEPENDENCIES = [

rust_library(
name = "state",
testonly = True,
srcs = glob(["src/**/*.rs"]),
crate_name = "ic_test_utilities_state",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/test_utilities/time/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ DEPENDENCIES = [

rust_library(
name = "time",
testonly = True,
srcs = glob(["src/**/*.rs"]),
crate_name = "ic_test_utilities_time",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/test_utilities/types/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ DEPENDENCIES = [

rust_library(
name = "types",
testonly = True,
srcs = glob(["src/**"]),
crate_name = "ic_test_utilities_types",
version = "0.9.0",
Expand Down
1 change: 0 additions & 1 deletion rs/validator/http_request_test_utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ ALIASES = {}

rust_library(
name = "http_request_test_utils",
testonly = True,
srcs = glob(["src/**/*.rs"]),
aliases = ALIASES,
crate_name = "ic_validator_http_request_test_utils",
Expand Down
Loading