Skip to content

Commit

Permalink
Fix failing tests in github
Browse files Browse the repository at this point in the history
  • Loading branch information
darunrs committed Oct 5, 2023
1 parent 507b214 commit 498ff1f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions indexer/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions runner/src/indexer/indexer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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
Expand All @@ -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" (
Expand Down
2 changes: 1 addition & 1 deletion runner/src/indexer/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class Indexer {
provisioner: new Provisioner(),
DmlHandler,
parser: new Parser(),
redisClient: new RedisClient(),
redisClient: deps?.redisClient ?? new RedisClient(),
...deps,
};
}
Expand Down

0 comments on commit 498ff1f

Please sign in to comment.