Skip to content

Commit

Permalink
test(rust): do some cleanup after testing with postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Jun 26, 2024
1 parent 4e0d3d3 commit 97a0593
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 19 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_abac/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ockam_executor = { version = "0.80.0", path = "../ockam_executor", default-featu
regex = { version = "1.10.5", default-features = false, optional = true }
rustyline = { version = "14.0.0", optional = true }
rustyline-derive = { version = "0.10.0", optional = true }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1bae2030761b3f64b616f27db7eb158c76d691b8", optional = true, features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1b24b40de97db1cefe387bd590089bf915598547", optional = true, features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
str-buf = "3.0.3"
tokio = { version = "1.38", default-features = false, optional = true, features = ["sync", "time", "rt", "rt-multi-thread", "macros"] }
tracing = { version = "0.1", default-features = false, features = ["attributes"] }
Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.118"
sha2 = "0.10.8"
#sqlx = { version = "0.7.4", features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1bae2030761b3f64b616f27db7eb158c76d691b8", features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1b24b40de97db1cefe387bd590089bf915598547", features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
strip-ansi-escapes = "0.2"
sysinfo = "0.30"
thiserror = "1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ mod tests {
async fn test_reset() -> Result<()> {
let db_file = NamedTempFile::new().unwrap();
let cli_state_directory = db_file.path().parent().unwrap().join(random_name());
let db = SqlxDatabase::create(CliState::make_database_configuration(&cli_state_directory)?)
.await?;
db.drop_tables().await?;
let cli = CliState::create(cli_state_directory.clone()).await?;

// create 2 vaults
Expand Down
5 changes: 1 addition & 4 deletions implementations/rust/ockam/ockam_api/src/cli_state/vaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,7 @@ impl CliState {
};
Ok(self
.vaults_repository()
.store_vault(
&vault_name,
VaultType::local_file(path.as_path(), use_aws_kms),
)
.store_vault(&vault_name, VaultType::local_file(path, use_aws_kms))
.await?)
}

Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_app_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ockam_transport_tcp = { path = "../ockam_transport_tcp", version = "^0.117.0", d
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
#sqlx = { version = "0.7.4", features = ["runtime-tokio", "sqlite", "migrate", "postgres", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1bae2030761b3f64b616f27db7eb158c76d691b8", features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1b24b40de97db1cefe387bd590089bf915598547", features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
thiserror = "1.0"
tokio = { version = "1.38.0", features = ["full"] }
tracing = { version = "0.1", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_bare = { version = "0.5.0", default-features = false, features = ["alloc"] }
serde_json = { version = "1.0", optional = true }
sha2 = { version = "0.10", default-features = false }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1bae2030761b3f64b616f27db7eb158c76d691b8", optional = true, features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1b24b40de97db1cefe387bd590089bf915598547", optional = true, features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
tokio-retry = { version = "0.3.0", default-features = false, optional = true }
tracing = { version = "0.1", default_features = false }
tracing-attributes = { version = "0.1", default_features = false }
Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ regex = { version = "1.10.5", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1", optional = true }
#sqlx = { version = "0.7.4", optional = true, features = ["sqlite", "postgres", "migrate", "runtime-tokio", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1bae2030761b3f64b616f27db7eb158c76d691b8", optional = true, features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1b24b40de97db1cefe387bd590089bf915598547", optional = true, features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
tempfile = { version = "3.10.1" }
time = { version = "0.3.36", default-features = false, optional = true }
tokio = { version = "1.38", default-features = false, optional = true, features = ["sync", "time", "rt", "rt-multi-thread", "macros"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ where

// only run the postgres tests if the OCKAM_POSTGRES_* environment variables are set
if let Ok(db) = SqlxDatabase::create_new_postgres().await {
rethrow("Postgres local", f(db)).await?
rethrow("Postgres local", f(db.clone())).await?;
db.drop_tables().await?;
};
Ok(())
}
Expand All @@ -319,7 +320,8 @@ where

// only run the postgres tests if the OCKAM_POSTGRES_* environment variables are set
if let Ok(db) = SqlxDatabase::create_new_application_postgres().await {
rethrow("Postgres local", f(db)).await?
rethrow("Postgres local", f(db.clone())).await?;
db.drop_tables().await?;
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion implementations/rust/ockam/ockam_vault/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ rand_pcg = { version = "0.3.1", default-features = false, optional = true }
serde = { version = "1", default-features = false, features = ["derive"] }
sha2 = { version = "0.10", default-features = false }
#sqlx = { version = "0.7.4", optional = true, features = ["migrate", "postgres", "sqlite", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1bae2030761b3f64b616f27db7eb158c76d691b8", optional = true, features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
sqlx = { git = "https://github.com/etorreborre/sqlx", rev = "1b24b40de97db1cefe387bd590089bf915598547", optional = true, features = ["runtime-tokio", "sqlite", "postgres", "migrate", "any"] }
static_assertions = "1.1.0"
tracing = { version = "0.1", default-features = false }
x25519-dalek = { version = "2.0.1", default_features = false, features = ["precomputed-tables", "static_secrets", "zeroize"] }
Expand Down

0 comments on commit 97a0593

Please sign in to comment.