Skip to content

Commit f0a5c2f

Browse files
aceppaluniryjones
authored andcommitted
Removed calls to reset
Signed-off-by: Angelina <aceppaluni@gmail.com> Signed-off-by: Ry Jones <ry@linux.com>
1 parent b3b5b2c commit f0a5c2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3
-161
lines changed

cmd/firefly.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ func init() {
8383
}
8484

8585
func resetConfig() {
86-
coreconfig.Reset()
8786
namespace.InitConfig()
8887
apiserver.InitConfig()
8988
}

doc-site/config_docs_generate_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434

3535
func TestGenerateConfigDocs(t *testing.T) {
3636
// Initialize config of all plugins
37-
coreconfig.Reset()
3837
namespace.InitConfig()
3938
apiserver.InitConfig()
4039
f, err := os.Create(filepath.Join("docs", "reference", "config.md"))

doc-site/config_docs_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535

3636
func TestConfigDocsUpToDate(t *testing.T) {
3737
// Initialize config of all plugins
38-
coreconfig.Reset()
3938
namespace.InitConfig()
4039
apiserver.InitConfig()
4140
generatedConfig, err := config.GenerateConfigMarkdown(context.Background(), configDocHeader, config.GetKnownKeys())

internal/apiserver/server_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import (
5353
const configDir = "../../test/data/config"
5454

5555
func newTestServer() (*namespacemocks.Manager, *orchestratormocks.Orchestrator, *apiServer) {
56-
coreconfig.Reset()
5756
InitConfig()
5857
mgr := &namespacemocks.Manager{}
5958
o := &orchestratormocks.Orchestrator{}
@@ -81,7 +80,6 @@ func newTestSPIServer() (*orchestratormocks.Orchestrator, *mux.Router) {
8180
}
8281

8382
func TestStartStopServer(t *testing.T) {
84-
coreconfig.Reset()
8583
metrics.Clear()
8684
InitConfig()
8785
apiConfig.Set(httpserver.HTTPConfPort, 0)
@@ -100,7 +98,6 @@ func TestStartStopServer(t *testing.T) {
10098
}
10199

102100
func TestStartLegacyAdminConfig(t *testing.T) {
103-
coreconfig.Reset()
104101
metrics.Clear()
105102
InitConfig()
106103
apiConfig.Set(httpserver.HTTPConfPort, 0)
@@ -119,7 +116,6 @@ func TestStartLegacyAdminConfig(t *testing.T) {
119116
}
120117

121118
func TestStartAPIFail(t *testing.T) {
122-
coreconfig.Reset()
123119
metrics.Clear()
124120
InitConfig()
125121
apiConfig.Set(httpserver.HTTPConfAddress, "...://")
@@ -132,7 +128,6 @@ func TestStartAPIFail(t *testing.T) {
132128
}
133129

134130
func TestStartAdminFail(t *testing.T) {
135-
coreconfig.Reset()
136131
metrics.Clear()
137132
InitConfig()
138133
spiConfig.Set(httpserver.HTTPConfAddress, "...://")
@@ -148,7 +143,6 @@ func TestStartAdminFail(t *testing.T) {
148143
}
149144

150145
func TestStartAdminWSHandler(t *testing.T) {
151-
coreconfig.Reset()
152146
metrics.Clear()
153147
InitConfig()
154148
spiConfig.Set(httpserver.HTTPConfAddress, "...://")
@@ -167,7 +161,6 @@ func TestStartAdminWSHandler(t *testing.T) {
167161
}
168162

169163
func TestStartMetricsFail(t *testing.T) {
170-
coreconfig.Reset()
171164
metrics.Clear()
172165
InitConfig()
173166
metricsConfig.Set(httpserver.HTTPConfAddress, "...://")

internal/apiserver/swagger_check_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
)
3939

4040
func TestDiffSwaggerYAML(t *testing.T) {
41-
coreconfig.Reset()
4241
config.Set(coreconfig.APIOASPanicOnMissingDescription, true)
4342
as := &apiServer{}
4443
hf := as.handlerFactory()

internal/apiserver/swagger_generate_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
)
3838

3939
func TestDownloadSwaggerYAML(t *testing.T) {
40-
coreconfig.Reset()
4140
config.Set(coreconfig.APIOASPanicOnMissingDescription, true)
4241
as := &apiServer{}
4342
hf := as.handlerFactory()

internal/assets/manager_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ func newTestAssetsWithMetrics(t *testing.T) (*assetManager, func()) {
5353
}
5454

5555
func newTestAssetsCommon(t *testing.T, metrics bool) (*assetManager, func()) {
56-
coreconfig.Reset()
5756
mdi := &databasemocks.Plugin{}
5857
mim := &identitymanagermocks.Manager{}
5958
mdm := &datamocks.Manager{}
@@ -91,7 +90,6 @@ func TestInitFail(t *testing.T) {
9190

9291
func TestCacheInitFail(t *testing.T) {
9392
cacheInitError := errors.New("Initialization error.")
94-
coreconfig.Reset()
9593
mdi := &databasemocks.Plugin{}
9694
mdm := &datamocks.Manager{}
9795
mim := &identitymanagermocks.Manager{}
@@ -163,7 +161,6 @@ func TestGetTokenConnectors(t *testing.T) {
163161
}
164162

165163
func TestStart(t *testing.T) {
166-
coreconfig.Reset()
167164
mdi := &databasemocks.Plugin{}
168165
mdm := &datamocks.Manager{}
169166
mim := &identitymanagermocks.Manager{}
@@ -193,7 +190,6 @@ func TestStart(t *testing.T) {
193190
}
194191

195192
func TestStartDBError(t *testing.T) {
196-
coreconfig.Reset()
197193
mdi := &databasemocks.Plugin{}
198194
mdm := &datamocks.Manager{}
199195
mim := &identitymanagermocks.Manager{}
@@ -216,7 +212,6 @@ func TestStartDBError(t *testing.T) {
216212
}
217213

218214
func TestStartError(t *testing.T) {
219-
coreconfig.Reset()
220215
mdi := &databasemocks.Plugin{}
221216
mdm := &datamocks.Manager{}
222217
mim := &identitymanagermocks.Manager{}

internal/batch/batch_manager_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import (
4040
)
4141

4242
func testConfigReset() {
43-
coreconfig.Reset()
4443
config.Set(coreconfig.BatchManagerMinimumPollDelay, "0")
4544
log.SetLevel("debug")
4645
}

internal/batch/batch_processor_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ func (tce *testConflictError) IsConflictError() bool {
8989

9090
func TestUnfilledBatch(t *testing.T) {
9191
log.SetLevel("debug")
92-
coreconfig.Reset()
9392

9493
dispatched := make(chan *DispatchPayload)
9594
cancel, mdi, bp := newTestBatchProcessor(t, func(c context.Context, state *DispatchPayload) error {
@@ -154,7 +153,6 @@ func TestHandleDispatchConflictError(t *testing.T) {
154153

155154
func TestBatchSizeOverflow(t *testing.T) {
156155
log.SetLevel("debug")
157-
coreconfig.Reset()
158156

159157
dispatched := make(chan *DispatchPayload)
160158
cancel, mdi, bp := newTestBatchProcessor(t, func(c context.Context, state *DispatchPayload) error {
@@ -553,7 +551,6 @@ func TestStartQuiesceNonBlocking(t *testing.T) {
553551

554552
func TestMarkMessageDispatchedUnpinnedOK(t *testing.T) {
555553
log.SetLevel("debug")
556-
coreconfig.Reset()
557554

558555
dispatched := make(chan *DispatchPayload)
559556
cancel, mdi, bp := newTestBatchProcessor(t, func(c context.Context, state *DispatchPayload) error {
@@ -611,7 +608,6 @@ func TestMarkMessageDispatchedUnpinnedOK(t *testing.T) {
611608

612609
func TestMaskContextsRetryAfterPinsAssigned(t *testing.T) {
613610
log.SetLevel("debug")
614-
coreconfig.Reset()
615611

616612
dispatched := make(chan *DispatchPayload)
617613
cancel, mdi, bp := newTestBatchProcessor(t, func(c context.Context, state *DispatchPayload) error {
@@ -681,7 +677,6 @@ func TestMaskContextsRetryAfterPinsAssigned(t *testing.T) {
681677

682678
func TestMaskContextsUpdateMessageFail(t *testing.T) {
683679
log.SetLevel("debug")
684-
coreconfig.Reset()
685680

686681
dispatched := make(chan *DispatchPayload)
687682
cancel, mdi, bp := newTestBatchProcessor(t, func(c context.Context, state *DispatchPayload) error {
@@ -720,7 +715,6 @@ func TestMaskContextsUpdateMessageFail(t *testing.T) {
720715
}
721716

722717
func TestSealBatchTXAlreadyAssigned(t *testing.T) {
723-
coreconfig.Reset()
724718

725719
dispatched := make(chan *DispatchPayload)
726720
cancel, mdi, bp := newTestBatchProcessor(t, func(c context.Context, state *DispatchPayload) error {
@@ -831,7 +825,6 @@ func TestCalculateContextsLoadPinsFail(t *testing.T) {
831825

832826
func TestBigBatchEstimate(t *testing.T) {
833827
log.SetLevel("debug")
834-
coreconfig.Reset()
835828

836829
bd := []byte(`{
837830
"id": "37ba893b-fcfa-4cf9-8ce8-34cd8bc9bc72",

internal/blockchain/ethereum/address_resolver_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
)
4040

4141
func utAddresResolverConfig() config.Section {
42-
coreconfig.Reset()
4342
config := config.RootSection("utaddressresovler")
4443
(&Ethereum{}).InitConfig(config)
4544
return config.SubSection(AddressResolverConfigKey)

0 commit comments

Comments
 (0)