Skip to content

Commit 243b56b

Browse files
firewalldb: rename sqlStore to store in mig test
rename `sqlStore` to `store` in the firewalldb sql migration test file, to make the name shorted. This is done in preparation for future commits which will lengthen the lines where `sqlStore` is used, which otherwise would make the lines exceed the 80 character limit.
1 parent 01368d5 commit 243b56b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

firewalldb/sql_migration_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestFirewallDBMigration(t *testing.T) {
7575
// The assertMigrationResults function will currently assert that
7676
// the migrated kv stores entries in the SQLDB match the original kv
7777
// stores entries in the BoltDB.
78-
assertMigrationResults := func(t *testing.T, sqlStore *SQLDB,
78+
assertMigrationResults := func(t *testing.T, store *SQLDB,
7979
kvEntries []*kvEntry) {
8080

8181
var (
@@ -88,7 +88,7 @@ func TestFirewallDBMigration(t *testing.T) {
8888
getRuleID := func(ruleName string) int64 {
8989
ruleID, ok := ruleIDs[ruleName]
9090
if !ok {
91-
ruleID, err = sqlStore.GetRuleID(ctx, ruleName)
91+
ruleID, err = store.GetRuleID(ctx, ruleName)
9292
require.NoError(t, err)
9393

9494
ruleIDs[ruleName] = ruleID
@@ -100,7 +100,7 @@ func TestFirewallDBMigration(t *testing.T) {
100100
getGroupID := func(groupAlias []byte) int64 {
101101
groupID, ok := groupIDs[string(groupAlias)]
102102
if !ok {
103-
groupID, err = sqlStore.GetSessionIDByAlias(
103+
groupID, err = store.GetSessionIDByAlias(
104104
ctx, groupAlias,
105105
)
106106
require.NoError(t, err)
@@ -114,7 +114,7 @@ func TestFirewallDBMigration(t *testing.T) {
114114
getFeatureID := func(featureName string) int64 {
115115
featureID, ok := featureIDs[featureName]
116116
if !ok {
117-
featureID, err = sqlStore.GetFeatureID(
117+
featureID, err = store.GetFeatureID(
118118
ctx, featureName,
119119
)
120120
require.NoError(t, err)
@@ -128,7 +128,7 @@ func TestFirewallDBMigration(t *testing.T) {
128128
// First we extract all migrated kv entries from the SQLDB,
129129
// in order to be able to compare them to the original kv
130130
// entries, to ensure that the migration was successful.
131-
sqlKvEntries, err := sqlStore.ListAllKVStoresRecords(ctx)
131+
sqlKvEntries, err := store.ListAllKVStoresRecords(ctx)
132132
require.NoError(t, err)
133133
require.Equal(t, len(kvEntries), len(sqlKvEntries))
134134

@@ -144,7 +144,7 @@ func TestFirewallDBMigration(t *testing.T) {
144144
ruleID := getRuleID(entry.ruleName)
145145

146146
if entry.groupAlias.IsNone() {
147-
sqlVal, err := sqlStore.GetGlobalKVStoreRecord(
147+
sqlVal, err := store.GetGlobalKVStoreRecord(
148148
ctx,
149149
sqlc.GetGlobalKVStoreRecordParams{
150150
Key: entry.key,
@@ -162,7 +162,7 @@ func TestFirewallDBMigration(t *testing.T) {
162162
groupAlias := entry.groupAlias.UnwrapOrFail(t)
163163
groupID := getGroupID(groupAlias[:])
164164

165-
v, err := sqlStore.GetGroupKVStoreRecord(
165+
v, err := store.GetGroupKVStoreRecord(
166166
ctx,
167167
sqlc.GetGroupKVStoreRecordParams{
168168
Key: entry.key,
@@ -187,7 +187,7 @@ func TestFirewallDBMigration(t *testing.T) {
187187
entry.featureName.UnwrapOrFail(t),
188188
)
189189

190-
sqlVal, err := sqlStore.GetFeatureKVStoreRecord(
190+
sqlVal, err := store.GetFeatureKVStoreRecord(
191191
ctx,
192192
sqlc.GetFeatureKVStoreRecordParams{
193193
Key: entry.key,

0 commit comments

Comments
 (0)