From 498ff1f072290dd81a4455e31e385e567989ab4f Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Thu, 5 Oct 2023 11:01:13 -0700 Subject: [PATCH] Fix failing tests in github --- indexer/storage/src/lib.rs | 10 +++++----- runner/src/indexer/indexer.test.ts | 6 +++--- runner/src/indexer/indexer.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/indexer/storage/src/lib.rs b/indexer/storage/src/lib.rs index cf6c21432..5d0557b11 100644 --- a/indexer/storage/src/lib.rs +++ b/indexer/storage/src/lib.rs @@ -62,7 +62,7 @@ pub async fn set( } else { exp_to_print = "".to_string(); } - + cmd.query_async(&mut redis_connection_manager.clone()) .await?; tracing::debug!(target: STORAGE, "SET: {:?}: {:?} {:?}", key, value, exp_to_print); @@ -174,10 +174,10 @@ pub async fn update_last_indexed_block( block_height: u64, ) -> anyhow::Result<()> { set( - redis_connection_manager, - "last_indexed_block", - block_height, - None + redis_connection_manager, + "last_indexed_block", + block_height, + None, ) .await?; redis::cmd("INCR") diff --git a/runner/src/indexer/indexer.test.ts b/runner/src/indexer/indexer.test.ts index 31faeba83..38f9ce77c 100644 --- a/runner/src/indexer/indexer.test.ts +++ b/runner/src/indexer/indexer.test.ts @@ -550,7 +550,7 @@ CREATE TABLE }); test('GetTables works for a variety of input schemas', async () => { - const indexer = new Indexer('mainnet'); + const indexer = new Indexer('mainnet', { redisClient: transparentRedis }); const simpleSchemaTables = indexer.getTableNames(SIMPLE_SCHEMA); expect(simpleSchemaTables).toStrictEqual(['posts']); @@ -590,7 +590,7 @@ CREATE TABLE }); test('SanitizeTableName works properly on many test cases', async () => { - const indexer = new Indexer('mainnet'); + const indexer = new Indexer('mainnet', { redisClient: transparentRedis }); expect(indexer.sanitizeTableName('table_name')).toStrictEqual('TableName'); expect(indexer.sanitizeTableName('tablename')).toStrictEqual('Tablename'); // name is not capitalized @@ -605,7 +605,7 @@ CREATE TABLE }); test('indexer fails to build context.db due to collision on sanitized table names', async () => { - const indexer = new Indexer('mainnet'); + const indexer = new Indexer('mainnet', { redisClient: transparentRedis }); const schemaWithDuplicateSanitizedTableNames = `CREATE TABLE "test table" ( diff --git a/runner/src/indexer/indexer.ts b/runner/src/indexer/indexer.ts index 248f27960..e866652b2 100644 --- a/runner/src/indexer/indexer.ts +++ b/runner/src/indexer/indexer.ts @@ -51,7 +51,7 @@ export default class Indexer { provisioner: new Provisioner(), DmlHandler, parser: new Parser(), - redisClient: new RedisClient(), + redisClient: deps?.redisClient ?? new RedisClient(), ...deps, }; }