Skip to content
This repository was archived by the owner on Feb 7, 2020. It is now read-only.

Commit b121ece

Browse files
authored
Merge pull request #11 from rande/remove_test_function_from_main_code
feat(test): remove testing helper functions from the main code
2 parents 60438a1 + a2b1681 commit b121ece

31 files changed

+182
-145
lines changed

cli/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
55

66
package main
77

88
import (
9+
"os"
10+
911
"github.com/mitchellh/cli"
1012
"github.com/rande/gitlab-ci-helper/commands"
1113
"github.com/rande/gitlab-ci-helper/integrations/flowdock"
1214
"github.com/rande/gitlab-ci-helper/integrations/hipchat"
13-
"os"
1415
)
1516

1617
var (

commands/ci_dump_meta.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
@@ -9,10 +9,11 @@ import (
99
"bytes"
1010
"encoding/json"
1111
"flag"
12-
"github.com/mitchellh/cli"
13-
helper "github.com/rande/gitlab-ci-helper"
1412
"os"
1513
"strings"
14+
15+
"github.com/mitchellh/cli"
16+
helper "github.com/rande/gitlab-ci-helper"
1617
)
1718

1819
type MetaBuild struct {

commands/ci_dump_meta_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
@@ -8,12 +8,13 @@ package commands
88
import (
99
"encoding/json"
1010
"fmt"
11-
"github.com/mitchellh/cli"
12-
helper "github.com/rande/gitlab-ci-helper"
13-
"github.com/stretchr/testify/assert"
1411
"net/http/httptest"
1512
"os"
1613
"testing"
14+
15+
"github.com/mitchellh/cli"
16+
helper "github.com/rande/gitlab-ci-helper"
17+
"github.com/stretchr/testify/assert"
1718
)
1819

1920
func Test_Ci_Dump_Meta(t *testing.T) {

commands/ci_dump_revision.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
@@ -7,10 +7,11 @@ package commands
77

88
import (
99
"flag"
10-
"github.com/mitchellh/cli"
11-
helper "github.com/rande/gitlab-ci-helper"
1210
"os"
1311
"strings"
12+
13+
"github.com/mitchellh/cli"
14+
helper "github.com/rande/gitlab-ci-helper"
1415
)
1516

1617
type CiDumpRevisionCommand struct {

commands/ci_dump_revision_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
@@ -7,13 +7,14 @@ package commands
77

88
import (
99
"fmt"
10-
"github.com/mitchellh/cli"
11-
helper "github.com/rande/gitlab-ci-helper"
12-
"github.com/stretchr/testify/assert"
1310
"io/ioutil"
1411
"net/http/httptest"
1512
"os"
1613
"testing"
14+
15+
"github.com/mitchellh/cli"
16+
helper "github.com/rande/gitlab-ci-helper"
17+
"github.com/stretchr/testify/assert"
1718
)
1819

1920
func Test_Ci_Dump_Revision(t *testing.T) {

commands/dump_readme.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
@@ -8,9 +8,10 @@ package commands
88
import (
99
"flag"
1010
"fmt"
11-
"github.com/mitchellh/cli"
1211
"sort"
1312
"strings"
13+
14+
"github.com/mitchellh/cli"
1415
)
1516

1617
type DumpReadmeCommand struct {

commands/dump_readme_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
55

66
package commands
77

88
import (
9+
"testing"
10+
911
"github.com/mitchellh/cli"
1012
"github.com/stretchr/testify/assert"
11-
"testing"
1213
)
1314

1415
func Test_Dump_Readme(t *testing.T) {

commands/project_build_artifacts.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
@@ -8,13 +8,14 @@ package commands
88
import (
99
"flag"
1010
"fmt"
11-
"github.com/mitchellh/cli"
12-
gitlab "github.com/plouc/go-gitlab-client"
13-
helper "github.com/rande/gitlab-ci-helper"
1411
"io"
1512
"os"
1613
"strconv"
1714
"strings"
15+
16+
"github.com/mitchellh/cli"
17+
gitlab "github.com/plouc/go-gitlab-client"
18+
helper "github.com/rande/gitlab-ci-helper"
1819
)
1920

2021
type ProjectBuildArtifactCommand struct {

commands/project_build_artifacts_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
55

66
package commands
77

88
import (
9-
"github.com/mitchellh/cli"
10-
helper "github.com/rande/gitlab-ci-helper"
11-
"github.com/stretchr/testify/assert"
129
"net/http"
1310
"net/http/httptest"
1411
"os"
1512
"testing"
13+
14+
"github.com/mitchellh/cli"
15+
helper "github.com/rande/gitlab-ci-helper"
16+
"github.com/stretchr/testify/assert"
1617
)
1718

1819
func Test_Project_Builds_Artifacts(t *testing.T) {

commands/project_builds_list.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2016 Thomas Rabaix <[email protected]>.
1+
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
22
//
33
// Use of this source code is governed by an MIT-style
44
// license that can be found in the LICENSE file.
@@ -8,11 +8,12 @@ package commands
88
import (
99
"flag"
1010
"fmt"
11+
"strconv"
12+
"strings"
13+
1114
"github.com/mitchellh/cli"
1215
gitlab "github.com/plouc/go-gitlab-client"
1316
helper "github.com/rande/gitlab-ci-helper"
14-
"strconv"
15-
"strings"
1617
)
1718

1819
var (

0 commit comments

Comments
 (0)