Skip to content

Commit fcf3680

Browse files
Merge pull request #104 from Clever/go-modules
[automated] Migrate from dep to go mod
2 parents 33608f5 + 7880607 commit fcf3680

File tree

13 files changed

+150
-297
lines changed

13 files changed

+150
-297
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ jobs:
55
docker:
66
- image: circleci/golang:1.13-stretch
77
environment:
8+
GOPRIVATE: github.com/Clever/*
89
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
910
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
1011
steps:
@@ -16,6 +17,11 @@ jobs:
1617
- run:
1718
command: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
1819
name: Set up CircleCI artifacts directories
20+
- run:
21+
command: git config --global "url.ssh://git@github.com/Clever".insteadOf "https://github.com/Clever"
22+
- run:
23+
name: Add github.com to known hosts
24+
command: mkdir -p ~/.ssh && touch ~/.ssh/known_hosts && echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
1925
- run: make install_deps
2026
- run: make build
2127
- run: make test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
vendor/
1111
bin/
1212
release/
13-
gen-go/
13+
mocks/mock_*.go
1414
cmd/sfncli/sfncli

Gopkg.lock

Lines changed: 0 additions & 188 deletions
This file was deleted.

Gopkg.toml

Lines changed: 0 additions & 22 deletions
This file was deleted.

Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include golang.mk
22
.DEFAULT_GOAL := test # override default goal set in library makefile
33

44
SHELL := /bin/bash
5-
PKGS := $(shell go list ./... | grep -v /vendor)
5+
PKGS := $(shell go list ./... | grep -v /vendor | grep -v /tools)
66
VERSION := $(shell head -n 1 VERSION)
77
EXECUTABLE := sfncli
88
EXECUTABLE_PKG := github.com/Clever/sfncli/cmd/sfncli
@@ -37,11 +37,10 @@ clean:
3737

3838
mocks:
3939
mkdir -p bin
40-
go build -o ./bin/mockgen ./vendor/github.com/golang/mock/mockgen
41-
rm -rf gen-go/mocksfn && mkdir -p gen-go/mocksfn
42-
./bin/mockgen -source vendor/github.com/aws/aws-sdk-go/service/sfn/sfniface/interface.go -destination gen-go/mocksfn/mocksfn.go -package mocksfn
43-
rm -rf gen-go/mockcloudwatch && mkdir -p gen-go/mockcloudwatch
44-
./bin/mockgen -source vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go -destination gen-go/mockcloudwatch/mockcloudwatch.go -package mockcloudwatch
45-
46-
install_deps: golang-dep-vendor-deps
47-
$(call golang-dep-vendor)
40+
go build -o ./bin/mockgen github.com/golang/mock/mockgen
41+
rm -rf mocks/mock_*.go
42+
./bin/mockgen -source ./vendor/github.com/aws/aws-sdk-go/service/sfn/sfniface/interface.go -destination mocks/mock_sfn.go -package mocks
43+
./bin/mockgen -source ./vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go -destination mocks/mock_cloudwatch.go -package mocks
44+
45+
install_deps:
46+
go mod vendor

VERSION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
v0.6.0
1+
v0.7.0
2+
Migrate to go modules.

cmd/sfncli/cloudwatchreporter_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"testing"
99
"time"
1010

11-
"github.com/Clever/sfncli/gen-go/mockcloudwatch"
11+
"github.com/Clever/sfncli/mocks"
1212
"github.com/aws/aws-sdk-go/aws"
1313
"github.com/aws/aws-sdk-go/service/cloudwatch"
1414
"github.com/golang/mock/gomock"
@@ -21,7 +21,7 @@ func TestCloudWatchReporterReportsActiveZero(t *testing.T) {
2121
defer testCtxCancel()
2222
controller := gomock.NewController(t)
2323
defer controller.Finish()
24-
mockCW := mockcloudwatch.NewMockCloudWatchAPI(controller)
24+
mockCW := mocks.NewMockCloudWatchAPI(controller)
2525
cwr := NewCloudWatchReporter(mockCW, mockActivityArn)
2626
go cwr.ReportActivePercent(testCtx, 100*time.Millisecond)
2727
mockCW.EXPECT().PutMetricData(&cloudwatch.PutMetricDataInput{
@@ -44,7 +44,7 @@ func TestCloudWatchReporterReportsActiveFiftyPercent(t *testing.T) {
4444
defer testCtxCancel()
4545
controller := gomock.NewController(t)
4646
defer controller.Finish()
47-
mockCW := mockcloudwatch.NewMockCloudWatchAPI(controller)
47+
mockCW := mocks.NewMockCloudWatchAPI(controller)
4848
mockCW.EXPECT().PutMetricData(fuzzy(&cloudwatch.PutMetricDataInput{
4949
MetricData: []*cloudwatch.MetricDatum{{
5050
Dimensions: []*cloudwatch.Dimension{{
@@ -75,7 +75,7 @@ func TestCloudWatchReporterReportsActiveHundredPercent(t *testing.T) {
7575
defer testCtxCancel()
7676
controller := gomock.NewController(t)
7777
defer controller.Finish()
78-
mockCW := mockcloudwatch.NewMockCloudWatchAPI(controller)
78+
mockCW := mocks.NewMockCloudWatchAPI(controller)
7979
mockCW.EXPECT().PutMetricData(fuzzy(&cloudwatch.PutMetricDataInput{
8080
MetricData: []*cloudwatch.MetricDatum{{
8181
Dimensions: []*cloudwatch.Dimension{{
@@ -99,7 +99,7 @@ func TestCloudWatchReporterReportsActiveOneHundredPercentWhenPausedForever(t *te
9999
defer testCtxCancel()
100100
controller := gomock.NewController(t)
101101
defer controller.Finish()
102-
mockCW := mockcloudwatch.NewMockCloudWatchAPI(controller)
102+
mockCW := mocks.NewMockCloudWatchAPI(controller)
103103
mockCW.EXPECT().PutMetricData(fuzzy(&cloudwatch.PutMetricDataInput{
104104
MetricData: []*cloudwatch.MetricDatum{{
105105
Dimensions: []*cloudwatch.Dimension{{
@@ -137,7 +137,7 @@ func TestCloudWatchReporterReportsActiveOnehundredPercentWhenPaused(t *testing.T
137137
defer testCtxCancel()
138138
controller := gomock.NewController(t)
139139
defer controller.Finish()
140-
mockCW := mockcloudwatch.NewMockCloudWatchAPI(controller)
140+
mockCW := mocks.NewMockCloudWatchAPI(controller)
141141
mockCW.EXPECT().PutMetricData(fuzzy(&cloudwatch.PutMetricDataInput{
142142
MetricData: []*cloudwatch.MetricDatum{{
143143
Dimensions: []*cloudwatch.Dimension{{
@@ -173,7 +173,7 @@ func TestCloudWatchReporterReportsActiveFiftyPercentWhenPaused(t *testing.T) {
173173
defer testCtxCancel()
174174
controller := gomock.NewController(t)
175175
defer controller.Finish()
176-
mockCW := mockcloudwatch.NewMockCloudWatchAPI(controller)
176+
mockCW := mocks.NewMockCloudWatchAPI(controller)
177177
mockCW.EXPECT().PutMetricData(fuzzy(&cloudwatch.PutMetricDataInput{
178178
MetricData: []*cloudwatch.MetricDatum{{
179179
Dimensions: []*cloudwatch.Dimension{{

0 commit comments

Comments
 (0)