MCPcopy Create free account
hub / github.com/coder/envbuilder / TestBuildPrintBuildOutput

Function TestBuildPrintBuildOutput

integration/integration_test.go:803–831  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

801}
802
803func TestBuildPrintBuildOutput(t *testing.T) {
804 t.Parallel()
805
806 // Ensures that a Git repository with a Dockerfile is cloned and built.
807 srv := gittest.CreateGitServer(t, gittest.Options{
808 Files: map[string]string{
809 "Dockerfile": "FROM " + testImageAlpine + "\nRUN echo hello",
810 },
811 })
812 ctr, err := runEnvbuilder(t, runOpts{env: []string{
813 envbuilderEnv("GIT_URL", srv.URL),
814 envbuilderEnv("DOCKERFILE_PATH", "Dockerfile"),
815 }})
816 require.NoError(t, err)
817
818 cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
819 require.NoError(t, err)
820 defer cli.Close()
821
822 // Make sure that "hello" is printed in the logs!
823 logs, _ := streamContainerLogs(t, cli, ctr)
824 for {
825 log := <-logs
826 if log != "hello" {
827 continue
828 }
829 break
830 }
831}
832
833func TestBuildIgnoreVarRunSecrets(t *testing.T) {
834 t.Parallel()

Callers

nothing calls this directly

Calls 5

CreateGitServerFunction · 0.92
runEnvbuilderFunction · 0.85
envbuilderEnvFunction · 0.85
streamContainerLogsFunction · 0.85
CloseMethod · 0.80

Tested by

no test coverage detected