Skip to content

Commit

Permalink
chore(test): switch integration tests to old-cli style
Browse files Browse the repository at this point in the history
for now we are more interested in reliability of the old-style
(to not break anything).

In a later stage we can revert this commit to switch the tests to
the new cli again.
  • Loading branch information
Tieske committed Oct 31, 2023
1 parent 06b689b commit 40f69eb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
18 changes: 12 additions & 6 deletions tests/integration/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
)

var (
expectedOutputMasked = `updating service svc1 {
expectedOutputMasked = `Warning: 'deck diff' is DEPRECATED and will be removed in a future version. Use 'deck gateway diff' instead.
updating service svc1 {
"connect_timeout": 60000,
"enabled": true,
"host": "[masked]",
Expand All @@ -37,7 +38,8 @@ Summary:
Deleted: 0
`

expectedOutputUnMasked = `updating service svc1 {
expectedOutputUnMasked = `Warning: 'deck diff' is DEPRECATED and will be removed in a future version. Use 'deck gateway diff' instead.
updating service svc1 {
"connect_timeout": 60000,
"enabled": true,
"host": "mockbin.org",
Expand Down Expand Up @@ -68,7 +70,8 @@ Summary:
"DECK_FOO": "foo_test", // unused, partial match
}

expectedOutputUnMaskedJSON = `{
expectedOutputUnMaskedJSON = `Warning: 'deck diff' is DEPRECATED and will be removed in a future version. Use 'deck gateway diff' instead.
{
"changes": {
"creating": [
{
Expand Down Expand Up @@ -164,7 +167,8 @@ Summary:
`

expectedOutputMaskedJSON = `{
expectedOutputMaskedJSON = `Warning: 'deck diff' is DEPRECATED and will be removed in a future version. Use 'deck gateway diff' instead.
{
"changes": {
"creating": [
{
Expand Down Expand Up @@ -264,7 +268,8 @@ Summary:
`

expectedOutputUnMaskedJSON30x = `{
expectedOutputUnMaskedJSON30x = `Warning: 'deck diff' is DEPRECATED and will be removed in a future version. Use 'deck gateway diff' instead.
{
"changes": {
"creating": [
{
Expand Down Expand Up @@ -358,7 +363,8 @@ Summary:
`

expectedOutputMaskedJSON30x = `{
expectedOutputMaskedJSON30x = `Warning: 'deck diff' is DEPRECATED and will be removed in a future version. Use 'deck gateway diff' instead.
{
"changes": {
"creating": [
{
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func testKongState(t *testing.T, client *kong.Client, isKonnect bool,

func reset(t *testing.T, opts ...string) {
deckCmd := cmd.NewRootCmd()
args := []string{"gateway", "reset", "--force"}
args := []string{"reset", "--force"}
if len(opts) > 0 {
args = append(args, opts...)
}
Expand Down Expand Up @@ -248,7 +248,7 @@ func setup(t *testing.T) {

func sync(kongFile string, opts ...string) error {
deckCmd := cmd.NewRootCmd()
args := []string{"gateway", "sync", kongFile}
args := []string{"sync", "-s", kongFile}
if len(opts) > 0 {
args = append(args, opts...)
}
Expand All @@ -258,7 +258,7 @@ func sync(kongFile string, opts ...string) error {

func diff(kongFile string, opts ...string) (string, error) {
deckCmd := cmd.NewRootCmd()
args := []string{"gateway", "diff", kongFile}
args := []string{"diff", "-s", kongFile}
if len(opts) > 0 {
args = append(args, opts...)
}
Expand All @@ -280,7 +280,7 @@ func diff(kongFile string, opts ...string) (string, error) {

func dump(opts ...string) (string, error) {
deckCmd := cmd.NewRootCmd()
args := []string{"gateway", "dump", "-o=kong"}
args := []string{"dump"}
if len(opts) > 0 {
args = append(args, opts...)
}
Expand Down Expand Up @@ -324,7 +324,7 @@ func lint(opts ...string) (string, error) {

func ping(opts ...string) error {
deckCmd := cmd.NewRootCmd()
args := []string{"gateway", "ping"}
args := []string{"ping"}
if len(opts) > 0 {
args = append(args, opts...)
}
Expand Down

0 comments on commit 40f69eb

Please sign in to comment.