Skip to content

Commit

Permalink
Lints
Browse files Browse the repository at this point in the history
Issue: #
  • Loading branch information
jmintb authored and Jessie Chatham Spencer committed Aug 4, 2023
1 parent b77fe3b commit eef40e4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 84 deletions.
69 changes: 2 additions & 67 deletions Cargo.lock

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

8 changes: 3 additions & 5 deletions cli/tests/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use ame::custom_resources::{
common::{find_ame_endpoint, private_repo_gh_pat, setup_cluster},
new_task::Task,
project_source_ctrl::ProjectSrcCtrl,
secrets::SecretCtrl,
};
Expand All @@ -11,14 +10,13 @@ use fs_extra::dir::CopyOptions;
use insta::assert_snapshot;

use anyhow::anyhow;
use kube::{api::ListParams, Api, Client, ResourceExt};
use kube::Client;
use rstest::*;
use serial_test::serial;

use std::{
path::{Path, PathBuf},
process::Command,
time::Duration,
};

static AME_FILE_NAME: &str = "ame.yaml";
Expand Down Expand Up @@ -273,7 +271,7 @@ async fn can_create_project_source(
settings.add_filter("([⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏].*)", "");
let _guard = settings.bind_to_scope();

setup_cluster(AME_NAMESPACE).await;
let _ = setup_cluster(AME_NAMESPACE).await;

test_setup().await?;

Expand Down Expand Up @@ -308,7 +306,7 @@ async fn can_create_project_source(
}

let src_ctrl = ProjectSrcCtrl::try_namespaced(AME_NAMESPACE).await?;
src_ctrl.delete_project_src_for_repo(args[0]).await;
let _ = src_ctrl.delete_project_src_for_repo(args[0]).await;

secret_ctrl
.delete_secret(PRIVATE_GH_REPO_SECRET_KEY)
Expand Down
10 changes: 7 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ check:
cargo check --workspace --all-targets --all-features
cargo spellcheck check
typos --exclude **/primer.css ./
cargo audit
cargo +nightly fmt --check
cargo +nightly clippy --workspace --tests --all -- -D warnings
# cargo outdated --exclude leptos

# TODO: reintroduce failure on clippy warnings

cargo +nightly clippy --workspace --tests --all -- -W clippy::panic -W clippy::unwrap_used -W clippy::expect_used
cargo +nightly udeps --all-targets --workspace --show-unused-transitive --exclude web # TODO: solve false positives for web package.
# TODO: chrono 0.5 will deal with this CVE, update when it is released.
cargo audit --ignore RUSTSEC-2020-0071
# cargo outdated --exclude leptos

test *ARGS:
cargo test --workspace {{ARGS}}
Expand Down
1 change: 0 additions & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ either = {version = "1.9.0", optional = true}
rand = {version = "*", optional = true}
cron-parser = "0.8.0"
anyhow = "1.0.72"
serde_with = "3.1.0"

[dev-dependencies]
either = "1.9.0"
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion lib/src/project/mod.rs

This file was deleted.

12 changes: 5 additions & 7 deletions lib/tests/e2e_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use ame::custom_resources::{

use ame::{
custom_resources::{
common::{find_ame_endpoint, setup_cluster},
project::Project,
project_source_ctrl::ProjectSrcCtrl,
common::setup_cluster, project::Project, project_source_ctrl::ProjectSrcCtrl,
secrets::SecretCtrl,
},
grpc::{task_status::Phase, ProjectCfg, TaskCfg, TaskStatus},
Expand All @@ -33,7 +31,7 @@ use std::{
path::{Path, PathBuf},
process::Command,
};
use tracing::{debug, instrument, trace};
use tracing::{debug, instrument};
use tracing_subscriber::EnvFilter;

static INGRESS_NAMESPACE: &str = "ingress-nginx";
Expand Down Expand Up @@ -109,7 +107,7 @@ async fn ame_run_task(
#[case] task_id: &str,
) -> Result<(), Box<dyn std::error::Error>> {
init_test_tracing();
setup_cluster("ame-system").await; // TODO: async tests are affecting each other here.
let _ = setup_cluster("ame-system").await; // TODO: async tests are affecting each other here.
debug!("running task {task_id} in {project_dir}");
let projects: Api<Project> = Api::namespaced(kube_client().await?, AME_NAMESPACE);
let project: Project = serde_json::from_value(serde_json::json!(
Expand Down Expand Up @@ -245,7 +243,7 @@ async fn ame_trigger_tasks(
#[case] task_id: &str,
) -> Result<(), Box<dyn std::error::Error>> {
init_test_tracing();
setup_cluster("ame-system").await; // TODO: async tests are affecting each other here.
let _ = setup_cluster("ame-system").await; // TODO: async tests are affecting each other here.
let _projects: Api<Project> = Api::namespaced(kube_client().await?, AME_NAMESPACE);
let tasks: Api<Task> = Api::namespaced(kube_client().await?, AME_NAMESPACE);

Expand Down Expand Up @@ -376,7 +374,7 @@ async fn can_use_data_set_train_validate_and_deploy_model() -> Result<(), Box<dy
{
debug!("can use data, preparing cluster");
init_test_tracing();
setup_cluster(AME_NAMESPACE).await;
let _ = setup_cluster(AME_NAMESPACE).await;
test_setup().await?;

debug!("Cluster is ready!");
Expand Down

0 comments on commit eef40e4

Please sign in to comment.