Skip to content

Commit

Permalink
chore: add file to the built image
Browse files Browse the repository at this point in the history
  • Loading branch information
mojtaba-esk committed May 3, 2024
1 parent 0d04ff1 commit 095b10f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions e2e/basic/build_from_git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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")
}

0 comments on commit 095b10f

Please sign in to comment.