Skip to content

Commit

Permalink
Merge pull request #14 from akamai/release/1.0.0
Browse files Browse the repository at this point in the history
Cli-test-center GA Release 1.0.0
  • Loading branch information
rakayada authored Oct 3, 2023
2 parents 9e6529d + 033a149 commit 8101c70
Show file tree
Hide file tree
Showing 99 changed files with 9,090 additions and 5,112 deletions.
660 changes: 452 additions & 208 deletions README.md

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions cli.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"requirements": {
"go": "1.15"
},
"commands": [{
"name": "test-center",
"version": "0.2.0",
"description": "Test Center is a testing tool that checks the effect of configuration changes on your web property. Use this tool as part of your testing protocol to increase your confidence in the safety and accuracy of your configuration changes.",
"bin": "https://github.com/akamai/cli-test-center/releases/download/{{.Version}}/akamai-{{.Name}}-{{.Version}}-{{.OS}}{{.Arch}}{{.BinSuffix}}"
}]
"requirements": {
"go": ">=1.15"
},
"commands": [
{
"name": "test-center",
"version": "1.0.0",
"description": "Test Center is a testing tool that checks the effect of configuration changes on your web property. Use this tool as part of your testing protocol to increase your confidence in the safety and accuracy of your configuration changes.",
"bin": "https://github.com/akamai/cli-test-center/releases/download/{{.Version}}/akamai-{{.Name}}-{{.Version}}-{{.OS}}{{.Arch}}{{.BinSuffix}}"
}
]
}
129 changes: 0 additions & 129 deletions cmd/command_usage_and_example_constants.go

This file was deleted.

26 changes: 26 additions & 0 deletions cmd/condition.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cmd

import (
internalconstant "github.com/akamai/cli-test-center/internal/constant"
"github.com/akamai/cli-test-center/internal/util"
"github.com/akamai/cli-test-center/internal/validator"
externalconstant "github.com/akamai/cli-test-center/user/constant"
"github.com/spf13/cobra"
)

var condCmd = &cobra.Command{
Use: externalconstant.ConditionUse,
Aliases: []string{externalconstant.ConditionCommandAliases},
Run: func(cmd *cobra.Command, args []string) {
globalValidator := validator.NewGlobalValidator(cmd, jsonData)
// validate subcommand
globalValidator.ValidateParentSubCommands(cmd, args, false)
},
}

func init() {
rootCmd.AddCommand(condCmd)

condCmd.Short = util.GetMessageForKey(condCmd, internalconstant.Short)
condCmd.Long = util.GetMessageForKey(condCmd, internalconstant.Long)
}
34 changes: 34 additions & 0 deletions cmd/condition_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package cmd

import (
"github.com/akamai/cli-test-center/internal/api"
internalconstant "github.com/akamai/cli-test-center/internal/constant"
"github.com/akamai/cli-test-center/internal/service"
"github.com/akamai/cli-test-center/internal/util"
"github.com/akamai/cli-test-center/internal/validator"
externalconstant "github.com/akamai/cli-test-center/user/constant"
"github.com/spf13/cobra"
)

var condListCmd = &cobra.Command{
Use: externalconstant.ConditionListUse,
Example: externalconstant.ConditionListExample,
Aliases: []string{externalconstant.ConditionListCommandAliases},
Run: func(cmd *cobra.Command, args []string) {
eghc := api.NewEdgeGridHttpClient(config, accountSwitchKey)
api := api.NewApiClient(*eghc)
svc := service.NewService(*api, cmd, jsonOutput)
globalValidator := validator.NewGlobalValidator(cmd, jsonData)
// validate subcommand
globalValidator.ValidateSubCommandsNotAllowed(cmd, args, false)

svc.GetConditionListAndPrintResult(cmd)
},
}

func init() {
condCmd.AddCommand(condListCmd)

condListCmd.Short = util.GetMessageForKey(condListCmd, internalconstant.Short)
condListCmd.Long = util.GetMessageForKey(condListCmd, internalconstant.Long)
}
33 changes: 33 additions & 0 deletions cmd/condition_template.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package cmd

import (
"github.com/akamai/cli-test-center/internal/api"
internalconstant "github.com/akamai/cli-test-center/internal/constant"
"github.com/akamai/cli-test-center/internal/service"
"github.com/akamai/cli-test-center/internal/util"
"github.com/akamai/cli-test-center/internal/validator"
externalconstant "github.com/akamai/cli-test-center/user/constant"
"github.com/spf13/cobra"
)

var condTemplateCmd = &cobra.Command{
Use: externalconstant.ConditionTemplateUse,
Example: externalconstant.ConditionTemplateExample,
Run: func(cmd *cobra.Command, args []string) {
eghc := api.NewEdgeGridHttpClient(config, accountSwitchKey)
api := api.NewApiClient(*eghc)
svc := service.NewService(*api, cmd, jsonOutput)
globalValidator := validator.NewGlobalValidator(cmd, jsonData)
// validate subcommand
globalValidator.ValidateSubCommandsNotAllowed(cmd, args, false)

svc.GetConditionTemplateAndPrintResult(cmd)
},
}

func init() {
condCmd.AddCommand(condTemplateCmd)

condTemplateCmd.Short = util.GetMessageForKey(condTemplateCmd, internalconstant.Short)
condTemplateCmd.Long = util.GetMessageForKey(condTemplateCmd, internalconstant.Long)
}
29 changes: 0 additions & 29 deletions cmd/conditions_template.go

This file was deleted.

30 changes: 30 additions & 0 deletions cmd/function.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package cmd

import (
internalconstant "github.com/akamai/cli-test-center/internal/constant"
"github.com/akamai/cli-test-center/internal/model"
"github.com/akamai/cli-test-center/internal/util"
"github.com/akamai/cli-test-center/internal/validator"
externalconstant "github.com/akamai/cli-test-center/user/constant"
"github.com/spf13/cobra"
)

var tryFunction model.TryFunction

var functionCmd = &cobra.Command{
Use: externalconstant.FunctionUse,
Aliases: []string{externalconstant.FunctionAliases},
Run: func(cmd *cobra.Command, args []string) {
globalValidator := validator.NewGlobalValidator(cmd, jsonData)
globalValidator.ValidateParentSubCommands(cmd, args, false)
},
}

func init() {

rootCmd.AddCommand(functionCmd)
createTestCaseCmd.Flags().SortFlags = false

functionCmd.Short = util.GetMessageForKey(functionCmd, internalconstant.Short)
functionCmd.Long = util.GetMessageForKey(functionCmd, internalconstant.Long)
}
Loading

0 comments on commit 8101c70

Please sign in to comment.