Attempt to fix github action only test failures

This commit is contained in:
David Dworken 2022-11-12 06:18:05 -08:00
parent fea4bd49ec
commit 6e7822ebae
No known key found for this signature in database
3 changed files with 36 additions and 33 deletions

View File

@ -33,8 +33,8 @@ jobs:
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
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true

View File

@ -2111,6 +2111,9 @@ func TestTimestampFormat(t *testing.T) {
defer testutils.BackupAndRestore(t)()
userSecret := installHishtory(t, tester, "")
// Add an entry just to ensure we get consistent table sizing
tester.RunInteractiveShell(t, "echo tablesizing")
// Add some entries with fixed timestamps
tmz, err := time.LoadLocation("America/Los_Angeles")
if err != nil {
@ -2131,9 +2134,9 @@ func TestTimestampFormat(t *testing.T) {
tester.RunInteractiveShell(t, ` hishtory config-set timestamp-format '2006/Jan/2 15:04'`)
// And check that it is displayed in both the tui and the classic view
out := hishtoryQuery(t, tester, "-pipefail")
out := hishtoryQuery(t, tester, "-pipefail -tablesizing")
compareGoldens(t, out, "TestTimestampFormat-query")
out = captureTerminalOutput(t, tester, []string{"hishtory SPACE tquery SPACE -pipefail ENTER"})
out = captureTerminalOutput(t, tester, []string{"hishtory SPACE tquery SPACE -pipefail SPACE -tablesizing ENTER"})
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
compareGoldens(t, out, "TestTimestampFormat-tquery")
}

View File

@ -1,30 +1,30 @@
-pipefail
-pipefail -tablesizing
Search Query: > -pipefail
Search Query: > -pipefail -tablesizing
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Hostname CWD Timestamp Runtime Exit Code Command │
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ localhost ~/foo/ 2022/Apr/16 01:03 24s 3 table_cmd2 │
│ localhost /tmp/ 2022/Apr/16 01:03 4s 2 table_cmd1 │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ Hostname CWD Timestamp Runtime Exit Code Command
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ localhost ~/foo/ 2022/Apr/16 01:03 24s 3 table_cmd2
│ localhost /tmp/ 2022/Apr/16 01:03 4s 2 table_cmd1
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────