From 095b10f9cea2426bd40b8cf482db889f18108445 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Fri, 3 May 2024 12:52:43 +0200 Subject: [PATCH] chore: add file to the built image --- e2e/basic/build_from_git_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/e2e/basic/build_from_git_test.go b/e2e/basic/build_from_git_test.go index 9810f7ce..4e294dce 100644 --- a/e2e/basic/build_from_git_test.go +++ b/e2e/basic/build_from_git_test.go @@ -40,6 +40,11 @@ func TestBuildFromGit(t *testing.T) { }) require.NoError(t, err, "Error setting git repo") + require.NoError(t, instance.SetCommand("sleep", "infinity"), "Error setting command") + + err = instance.AddFileBytes([]byte("Hello, world!"), "/home/hello.txt", "root:root") + require.NoError(t, err, "Error adding file") + require.NoError(t, instance.Commit(), "Error committing instance") t.Cleanup(func() { @@ -55,7 +60,8 @@ func TestBuildFromGit(t *testing.T) { require.NoError(t, instance.Start(), "Error starting instance") - t.Log("Waiting 10 seconds...") - time.Sleep(10 * time.Second) - t.Log("Done waiting") + data, err := instance.GetFileBytes("/home/hello.txt") + require.NoError(t, err, "Error getting file bytes") + + require.Equal(t, []byte("Hello, world!"), data, "File bytes do not match") }