Skip to content

Commit

Permalink
chore: change ownership of Ruby gRPC client to FND: PC (#484)
Browse files Browse the repository at this point in the history
* test: move Ruby specific tests to its own file for ownership reasons

* chore: change ownership of Ruby gRPC client to FND: PC
  • Loading branch information
malept authored Apr 15, 2024
1 parent 5bedf09 commit facafb1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 26 deletions.
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
* @getoutreach/fnd-dt

## <<Stencil::Block(customCodeowners)>>

templates/.snapshots/Test*Ruby*.snapshot @getoutreach/fnd-pc
templates/api/clients/ruby @getoutreach/fnd-pc
templates/ruby_test.go @getoutreach/fnd-pc
templates/testdata/tool-versions-ruby @getoutreach/fnd-pc
## <</Stencil::Block>>
25 changes: 0 additions & 25 deletions templates/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,31 +233,6 @@ func TestGRPCServerRPC(t *testing.T) {
st.Run(true)
}

func TestIncludeRubyToolVersionsIfRubyGRPCClient(t *testing.T) {
st := stenciltest.New(t, "testdata/tool-versions-ruby/.tool-versions.tpl", libraryTmpls...)
st.Args(map[string]interface{}{
"grpcClients": []interface{}{"ruby"},
})
st.Run(stenciltest.RegenerateSnapshots())
}

func TestIncludeRubyToolVersionsIfRubyGRPCClientLibrary(t *testing.T) {
// Need to use testdata because stenciltest cannot test file.Skip
st := stenciltest.New(t, "testdata/tool-versions-ruby/.tool-versions.tpl", libraryTmpls...)
st.Args(map[string]interface{}{
"grpcClients": []interface{}{"ruby"},
"service": false,
"serviceActivities": []interface{}{},
})
st.Run(stenciltest.RegenerateSnapshots())
}

func TestDontIncludeRubyToolVersionsIfNotRubyGRPCClient(t *testing.T) {
st := stenciltest.New(t, "testdata/tool-versions-ruby/.tool-versions.tpl", libraryTmpls...)
st.Args(map[string]interface{}{})
st.Run(stenciltest.RegenerateSnapshots())
}

func TestGoreleaserYml(t *testing.T) {
st := stenciltest.New(t, ".goreleaser.yml.tpl", libraryTmpls...)
st.Args(map[string]interface{}{
Expand Down
36 changes: 36 additions & 0 deletions templates/ruby_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2024 Outreach Corporation. All Rights Reserved.

// Description: Template tests specific to the Ruby gRPC client.

package main_test

import (
"testing"

"github.com/getoutreach/stencil/pkg/stenciltest"
)

func TestIncludeRubyToolVersionsIfRubyGRPCClient(t *testing.T) {
st := stenciltest.New(t, "testdata/tool-versions-ruby/.tool-versions.tpl", libraryTmpls...)
st.Args(map[string]interface{}{
"grpcClients": []interface{}{"ruby"},
})
st.Run(stenciltest.RegenerateSnapshots())
}

func TestIncludeRubyToolVersionsIfRubyGRPCClientLibrary(t *testing.T) {
// Need to use testdata because stenciltest cannot test file.Skip
st := stenciltest.New(t, "testdata/tool-versions-ruby/.tool-versions.tpl", libraryTmpls...)
st.Args(map[string]interface{}{
"grpcClients": []interface{}{"ruby"},
"service": false,
"serviceActivities": []interface{}{},
})
st.Run(stenciltest.RegenerateSnapshots())
}

func TestDontIncludeRubyToolVersionsIfNotRubyGRPCClient(t *testing.T) {
st := stenciltest.New(t, "testdata/tool-versions-ruby/.tool-versions.tpl", libraryTmpls...)
st.Args(map[string]interface{}{})
st.Run(stenciltest.RegenerateSnapshots())
}

0 comments on commit facafb1

Please sign in to comment.