Skip to content

Commit

Permalink
chore: remove testnet from release type
Browse files Browse the repository at this point in the history
This also deletes all the tests related to testnet, since we won't be supporting this binary any
more.
  • Loading branch information
jacderida committed Feb 1, 2024
1 parent 9c2eb8d commit f0148e7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 91 deletions.
10 changes: 1 addition & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const SAFENODE_S3_BASE_URL: &str = "https://sn-node.s3.eu-west-2.amazonaws.com";
const SAFENODE_MANAGER_S3_BASE_URL: &str = "https://sn-node-manager.s3.eu-west-2.amazonaws.com";
const SAFENODE_RPC_CLIENT_S3_BASE_URL: &str =
"https://sn-node-rpc-client.s3.eu-west-2.amazonaws.com";
const TESTNET_S3_BASE_URL: &str = "https://sn-testnet.s3.eu-west-2.amazonaws.com";

#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub enum ReleaseType {
Expand All @@ -42,7 +41,6 @@ pub enum ReleaseType {
Safenode,
SafenodeManager,
SafenodeRpcClient,
Testnet,
}

impl fmt::Display for ReleaseType {
Expand All @@ -56,7 +54,6 @@ impl fmt::Display for ReleaseType {
ReleaseType::Safenode => "safenode",
ReleaseType::SafenodeManager => "safenode-manager",
ReleaseType::SafenodeRpcClient => "safenode_rpc_client",
ReleaseType::Testnet => "testnet",
}
)
}
Expand All @@ -68,8 +65,7 @@ impl ReleaseType {
ReleaseType::Faucet
| ReleaseType::Safe
| ReleaseType::Safenode
| ReleaseType::SafenodeRpcClient
| ReleaseType::Testnet => "safe_network".to_string(),
| ReleaseType::SafenodeRpcClient => "safe_network".to_string(),
ReleaseType::SafenodeManager => "sn-node-manager".to_string(),
}
}
Expand All @@ -83,7 +79,6 @@ lazy_static! {
m.insert(ReleaseType::Safenode, "sn_node");
m.insert(ReleaseType::SafenodeManager, "sn-node-manager");
m.insert(ReleaseType::SafenodeRpcClient, "sn_node_rpc_client");
m.insert(ReleaseType::Testnet, "sn_testnet");
m
};
}
Expand Down Expand Up @@ -159,7 +154,6 @@ impl dyn SafeReleaseRepositoryInterface {
safenode_base_url: SAFENODE_S3_BASE_URL.to_string(),
safenode_manager_base_url: SAFENODE_MANAGER_S3_BASE_URL.to_string(),
safenode_rpc_client_base_url: SAFENODE_RPC_CLIENT_S3_BASE_URL.to_string(),
testnet_base_url: TESTNET_S3_BASE_URL.to_string(),
})
}
}
Expand All @@ -171,7 +165,6 @@ pub struct SafeReleaseRepository {
pub safenode_base_url: String,
pub safenode_manager_base_url: String,
pub safenode_rpc_client_base_url: String,
pub testnet_base_url: String,
}

impl SafeReleaseRepository {
Expand All @@ -182,7 +175,6 @@ impl SafeReleaseRepository {
ReleaseType::Safenode => self.safenode_base_url.clone(),
ReleaseType::SafenodeManager => self.safenode_manager_base_url.clone(),
ReleaseType::SafenodeRpcClient => self.safenode_rpc_client_base_url.clone(),
ReleaseType::Testnet => self.testnet_base_url.clone(),
}
}

Expand Down
71 changes: 0 additions & 71 deletions tests/test_download_from_s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const SAFE_VERSION: &str = "0.83.51";
const SAFENODE_VERSION: &str = "0.93.7";
const SAFENODE_MANAGER_VERSION: &str = "0.1.8";
const SAFENODE_RPC_CLIENT_VERSION: &str = "0.1.40";
const TESTNET_VERSION: &str = "0.2.213";

async fn download_and_extract(
release_type: &ReleaseType,
Expand Down Expand Up @@ -55,7 +54,6 @@ async fn download_and_extract(
ReleaseType::Safenode => "safenode",
ReleaseType::SafenodeManager => "safenode-manager",
ReleaseType::SafenodeRpcClient => "safenode_rpc_client",
ReleaseType::Testnet => "testnet",
};
let expected_binary_name = if *platform == Platform::Windows {
format!("{}.exe", binary_name)
Expand Down Expand Up @@ -239,75 +237,6 @@ async fn should_download_and_extract_safenode_for_windows() {
.await;
}

///
/// Testnet Tests
///
#[tokio::test]
async fn should_download_and_extract_testnet_for_linux_musl() {
download_and_extract(
&ReleaseType::Testnet,
TESTNET_VERSION,
&Platform::LinuxMusl,
&ArchiveType::TarGz,
)
.await;
}

#[tokio::test]
async fn should_download_and_extract_testnet_for_linux_musl_aarch64() {
download_and_extract(
&ReleaseType::Testnet,
TESTNET_VERSION,
&Platform::LinuxMuslAarch64,
&ArchiveType::TarGz,
)
.await;
}

#[tokio::test]
async fn should_download_and_extract_testnet_for_linux_musl_arm() {
download_and_extract(
&ReleaseType::Testnet,
TESTNET_VERSION,
&Platform::LinuxMuslArm,
&ArchiveType::TarGz,
)
.await;
}

#[tokio::test]
async fn should_download_and_extract_testnet_for_linux_musl_arm_v7() {
download_and_extract(
&ReleaseType::Testnet,
TESTNET_VERSION,
&Platform::LinuxMuslArmV7,
&ArchiveType::TarGz,
)
.await;
}

#[tokio::test]
async fn should_download_and_extract_testnet_for_macos() {
download_and_extract(
&ReleaseType::Testnet,
TESTNET_VERSION,
&Platform::MacOs,
&ArchiveType::TarGz,
)
.await;
}

#[tokio::test]
async fn should_download_and_extract_testnet_for_windows() {
download_and_extract(
&ReleaseType::Testnet,
TESTNET_VERSION,
&Platform::Windows,
&ArchiveType::Zip,
)
.await;
}

///
/// Safenode RPC client tests
///
Expand Down
11 changes: 0 additions & 11 deletions tests/test_get_latest_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,3 @@ async fn should_get_latest_version_of_safenode_manager() {
.unwrap();
assert!(valid_semver_format(&version));
}

#[tokio::test]
async fn should_get_latest_version_of_testnet() {
let release_type = ReleaseType::Testnet;
let release_repo = <dyn SafeReleaseRepositoryInterface>::default_config();
let version = release_repo
.get_latest_version(&release_type)
.await
.unwrap();
assert!(valid_semver_format(&version));
}

0 comments on commit f0148e7

Please sign in to comment.