Skip to content

Commit

Permalink
Merge pull request #2883 from ActiveState/mitchell/dx-2142
Browse files Browse the repository at this point in the history
Use zsh as shell for macOS integration tests.
  • Loading branch information
mitchell-as authored Nov 14, 2023
2 parents d73bc02 + 28f0ab8 commit 84e2f28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ jobs:

# === OS Specific Job (runs on each OS) ===
os_specific:
name: ${{ matrix.platform }}
name: ${{ matrix.sys.os }}
timeout-minutes: 90
strategy:
matrix:
go-version:
- 1.20.x
platform:
- ubuntu-20.04
- macos-11
- windows-2019
sys:
- {os: ubuntu-20.04}
- {os: macos-11, shell: zsh}
- {os: windows-2019}
fail-fast: false
runs-on: ${{ matrix.platform }}
runs-on: ${{ matrix.sys.os }}
env:
ACTIVESTATE_CI: true
ACTIVESTATE_CLI_DISABLE_RUNTIME: true
SHELL: bash
GITHUB_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.ref }}-${{ github.event_name }}-${{ matrix.platform }}
group: ${{ github.ref }}-${{ github.event_name }}-${{ matrix.sys.os }}
cancel-in-progress: true

# === OS Specific Steps ===
Expand Down Expand Up @@ -326,7 +326,7 @@ jobs:
if [[ "$TEST_SUITE_TAGS" == "all" ]]; then
TIMEOUT=60m
fi
SHELL='' go test -timeout $TIMEOUT -v `go list ./... | grep "integration"` -json 2>&1 | gotestfmt -hide empty-packages
SHELL='${{ matrix.sys.shell }}' go test -timeout $TIMEOUT -v `go list ./... | grep "integration"` -json 2>&1 | gotestfmt -hide empty-packages
continue-on-error: ${{ github.event_name == 'schedule' }}
env:
INTEGRATION_TEST_USERNAME: ${{ secrets.INTEGRATION_TEST_USERNAME }}
Expand Down Expand Up @@ -367,7 +367,7 @@ jobs:
"type": "section",
"text": {
"type": "plain_text",
"text": "Select the '${{ matrix.platform }}' job and expand 'Integration Tests' to inspect the failures."
"text": "Select the '${{ matrix.sys.os }}' job and expand 'Integration Tests' to inspect the failures."
}
}
]
Expand All @@ -386,7 +386,7 @@ jobs:
name: Upload Session Artifacts
uses: actions/upload-artifact@v2
with:
name: session-build-${{ matrix.platform }}
name: session-build-${{ matrix.sys.os }}
path: build/

# === Deploy job (runs once with combined artifacts from OS specific job) ===
Expand Down
8 changes: 2 additions & 6 deletions cmd/state-installer/test/integration/installer_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/stretchr/testify/suite"

"github.com/ActiveState/cli/internal/condition"
"github.com/ActiveState/cli/internal/config"
"github.com/ActiveState/cli/internal/constants"
"github.com/ActiveState/cli/internal/environment"
Expand Down Expand Up @@ -52,9 +51,6 @@ func (suite *InstallerIntegrationTestSuite) TestInstallFromLocalSource() {
cp.Expect("Installing State Tool")
cp.Expect("Done")
cp.Expect("successfully installed")
if runtime.GOOS == "darwin" && condition.OnCI() {
cp.Expect("You are running bash on macOS")
}
suite.NotContains(cp.Output(), "Downloading State Tool")
cp.ExpectInput()
cp.SendLine("exit")
Expand Down Expand Up @@ -212,7 +208,7 @@ func (suite *InstallerIntegrationTestSuite) TestInstallerOverwriteServiceApp() {
)
cp.Expect("Done")
cp.SendLine("exit")
cp.ExpectExitCode(0)
cp.ExpectExit() // the return code can vary depending on shell (e.g. zsh vs. bash); just assert the installer shell exited

// State Service.app should be overwritten cleanly without error.
cp = ts.SpawnCmdWithOpts(
Expand All @@ -222,7 +218,7 @@ func (suite *InstallerIntegrationTestSuite) TestInstallerOverwriteServiceApp() {
)
cp.Expect("Done")
cp.SendLine("exit")
cp.ExpectExitCode(0)
cp.ExpectExit() // the return code can vary depending on shell (e.g. zsh vs. bash); just assert the installer shell exited
}

func (suite *InstallerIntegrationTestSuite) AssertConfig(ts *e2e.Session) {
Expand Down

0 comments on commit 84e2f28

Please sign in to comment.