mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-29 17:28:05 -05:00
Compare commits
1 Commits
kvg-exampl
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c9765f1fb |
@@ -906,7 +906,7 @@ steps:
|
||||
tar -C /usr/local -xzf go.tar.gz
|
||||
export PATH="/usr/local/go/bin:$$PATH"
|
||||
|
||||
go test -v ./internal/sources/oracle/... \
|
||||
go test -v ./tests/oracle/... \
|
||||
-coverprofile=oracle_coverage.out \
|
||||
-coverpkg=./internal/sources/oracle/...,./internal/tools/oracle/...
|
||||
|
||||
@@ -914,8 +914,8 @@ steps:
|
||||
total_coverage=$(go tool cover -func=oracle_coverage.out | grep "total:" | awk '{print $3}')
|
||||
echo "Oracle total coverage: $total_coverage"
|
||||
coverage_numeric=$(echo "$total_coverage" | sed 's/%//')
|
||||
if awk -v cov="$coverage_numeric" 'BEGIN {exit !(cov < 20)}'; then
|
||||
echo "Coverage failure: $total_coverage is below 20%."
|
||||
if awk -v cov="$coverage_numeric" 'BEGIN {exit !(cov < 60)}'; then
|
||||
echo "Coverage failure: $total_coverage is below 60%."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
// Copyright 2026 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func newInvokeCmd(root *Command) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "invoke",
|
||||
Short: "Invoke a tool",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
invoke(root)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func invoke(cmd *Command) {
|
||||
fmt.Println("Hello, World! Here is one of my flags" + cmd.cfg.Address)
|
||||
}
|
||||
@@ -396,8 +396,6 @@ func NewCommand(opts ...Option) *Command {
|
||||
// wrap RunE command so that we have access to original Command object
|
||||
cmd.RunE = func(*cobra.Command, []string) error { return run(cmd) }
|
||||
|
||||
baseCmd.AddCommand(newInvokeCmd(cmd))
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user