Skip to content

Commit

Permalink
Disable testing in CICD for now
Browse files Browse the repository at this point in the history
  • Loading branch information
LandonTClipp committed Jan 2, 2025
1 parent 471d05e commit 1a4332e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
go-version: ${{ matrix.go_vers }}

- name: Download dependencies
run: go mod download -x
run: go mod download

- name: Test
run: go run github.com/go-task/task/v3/cmd/task test.ci
7 changes: 4 additions & 3 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on:
permissions:
contents: write
jobs:
test:
uses: ./.github/workflows/reusable-testing.yml
# TODO: temporarily disable testing during alpha development
#test:
# uses: ./.github/workflows/reusable-testing.yml
tag:
runs-on: ubuntu-latest
needs: test
#needs: test
outputs:
tag_result: ${{ steps.tag.outputs.tag_result }}
steps:
Expand Down
72 changes: 2 additions & 70 deletions cmd/mockery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
)

func TestNewRootCmd(t *testing.T) {
cmd := NewRootCmd()
cmd, err := NewRootCmd()
assert.NoError(t, err)
assert.Equal(t, "mockery", cmd.Name())
}

Expand Down Expand Up @@ -198,72 +199,3 @@ type FooInterface interface {
require.NoError(t, err)
assert.True(t, exists)
}

func TestRunLegacyNoConfig(t *testing.T) {
tmpDir := pathlib.NewPath(t.TempDir())

mockPath := tmpDir.Join("Foo.go")
codePath := tmpDir.Join("foo.go")
require.NoError(t, codePath.WriteFile([]byte(`
package test
type Foo interface {
Get(str string) string
}`)))

v := viper.New()
v.Set("log-level", "debug")
v.Set("outpkg", "foobar")
v.Set("name", "Foo")
v.Set("output", tmpDir.String())
v.Set("disable-config-search", true)
require.NoError(t, os.Chdir(tmpDir.String()))

v, err := getConfig(nil, configPath)
require.NoError(t, err)
app, err := GetRootAppFromViper(v)
require.NoError(t, err)
require.NoError(t, app.Run())

exists, err := mockPath.Exists()
require.NoError(t, err)
assert.True(t, exists)
}

func TestRunLegacyNoConfigDirSet(t *testing.T) {
tmpDir := pathlib.NewPath(t.TempDir())

subdir := tmpDir.Join("subdir")
require.NoError(t, subdir.MkdirAll())

mockPath := subdir.Join("Foo.go")
codePath := subdir.Join("foo.go")

err := codePath.WriteFile([]byte(`
package test
type Foo interface {
Get(str string) string
}`))
require.NoError(t, err, "failed to write go file")

v := viper.New()
v.Set("log-level", "debug")
v.Set("outpkg", "foobar")
v.Set("name", "Foo")
v.Set("output", subdir.String())
v.Set("disable-config-search", true)
v.Set("dir", subdir.String())
v.Set("recursive", true)
require.NoError(t, os.Chdir(tmpDir.String()))

v, err := getConfig(nil, configPath)
require.NoError(t, err)
app, err := GetRootAppFromViper(v)
require.NoError(t, err)
require.NoError(t, app.Run())

exists, err := mockPath.Exists()
require.NoError(t, err)
assert.True(t, exists)
}

0 comments on commit 1a4332e

Please sign in to comment.