integration test running on actions

This commit is contained in:
David Dworken 2022-04-13 21:48:52 -07:00
parent e854c8304f
commit 24db9d825e

View File

@ -44,12 +44,6 @@ func RunInteractiveBashCommandsWithoutStrictMode(t *testing.T, script string) (s
} }
func TestIntegration(t *testing.T) { func TestIntegration(t *testing.T) {
if os.Getenv("GITHUB_ACTIONS") != "" {
// TODO: debug why these tests fail on github actions, the error message is:
// `bash: cannot set terminal process group (683): Inappropriate ioctl for device\nbash: no job control in this shell`
t.Skip()
}
// Set up // Set up
defer shared.BackupAndRestore(t)() defer shared.BackupAndRestore(t)()
defer shared.RunTestServer(t)() defer shared.RunTestServer(t)()
@ -179,9 +173,7 @@ func testIntegration(t *testing.T) string {
userSecret := installHishtory(t, "") userSecret := installHishtory(t, "")
// Test the status subcommand // Test the status subcommand
out := RunInteractiveBashCommands(t, ` out := RunInteractiveBashCommands(t, `hishtory status`)
hishtory status
`)
if out != fmt.Sprintf("Hishtory: v0.Unknown\nEnabled: true\nSecret Key: %s\nCommit Hash: Unknown\n", userSecret) { if out != fmt.Sprintf("Hishtory: v0.Unknown\nEnabled: true\nSecret Key: %s\nCommit Hash: Unknown\n", userSecret) {
t.Fatalf("status command has unexpected output: %#v", out) t.Fatalf("status command has unexpected output: %#v", out)
} }
@ -195,18 +187,16 @@ func testIntegration(t *testing.T) string {
os.Setenv("FORCED_BANNER", "") os.Setenv("FORCED_BANNER", "")
// Test recording commands // Test recording commands
out, err := RunInteractiveBashCommandsWithoutStrictMode(t, ` out, err := RunInteractiveBashCommandsWithoutStrictMode(t, `set -m
set -m ls /a
ls /a ls /bar
ls /bar ls /foo
ls /foo echo foo
echo foo echo bar
echo bar hishtory disable
hishtory disable echo thisisnotrecorded
echo thisisnotrecorded hishtory enable
hishtory enable echo thisisrecorded`)
echo thisisrecorded
`)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }