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

Commit

Permalink
Merge pull request #11 from rande/remove_test_function_from_main_code
Browse files Browse the repository at this point in the history
feat(test): remove testing helper functions from the main code
  • Loading branch information
rande authored Jun 13, 2018
2 parents 60438a1 + a2b1681 commit b121ece
Show file tree
Hide file tree
Showing 31 changed files with 182 additions and 145 deletions.
5 changes: 3 additions & 2 deletions cli/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package main

import (
"os"

"github.com/mitchellh/cli"
"github.com/rande/gitlab-ci-helper/commands"
"github.com/rande/gitlab-ci-helper/integrations/flowdock"
"github.com/rande/gitlab-ci-helper/integrations/hipchat"
"os"
)

var (
Expand Down
7 changes: 4 additions & 3 deletions commands/ci_dump_meta.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -9,10 +9,11 @@ import (
"bytes"
"encoding/json"
"flag"
"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"os"
"strings"

"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
)

type MetaBuild struct {
Expand Down
9 changes: 5 additions & 4 deletions commands/ci_dump_meta_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -8,12 +8,13 @@ package commands
import (
"encoding/json"
"fmt"
"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
"net/http/httptest"
"os"
"testing"

"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
)

func Test_Ci_Dump_Meta(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions commands/ci_dump_revision.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -7,10 +7,11 @@ package commands

import (
"flag"
"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"os"
"strings"

"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
)

type CiDumpRevisionCommand struct {
Expand Down
9 changes: 5 additions & 4 deletions commands/ci_dump_revision_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -7,13 +7,14 @@ package commands

import (
"fmt"
"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
"io/ioutil"
"net/http/httptest"
"os"
"testing"

"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
)

func Test_Ci_Dump_Revision(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions commands/dump_readme.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -8,9 +8,10 @@ package commands
import (
"flag"
"fmt"
"github.com/mitchellh/cli"
"sort"
"strings"

"github.com/mitchellh/cli"
)

type DumpReadmeCommand struct {
Expand Down
5 changes: 3 additions & 2 deletions commands/dump_readme_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package commands

import (
"testing"

"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
"testing"
)

func Test_Dump_Readme(t *testing.T) {
Expand Down
9 changes: 5 additions & 4 deletions commands/project_build_artifacts.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -8,13 +8,14 @@ package commands
import (
"flag"
"fmt"
"github.com/mitchellh/cli"
gitlab "github.com/plouc/go-gitlab-client"
helper "github.com/rande/gitlab-ci-helper"
"io"
"os"
"strconv"
"strings"

"github.com/mitchellh/cli"
gitlab "github.com/plouc/go-gitlab-client"
helper "github.com/rande/gitlab-ci-helper"
)

type ProjectBuildArtifactCommand struct {
Expand Down
9 changes: 5 additions & 4 deletions commands/project_build_artifacts_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package commands

import (
"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
"net/http"
"net/http/httptest"
"os"
"testing"

"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
)

func Test_Project_Builds_Artifacts(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions commands/project_builds_list.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -8,11 +8,12 @@ package commands
import (
"flag"
"fmt"
"strconv"
"strings"

"github.com/mitchellh/cli"
gitlab "github.com/plouc/go-gitlab-client"
helper "github.com/rande/gitlab-ci-helper"
"strconv"
"strings"
)

var (
Expand Down
9 changes: 5 additions & 4 deletions commands/project_builds_list_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package commands

import (
"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
"net/http"
"net/http/httptest"
"os"
"testing"

"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
)

func Test_Project_BuildsList_From_Args(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions commands/project_list.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -8,10 +8,11 @@ package commands
import (
"flag"
"fmt"
"strings"

"github.com/mitchellh/cli"
gitlab "github.com/plouc/go-gitlab-client"
helper "github.com/rande/gitlab-ci-helper"
"strings"
)

type ProjectsListCommand struct {
Expand Down
9 changes: 5 additions & 4 deletions commands/project_list_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package commands

import (
"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
"net/http"
"net/http/httptest"
"os"
"testing"

"github.com/mitchellh/cli"
helper "github.com/rande/gitlab-ci-helper"
"github.com/stretchr/testify/assert"
)

func Test_Project_List(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion commands/s3_archive.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand Down
5 changes: 3 additions & 2 deletions commands/s3_archive_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package commands

import (
"testing"

"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
"testing"
)

func Test_S3ArchiveCommand_Help(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion commands/s3_extract.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand Down
5 changes: 3 additions & 2 deletions commands/s3_extract_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package commands

import (
"testing"

"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
"testing"
)

func Test_S3ExtractCommand_Help(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions commands/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand All @@ -8,8 +8,9 @@ package commands
import (
"flag"
"fmt"
"github.com/mitchellh/cli"
"strings"

"github.com/mitchellh/cli"
)

type VersionCommand struct {
Expand Down
5 changes: 3 additions & 2 deletions commands/version_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package commands

import (
"testing"

"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
"testing"
)

func Test_Version(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2016 Thomas Rabaix <thomas.rabaix@gmail.com>.
// Copyright © 2016-present Thomas Rabaix <thomas.rabaix@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
Expand Down
Loading

0 comments on commit b121ece

Please sign in to comment.