Skip to content

tapdb: fix aider mistakes and inconsistencies #1415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions tapdb/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func transformByteLiterals(t *testing.T, db *BaseDB, query string) string {
return query
}

// TestMigrationSteps is an example test that illustrates how to test database
// migrations by selectively applying only some migrations, inserting dummy data
// and then applying the remaining migrations.
func TestMigrationSteps(t *testing.T) {
Expand Down Expand Up @@ -330,24 +331,25 @@ func TestMigration29(t *testing.T) {
// Check universe_roots: the dummy row should keep its original
// proof_type.
var proofType string
err = db.QueryRowContext(ctx,
"SELECT proof_type FROM universe_roots WHERE id = 1").Scan(
&proofType,
)
err = db.QueryRowContext(ctx, `
SELECT proof_type FROM universe_roots WHERE id = 1
`).Scan(&proofType)
require.NoError(t, err)
require.Equal(t, "issuance", proofType)

// Check federation_global_sync_config dummy data.
err = db.QueryRowContext(ctx,
`SELECT proof_type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was actually my inconsistency lol. Got review feedback to limit the line length on the queries, and just kinda hacked away at it until things were in line.

FROM federation_global_sync_config LIMIT 1`).Scan(&proofType)
err = db.QueryRowContext(ctx, `
SELECT proof_type
FROM federation_global_sync_config LIMIT 1
`).Scan(&proofType)
require.NoError(t, err)
require.Equal(t, "transfer", proofType)

// Check federation_uni_sync_config dummy data.
err = db.QueryRowContext(ctx,
`SELECT proof_type
FROM federation_uni_sync_config LIMIT 1`).Scan(&proofType)
err = db.QueryRowContext(ctx, `
SELECT proof_type
FROM federation_uni_sync_config LIMIT 1
`).Scan(&proofType)
require.NoError(t, err)
require.Equal(t, "issuance", proofType)

Expand Down
Loading