diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index cb79f81..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,14 +0,0 @@ -freebsd_instance: - image: freebsd-12-2-release-amd64 -task: - name: freebsd-test - env: - TZ: 'America/Los_Angeles' # Force the time zone so that test output is consistent - GITHUB_ACTION: 'true' - setup_script: - - id - - pkg install -y bash zsh fish curl go tmux - - sudo hostname ghaction-runner-hostname # Set a consistent hostname so we can run tests that depend on it - test_script: - - id - - make test \ No newline at end of file diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index b17cd62..e524013 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] fail-fast: false steps: - uses: actions/checkout@v2 @@ -23,14 +23,13 @@ jobs: go-version: 1.18 # - uses: mxschmitt/action-tmate@v3 - name: Go test - shell: bash if: ${{ !startsWith(github.event.head_commit.message, 'Release') }} run: | sudo apt-get update || true sudo apt-get install -y zsh fish || true brew install fish tmux bash || true export TZ='America/Los_Angeles' # Force the time zone so that test output is consistent - sudo chmod 0755 -R /usr/share/zsh/ || true # Work around a weird bug where zsh on ubuntu actions gives that diretory 0777 which makes zsh refuse to start + sudo chmod 0755 -R /usr/share/zsh/ || true # Work around a weird bug where zsh on ubuntu actiosn gives that diretory 0777 which makes zsh refuse to start sudo hostname ghaction-runner-hostname || true # Set a consistent hostname so we can run tests that depend on it sudo scutil --set HostName ghaction-runner-hostname || true make test diff --git a/Makefile b/Makefile index a518860..9fff6f0 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ forcetest: HISHTORY_TEST=1 go test -p 1 -timeout 30m ./... test: - HISHTORY_TEST=1 go test -p 1 -timeout 45m ./... + HISHTORY_TEST=1 go test -p 1 -timeout 30m ./... acttest: act push -j test -e .github/push_event.json --reuse --container-architecture linux/amd64 diff --git a/client/client_test.go b/client/client_test.go index cf35a95..6fe59d2 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -388,7 +388,7 @@ echo thisisrecorded`) // Test the actual table output hostnameMatcher := `\S+` tableDividerMatcher := `\s+` - pathMatcher := `~?/?[a-zA-Z_0-9/-]+` + pathMatcher := `~?/[a-zA-Z_0-9/-]+` datetimeMatcher := `[a-zA-Z]{3}\s\d{1,2}\s\d{4}\s[0-9:]+\s([A-Z]{3}|[+-]\d{4})` runtimeMatcher := `[0-9.ms]+` exitCodeMatcher := `0` @@ -845,7 +845,7 @@ echo hello2 } func getPidofCommand() string { - if runtime.GOOS == "darwin" || runtime.GOOS == "freebsd" { + if runtime.GOOS == "darwin" { // MacOS doesn't have pidof by default return "pgrep" } @@ -919,9 +919,6 @@ func testTimestampsAreReasonablyCorrect(t *testing.T, tester shellTester) { } func testTableDisplayCwd(t *testing.T, tester shellTester) { - if runtime.GOOS == "freebsd" { - t.Skip() - } // Setup defer testutils.BackupAndRestore(t)() installHishtory(t, tester, "") @@ -1027,9 +1024,6 @@ echo foo`) } func testDisplayTable(t *testing.T, tester shellTester) { - if runtime.GOOS == "freebsd" { - t.Skip() - } // Setup defer testutils.BackupAndRestore(t)() userSecret := installHishtory(t, tester, "") @@ -1744,9 +1738,6 @@ func testHandleUpgradedFeatures(t *testing.T, tester shellTester) { } func TestFish(t *testing.T) { - if runtime.GOOS == "freebsd" { - t.Skip() - } // Setup defer testutils.BackupAndRestore(t)() tester := bashTester{} @@ -2013,9 +2004,6 @@ func testControlR(t *testing.T, tester shellTester, shellName string, onlineStat } func testCustomColumns(t *testing.T, tester shellTester) { - if runtime.GOOS == "freebsd" { - t.Skip() - } // Setup defer testutils.BackupAndRestore(t)() installHishtory(t, tester, "") diff --git a/client/lib/goldens/testCustomColumns-tquery-bash-isAction-darwin b/client/lib/goldens/testCustomColumns-tquery-bash-isAction-darwin index d8355c9..6d8d26b 100644 --- a/client/lib/goldens/testCustomColumns-tquery-bash-isAction-darwin +++ b/client/lib/goldens/testCustomColumns-tquery-bash-isAction-darwin @@ -1,5 +1,4 @@ bash-5.2$ source /Users/runner/.bashrc -hishtory tquery -pipefail bash-5.2$ hishtory tquery -pipefail diff --git a/shared/testutils/testutils.go b/shared/testutils/testutils.go index f03688c..f528ad6 100644 --- a/shared/testutils/testutils.go +++ b/shared/testutils/testutils.go @@ -165,7 +165,7 @@ func buildServer() { if err != nil { panic(fmt.Sprintf("failed to getwd: %v", err)) } - if strings.HasSuffix(wd, "/hishtory") || strings.HasSuffix(wd, "/cirrus-ci-build") { + if strings.HasSuffix(wd, "/hishtory") { break } err = os.Chdir("../")