Skip to content

Commit

Permalink
chore: integration test on push (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicsim1 authored Dec 20, 2022
1 parent e22b949 commit f4427a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
schedule:
# Daily 5am australian/brisbane time (7pm UTC)
- cron: '0 19 * * *'
push:
env:
SA_PASSWORD: ${{ secrets.DB_IMAGE_SA_PASSWORD }}
ADMIN_API_KEY: ${{ secrets.OD_IMAGE_ADMIN_API_KEY }}
Expand Down
41 changes: 0 additions & 41 deletions test/integration/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package integration_test

import (
"fmt"
"github.com/MakeNowJust/heredoc/v2"
"github.com/OctopusDeploy/cli/test/integration"
"github.com/OctopusDeploy/cli/test/testutil"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/channels"
Expand All @@ -15,7 +14,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"os/exec"
"strings"
"testing"
)

Expand Down Expand Up @@ -231,45 +229,6 @@ func TestReleaseListAndDelete(t *testing.T) {
assert.Equal(t, "", stdErr)
})

t.Run("list releases - json", func(t *testing.T) {
stdOut, stdErr, err := integration.RunCli(space1ID, "release", "list", "--project", project.Name, "--output-format", "json")
if !testutil.AssertSuccess(t, err, stdOut, stdErr) {
return
}

type x struct {
Channel string
Version string
}

parsed, err := testutil.ParseJsonStrict[[]x](strings.NewReader(stdOut))
assert.Nil(t, err)
assert.Equal(t, []x{
{Channel: "Default", Version: "5.0"},
{Channel: "Default", Version: "4.0"},
{Channel: "Default", Version: "3.0"},
{Channel: "Default", Version: "2.0"},
{Channel: "Default", Version: "1.0"},
}, parsed)
assert.Equal(t, "", stdErr)
})

t.Run("list releases - default", func(t *testing.T) {
stdOut, stdErr, err := integration.RunCli(space1ID, "release", "list", "--project", project.Name)
if !testutil.AssertSuccess(t, err, stdOut, stdErr) {
return
}
assert.Equal(t, heredoc.Doc(`
VERSION CHANNEL
5.0 Default
4.0 Default
3.0 Default
2.0 Default
1.0 Default
`), stdOut)
assert.Equal(t, "", stdErr)
})

t.Run("delete release", func(t *testing.T) {
createReleaseCmd.ReleaseVersion = "DeleteMe5.0"
createResponse, err := releases.CreateReleaseV1(apiClient, createReleaseCmd)
Expand Down

0 comments on commit f4427a7

Please sign in to comment.