From e5346d423b76469efef51c2e26cfb4723298a4b1 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 27 Sep 2024 18:37:04 +0400 Subject: [PATCH 1/3] fix: too long db names in tests --- .github/workflows/bens.yml | 2 +- .github/workflows/da-indexer.yml | 2 +- .github/workflows/eth-bytecode-db.yml | 2 +- .github/workflows/user-ops-indexer.yml | 2 +- libs/blockscout-service-launcher/src/test_database.rs | 3 ++- service-template/.github/workflows/{{project-name}}.yml | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bens.yml b/.github/workflows/bens.yml index 6bda8c7fd..2dfb03960 100644 --- a/.github/workflows/bens.yml +++ b/.github/workflows/bens.yml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres + image: postgres:16 env: POSTGRES_PASSWORD: admin POSTGRES_USER: graph-node diff --git a/.github/workflows/da-indexer.yml b/.github/workflows/da-indexer.yml index 316bd3a7f..e2608c7e8 100644 --- a/.github/workflows/da-indexer.yml +++ b/.github/workflows/da-indexer.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres + image: postgres:16 env: POSTGRES_PASSWORD: admin POSTGRES_USER: postgres diff --git a/.github/workflows/eth-bytecode-db.yml b/.github/workflows/eth-bytecode-db.yml index c9c939e5c..dd510ee33 100644 --- a/.github/workflows/eth-bytecode-db.yml +++ b/.github/workflows/eth-bytecode-db.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres + image: postgres:16 env: POSTGRES_PASSWORD: admin POSTGRES_USER: postgres diff --git a/.github/workflows/user-ops-indexer.yml b/.github/workflows/user-ops-indexer.yml index 669e7d62a..8d2f7e4ea 100644 --- a/.github/workflows/user-ops-indexer.yml +++ b/.github/workflows/user-ops-indexer.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres + image: postgres:16 env: POSTGRES_PASSWORD: admin POSTGRES_USER: postgres diff --git a/libs/blockscout-service-launcher/src/test_database.rs b/libs/blockscout-service-launcher/src/test_database.rs index 25a356e1c..110bff4cb 100644 --- a/libs/blockscout-service-launcher/src/test_database.rs +++ b/libs/blockscout-service-launcher/src/test_database.rs @@ -21,7 +21,8 @@ impl TestDbGuard { .await .expect("Connection to postgres (without database) failed"); // We use a hash, as the name itself may be quite long and be trimmed. - let db_name = format!("_{:x}", keccak_hash::keccak(db_name)); + // Postgres DB name should be 63 symbols max. + let db_name = format!("_{:x}", keccak_hash::keccak(db_name))[..63].to_string(); let mut guard = TestDbGuard { conn_with_db: Arc::new(DatabaseConnection::Disconnected), conn_without_db: Arc::new(conn_without_db), diff --git a/service-template/.github/workflows/{{project-name}}.yml b/service-template/.github/workflows/{{project-name}}.yml index a7d43b69d..05ca0db54 100644 --- a/service-template/.github/workflows/{{project-name}}.yml +++ b/service-template/.github/workflows/{{project-name}}.yml @@ -29,7 +29,7 @@ jobs: {%- if database %} services: postgres: - image: postgres + image: postgres:16 env: POSTGRES_PASSWORD: admin POSTGRES_USER: postgres From f72c41d859f3e09039a4919b42347169a50512fc Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 27 Sep 2024 19:00:29 +0400 Subject: [PATCH 2/3] chore: fix lint --- blockscout-ens/bens-logic/src/test_utils.rs | 2 +- eth-bytecode-db/Cargo.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/blockscout-ens/bens-logic/src/test_utils.rs b/blockscout-ens/bens-logic/src/test_utils.rs index 40a435cb2..edd50d1e0 100644 --- a/blockscout-ens/bens-logic/src/test_utils.rs +++ b/blockscout-ens/bens-logic/src/test_utils.rs @@ -83,7 +83,7 @@ pub async fn mocked_blockscout_client() -> BlockscoutClient { let mock_server = MockServer::start().await; for (tx_hash, tx) in TXNS.iter() { let mock = - Mock::given(method("GET")).and(path(&format!("/api/v2/transactions/{tx_hash:#x}"))); + Mock::given(method("GET")).and(path(format!("/api/v2/transactions/{tx_hash:#x}"))); mock.respond_with(ResponseTemplate::new(200).set_body_json(tx)) .mount(&mock_server) .await; diff --git a/eth-bytecode-db/Cargo.lock b/eth-bytecode-db/Cargo.lock index 91f87fddc..ea2eb5de6 100644 --- a/eth-bytecode-db/Cargo.lock +++ b/eth-bytecode-db/Cargo.lock @@ -6421,9 +6421,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -6442,9 +6442,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", From 42d342436a54f9f4d5354ea9af4e7aa8e2510982 Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Fri, 27 Sep 2024 19:13:24 +0400 Subject: [PATCH 3/3] chore: bump launcher version --- libs/blockscout-service-launcher/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/blockscout-service-launcher/Cargo.toml b/libs/blockscout-service-launcher/Cargo.toml index f7ba6f2d2..c6b04997d 100644 --- a/libs/blockscout-service-launcher/Cargo.toml +++ b/libs/blockscout-service-launcher/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blockscout-service-launcher" -version = "0.13.1" +version = "0.13.2" description = "Allows to launch blazingly fast blockscout rust services" license = "MIT" repository = "https://github.com/blockscout/blockscout-rs"