From 827a2741e4fcb8e6feb5bf76acb20799c2913451 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 15 Feb 2026 12:36:37 +0700 Subject: all: fix integration tests from previous refactoring When we made the refactoring, we forgot to run the test-integration task which cause some tests are fails. --- http_server_play_test.go | 7 ++----- .../http_server/play_ssh_config_changes/test.data | 20 ++++++++++++++------ testdata/play/awwanssh.test/play_test.data | 17 ++++++++++------- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/http_server_play_test.go b/http_server_play_test.go index 68dd180..9018fce 100644 --- a/http_server_play_test.go +++ b/http_server_play_test.go @@ -13,7 +13,6 @@ import ( "net/http/httptest" "os" "path/filepath" - "strings" "testing" libhttp "git.sr.ht/~shulhan/pakakeh.go/lib/http" @@ -64,9 +63,10 @@ func TestHttpServerPlaySshConfigChanges(t *testing.T) { t.Fatal(err) } + var serveOpts = ServeOptions{} var httpd *httpServer - httpd, err = newHTTPServer(aww, ``) + httpd, err = newHTTPServer(aww, serveOpts) if err != nil { t.Fatal(err) } @@ -125,7 +125,4 @@ func testHttpExecute(t *testing.T, httpd *httpServer, tdata *test.Data, tag stri if err != nil { t.Fatal(err) } - - expResp = tdata.Output[tag+`:output`] - test.Assert(t, tag+`:output`, string(expResp), strings.Join(execRes.Output, "\n")) } diff --git a/testdata/http_server/play_ssh_config_changes/test.data b/testdata/http_server/play_ssh_config_changes/test.data index 00a6941..f9580b5 100644 --- a/testdata/http_server/play_ssh_config_changes/test.data +++ b/testdata/http_server/play_ssh_config_changes/test.data @@ -23,13 +23,17 @@ Host oldhost "begin_at": "2023-11-26T15:21:00Z", "end_at": "", "error": "", - "output": [] + "output": [ + { + "Type": "begin", + "Data": "2023-11-26T15:21:00Z", + "ID": "1" + } + ] }, "code": 200 } -<<< play_on_oldhost:output - >>> .ssh/config:newhost Host oldhost Hostname 127.0.0.1 @@ -60,9 +64,13 @@ Host newhost "begin_at": "2023-11-26T15:21:00Z", "end_at": "", "error": "", - "output": [] + "output": [ + { + "Type": "begin", + "Data": "2023-11-26T15:21:00Z", + "ID": "1" + } + ] }, "code": 200 } - -<<< play_on_newhost:output diff --git a/testdata/play/awwanssh.test/play_test.data b/testdata/play/awwanssh.test/play_test.data index e67163f..0a0c88d 100644 --- a/testdata/play/awwanssh.test/play_test.data +++ b/testdata/play/awwanssh.test/play_test.data @@ -1,11 +1,14 @@ Test on "play" command. -<<< play_with_local:output - --- SSH connection: awwanssh@127.0.0.1:10022 - --- SSH identity file: [/home/awwan/.ssh/id_ed25519] - === BEGIN: play testdata/play/awwanssh.test/play.aww 1- - --> 2: pwd +<<< play_with_local:stdout + --- SSH connection: awwanssh@127.0.0.1:10022 + --- SSH identity file: [/home/awwan/.ssh/id_ed25519] + === BEGIN: play testdata/play/awwanssh.test/play.aww 1- + --> 2: pwd + --> 5: #local: pwd + === END: play testdata/play/awwanssh.test/play.aww 1- + +<<< play_with_local:stderr /home/awwanssh - --> 5: #local: pwd /home/awwan/src - === END: play testdata/play/awwanssh.test/play.aww 1- + -- cgit v1.3