Add deprecation notice to godog CLI (#489)
* Add deprecation notice to godog CLI * Update CHANGELOG
Этот коммит содержится в:
родитель
d45a9aaaa3
коммит
6f3e792c52
4 изменённых файлов: 15 добавлений и 2 удалений
|
@ -15,6 +15,9 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
|
||||||
- Fixed a bug which would ignore the context returned from a substep.([488](https://github.com/cucumber/godog/pull/488) - [wichert](https://github.com/wichert))
|
- Fixed a bug which would ignore the context returned from a substep.([488](https://github.com/cucumber/godog/pull/488) - [wichert](https://github.com/wichert))
|
||||||
- Fixed a bug which would cause a panic when using the pretty formatter with a feature that contained a rule. ([480](https://github.com/cucumber/godog/pull/480) - [dumpsterfireproject](https://github.com/dumpsterfireproject))
|
- Fixed a bug which would cause a panic when using the pretty formatter with a feature that contained a rule. ([480](https://github.com/cucumber/godog/pull/480) - [dumpsterfireproject](https://github.com/dumpsterfireproject))
|
||||||
|
|
||||||
|
### Deprecated
|
||||||
|
- `godog` CLI tool prints deprecation warning. ([489](https://github.com/cucumber/godog/pull/489) - [vearutop](https://github.com/vearutop))
|
||||||
|
|
||||||
## [v0.12.5]
|
## [v0.12.5]
|
||||||
### Changed
|
### Changed
|
||||||
- Changed underlying cobra command setup to return errors instead of calling `os.Exit` directly to enable simpler testing. ([454](https://github.com/cucumber/godog/pull/454) - [mxygem](https://github.com/mxygem))
|
- Changed underlying cobra command setup to return errors instead of calling `os.Exit` directly to enable simpler testing. ([454](https://github.com/cucumber/godog/pull/454) - [mxygem](https://github.com/mxygem))
|
||||||
|
|
|
@ -5,7 +5,9 @@ import (
|
||||||
"go/build"
|
"go/build"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/cucumber/godog/colors"
|
||||||
"github.com/cucumber/godog/internal/builder"
|
"github.com/cucumber/godog/internal/builder"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,6 +39,9 @@ The test runner can be executed with the same flags as when using godog run.`,
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildCmdRunFunc(cmd *cobra.Command, args []string) error {
|
func buildCmdRunFunc(cmd *cobra.Command, args []string) error {
|
||||||
|
fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead."))
|
||||||
|
fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details."))
|
||||||
|
|
||||||
bin, err := filepath.Abs(buildOutput)
|
bin, err := filepath.Abs(buildOutput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not locate absolute path for: %q. reason: %v", buildOutput, err)
|
return fmt.Errorf("could not locate absolute path for: %q. reason: %v", buildOutput, err)
|
||||||
|
|
|
@ -44,7 +44,8 @@ func runRootCmd(cmd *cobra.Command, args []string) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(colors.Yellow("Use of godog without a sub-command is deprecated. Please use godog build, godog run or godog version."))
|
fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead."))
|
||||||
|
fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details."))
|
||||||
return runCmdRunFunc(cmd, args)
|
return runCmdRunFunc(cmd, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/cucumber/godog/colors"
|
||||||
"github.com/cucumber/godog/internal/builder"
|
"github.com/cucumber/godog/internal/builder"
|
||||||
"github.com/cucumber/godog/internal/flags"
|
"github.com/cucumber/godog/internal/flags"
|
||||||
)
|
)
|
||||||
|
@ -42,6 +43,9 @@ buildable go source.`,
|
||||||
}
|
}
|
||||||
|
|
||||||
func runCmdRunFunc(cmd *cobra.Command, args []string) error {
|
func runCmdRunFunc(cmd *cobra.Command, args []string) error {
|
||||||
|
fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead."))
|
||||||
|
fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details."))
|
||||||
|
|
||||||
osArgs := os.Args[1:]
|
osArgs := os.Args[1:]
|
||||||
|
|
||||||
if len(osArgs) > 0 && osArgs[0] == "run" {
|
if len(osArgs) > 0 && osArgs[0] == "run" {
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче