-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
498 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package env | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/xavidop/dialogflow-cx-test-runner/cmd/cmdutils" | ||
"github.com/xavidop/dialogflow-cx-test-runner/internal/global" | ||
"github.com/xavidop/dialogflow-cx-test-runner/pkg/test" | ||
) | ||
|
||
// testCmd represents the test root command | ||
var executeCmd = &cobra.Command{ | ||
Use: "execute", | ||
Aliases: []string{"execute", "e", "exe", "exec"}, | ||
Short: "Execute a suite", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
suite, _ := cmd.Flags().GetString("suite") | ||
|
||
if err := test.ExecuteSuite(suite); err != nil { | ||
global.Log.Errorf(err.Error()) | ||
os.Exit(1) | ||
} | ||
}, | ||
PersistentPreRun: func(cmd *cobra.Command, args []string) { | ||
cmdutils.PreRun(cmd.Name()) | ||
}, | ||
PersistentPostRun: func(cmd *cobra.Command, args []string) { | ||
}, | ||
} | ||
|
||
func init() { | ||
testCmd.AddCommand(executeCmd) | ||
|
||
executeCmd.Flags().StringP("suite", "s", "suite.yaml", "Suite yaml file") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Example Suite | ||
description: Suite used as an example | ||
projectId: test-cx-346408 | ||
locationId: us-central1 | ||
agent: test-agent | ||
tests: | ||
- id: test_1 | ||
file: ./tests/test_1.yaml | ||
- id: test_2 | ||
file: ./tests/test_2.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Example test | ||
description: These are some tests | ||
localeId: en | ||
checks: | ||
- id: test_1_1 | ||
input: hi | ||
validate: | ||
intent: hi_intent | ||
|
||
- id: test_1_2 | ||
input: hello | ||
validate: | ||
intent: hi_intent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Example test | ||
description: These are some tests | ||
localeId: en | ||
checks: | ||
- id: test_2_1 | ||
input: I want 3 pizzas | ||
validate: | ||
intent: order_intent | ||
parameters: | ||
- parameter: number | ||
value: 3 | ||
- parameter: order_type | ||
value: pizza | ||
|
||
- id: test_2_2 | ||
input: I want 2 cokes | ||
validate: | ||
intent: order_intent | ||
parameters: | ||
- parameter: number | ||
value: 2 | ||
- parameter: order_type | ||
value: coke | ||
- parameter: dasdas | ||
value: coke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package types | ||
|
||
type Check struct { | ||
ID string `yaml:"id"` | ||
Input string `yaml:"input"` | ||
Validate Validate `yaml:"validate"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package types | ||
|
||
type Parameter struct { | ||
Parameter string `yaml:"parameter"` | ||
Value string `yaml:"value"` | ||
} |
Oops, something went wrong.