Skip to content

Commit

Permalink
fix: too long db names in tests (#1073)
Browse files Browse the repository at this point in the history
* fix: too long db names in tests

* chore: fix lint

* chore: bump launcher version
  • Loading branch information
k1rill-fedoseev authored Sep 27, 2024
1 parent 3774de7 commit 4cff309
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
image: postgres:16
env:
POSTGRES_PASSWORD: admin
POSTGRES_USER: graph-node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/da-indexer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
image: postgres:16
env:
POSTGRES_PASSWORD: admin
POSTGRES_USER: postgres
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eth-bytecode-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
image: postgres:16
env:
POSTGRES_PASSWORD: admin
POSTGRES_USER: postgres
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/user-ops-indexer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
image: postgres:16
env:
POSTGRES_PASSWORD: admin
POSTGRES_USER: postgres
Expand Down
2 changes: 1 addition & 1 deletion blockscout-ens/bens-logic/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions eth-bytecode-db/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 libs/blockscout-service-launcher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion libs/blockscout-service-launcher/src/test_database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion service-template/.github/workflows/{{project-name}}.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
{%- if database %}
services:
postgres:
image: postgres
image: postgres:16
env:
POSTGRES_PASSWORD: admin
POSTGRES_USER: postgres
Expand Down

0 comments on commit 4cff309

Please sign in to comment.