Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bbengfort committed Nov 19, 2024
1 parent b11c00c commit fa8b09a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions pkg/bff/activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (s *bffTestSuite) TestActivitySubscriber() {
// Test running the subscriber under a waitgroup
conf.Topic = "network-activity"
conf.Testing = true
conf.Network = activity.TestNet
conf.Ensign = ensign.Config{
ClientID: "client-id",
ClientSecret: "client-secret",
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/activity/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestActivityValidation(t *testing.T) {

// Test valid enabled configuration
conf.Enabled = true
conf.Network = activity.TestNet
conf.Ensign.ClientID = "client-id"
require.NoError(t, conf.Validate())
}
3 changes: 0 additions & 3 deletions pkg/utils/activity/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ func (n Network) String() string {
}

// Check if the network is valid.
// NOTE: this method must be named Validate and not Validate to prevent confire from
// calling this function during validation. Configurations that use a Network should
// manually call Validate in their Validation method.
func (n Network) Validate() error {
if n == UnknownNetwork {
return ErrUnknownNetwork
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/activity/publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestPublisher(t *testing.T) {
Enabled: true,
AggregationWindow: time.Minute * 5,
}
require.ErrorIs(t, activity.ErrMissingTopic, activity.Start(conf), "expected missing topic error")
require.Error(t, activity.Start(conf), "expected error with bad configuration")

// Test publisher in disabled mode starts
activity.Reset()
Expand Down
3 changes: 0 additions & 3 deletions pkg/utils/ensign/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ type Config struct {
}

// Validate that the ensign config is ready for connection.
// NOTE: This must be Validate() and not Validate() to prevent confire from calling
// this function to check if the configuration is valid. Configurations that embed an
// ensign configuration should manually call Validate in their Validation method.
func (c Config) Validate() (err error) {
if c.Testing {
return nil
Expand Down

0 comments on commit fa8b09a

Please sign in to comment.