Skip to content

Commit

Permalink
Fix import order (closes #175)
Browse files Browse the repository at this point in the history
  • Loading branch information
colmsnowplow committed Jul 22, 2022
1 parent 4baada2 commit 16d494d
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 16 deletions.
3 changes: 2 additions & 1 deletion pkg/source/sourceconfig/source_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"os"
"testing"

"github.com/stretchr/testify/assert"

config "github.com/snowplow-devops/stream-replicator/config"
"github.com/snowplow-devops/stream-replicator/pkg/source/sourceiface"
"github.com/stretchr/testify/assert"
)

func TestMain(m *testing.M) {
Expand Down
1 change: 1 addition & 0 deletions pkg/target/eventhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"

"github.com/snowplow-devops/stream-replicator/pkg/models"
)

Expand Down
5 changes: 3 additions & 2 deletions pkg/target/eventhub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import (

eventhub "github.com/Azure/azure-event-hubs-go/v3"
"github.com/pkg/errors"
"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/snowplow-devops/stream-replicator/pkg/testutil"
"github.com/stretchr/testify/assert"
"github.com/twinj/uuid"

"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/snowplow-devops/stream-replicator/pkg/testutil"
)

var cfg = EventHubConfig{
Expand Down
3 changes: 1 addition & 2 deletions pkg/target/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ import (
"net/url"
"time"

"github.com/snowplow-devops/stream-replicator/pkg/common"

"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"

"github.com/snowplow-devops/stream-replicator/pkg/common"
"github.com/snowplow-devops/stream-replicator/pkg/models"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/target/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import (
"sync/atomic"
"testing"

"github.com/stretchr/testify/assert"

"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/snowplow-devops/stream-replicator/pkg/testutil"
"github.com/stretchr/testify/assert"
)

func createTestServer(results *[][]byte, waitgroup *sync.WaitGroup) *httptest.Server {
Expand Down
3 changes: 1 addition & 2 deletions pkg/target/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import (
"strings"
"time"

"github.com/snowplow-devops/stream-replicator/pkg/common"

"github.com/Shopify/sarama"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/xdg/scram"

"github.com/snowplow-devops/stream-replicator/pkg/common"
"github.com/snowplow-devops/stream-replicator/pkg/models"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/target/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/Shopify/sarama"
"github.com/Shopify/sarama/mocks"
log "github.com/sirupsen/logrus"

"github.com/snowplow-devops/stream-replicator/pkg/testutil"
"github.com/stretchr/testify/assert"
)
Expand Down
5 changes: 3 additions & 2 deletions pkg/transform/snowplow_enriched_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ package transform

import (
"fmt"
"github.com/dlclark/regexp2"
"log"
"regexp"
"strings"
"time"

"github.com/dlclark/regexp2"

"github.com/pkg/errors"
"github.com/snowplow/snowplow-golang-analytics-sdk/analytics"

"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/snowplow/snowplow-golang-analytics-sdk/analytics"
)

func findSpEnrichedFilterValue(queriedField, parsedEventName, eventVer, field string, parsedMessage analytics.ParsedEvent, path []interface{}) ([]interface{}, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/transform/snowplow_enriched_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ package transform
import (
"testing"

"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/stretchr/testify/assert"

"github.com/snowplow-devops/stream-replicator/pkg/models"
)

func TestNewSpEnrichedFilterFunction(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/transform/snowplow_enriched_set_pk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ package transform
import (
"testing"

"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/stretchr/testify/assert"

"github.com/snowplow-devops/stream-replicator/pkg/models"
)

func TestNewSpEnrichedSetPkFunction(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/transform/snowplow_enriched_to_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ package transform
import (
"testing"

"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/stretchr/testify/assert"

"github.com/snowplow-devops/stream-replicator/pkg/models"
)

func TestSpEnrichedToJson(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/transform/snowplow_enriched_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ package transform
import (
"strconv"

"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/snowplow/snowplow-golang-analytics-sdk/analytics"

"github.com/snowplow-devops/stream-replicator/pkg/models"
)

// IntermediateAsSpEnrichedParsed returns the intermediate state as a ParsedEvent if valid or parses
Expand Down
1 change: 1 addition & 0 deletions pkg/transform/snowplow_enriched_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"

"github.com/snowplow-devops/stream-replicator/pkg/models"

"github.com/stretchr/testify/assert"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/transform/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
"testing"
"time"

"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/stretchr/testify/assert"

"github.com/snowplow-devops/stream-replicator/pkg/models"
)

// To test a function which creates a function, we're creating the function then testing that. Not sure if there's a better way?
Expand Down
3 changes: 2 additions & 1 deletion pkg/transform/transform_test_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
package transform

import (
"github.com/snowplow-devops/stream-replicator/pkg/models"
"github.com/snowplow/snowplow-golang-analytics-sdk/analytics"

"github.com/snowplow-devops/stream-replicator/pkg/models"
)

var snowplowTsv1 = []byte(`test-data1 pc 2019-05-10 14:40:37.436 2019-05-10 14:40:35.972 2019-05-10 14:40:35.551 unstruct e9234345-f042-46ad-b1aa-424464066a33 py-0.8.2 ssc-0.15.0-googlepubsub beam-enrich-0.2.0-common-0.36.0 user<built-in function input> 18.194.133.57 d26822f5-52cc-4292-8f77-14ef6b7a27e2 {"schema":"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0","data":{"schema":"iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0","data":{"sku":"item41","quantity":2,"unitPrice":32.4,"currency":"GBP"}}} python-requests/2.21.0 2019-05-10 14:40:35.000 {"schema":"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-1","data":[{"schema":"iglu:nl.basjes/yauaa_context/jsonschema/1-0-0","data":{"deviceBrand":"Unknown","deviceName":"Unknown","operatingSystemName":"Unknown","agentVersionMajor":"2","layoutEngineVersionMajor":"??","deviceClass":"Unknown","agentNameVersionMajor":"python-requests 2","operatingSystemClass":"Unknown","layoutEngineName":"Unknown","agentName":"python-requests","agentVersion":"2.21.0","layoutEngineClass":"Unknown","agentNameVersion":"python-requests 2.21.0","operatingSystemVersion":"??","agentClass":"Special","layoutEngineVersion":"??"}}]} 2019-05-10 14:40:35.972 com.snowplowanalytics.snowplow add_to_cart jsonschema 1-0-0 `)
Expand Down

0 comments on commit 16d494d

Please sign in to comment.