Skip to content

Commit

Permalink
fix: truncated tables in tests (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw authored Nov 30, 2020
1 parent 8a77932 commit 2e70747
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tasks/actorstate/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ func TestGenesisProcessor(t *testing.T) {
assert.NotEqual(t, 0, count)
})

t.Run("miner_powers", func(t *testing.T) {
t.Run("power_actor_claims", func(t *testing.T) {
var count int
_, err := db.QueryOne(pg.Scan(&count), `SELECT COUNT(*) FROM miner_powers`)
_, err := db.QueryOne(pg.Scan(&count), `SELECT COUNT(*) FROM power_actor_claims`)
require.NoError(t, err)
assert.NotEqual(t, 0, count)
})

t.Run("miner_states", func(t *testing.T) {
t.Run("miner_infos", func(t *testing.T) {
var count int
_, err := db.QueryOne(pg.Scan(&count), `SELECT COUNT(*) FROM miner_states`)
_, err := db.QueryOne(pg.Scan(&count), `SELECT COUNT(*) FROM miner_infos`)
require.NoError(t, err)
assert.NotEqual(t, 0, count)
})
Expand Down Expand Up @@ -125,8 +125,8 @@ func TestGenesisProcessor(t *testing.T) {
// truncateGenesisTables ensures the indexing tables are empty
func truncateGenesisTables(tb testing.TB, db *pg.DB) error {
tables := []string{
"miner_states",
"miner_powers",
"miner_infos",
"power_actor_claims",
"miner_sector_infos",
"miner_sector_deals",
"market_deal_states",
Expand Down
3 changes: 0 additions & 3 deletions tasks/indexer/chainheadindexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ func truncateBlockTables(tb testing.TB, db *pg.DB) error {
_, err = db.Exec(`TRUNCATE TABLE block_parents`)
require.NoError(tb, err, "block_parents")

_, err = db.Exec(`TRUNCATE TABLE drand_entries`)
require.NoError(tb, err, "drand_entries")

_, err = db.Exec(`TRUNCATE TABLE drand_block_entries`)
require.NoError(tb, err, "drand_block_entries")

Expand Down

0 comments on commit 2e70747

Please sign in to comment.