diff --git a/airflow/docker_image.go b/airflow/docker_image.go index d4e558569..1b54e1585 100644 --- a/airflow/docker_image.go +++ b/airflow/docker_image.go @@ -151,7 +151,7 @@ func (d *DockerImage) Pytest(pytestFile, airflowHome, envFile, testHomeDirectory // start pytest container docErr = cmdExec(dockerCommand, stdout, stderr, []string{"start", "astro-pytest", "-a"}...) if docErr != nil { - return "", docErr + log.Debugf("Error starting pytest container: %s", docErr.Error()) } // get exit code args = []string{ diff --git a/airflow/docker_image_test.go b/airflow/docker_image_test.go index d3dfea85c..9f850519b 100644 --- a/airflow/docker_image_test.go +++ b/airflow/docker_image_test.go @@ -131,12 +131,16 @@ func TestDockerImagePytest(t *testing.T) { switch { case args[0] == "start": return errMock + case args[0] == "inspect": + stdout.Write([]byte(`exit code 1`)) // making sure exit code is captured properly + return nil default: return nil } } - _, err = handler.Pytest("", "", "", "", []string{}, true, options) + out, err := handler.Pytest("", "", "", "", []string{}, true, options) assert.Error(t, err) + assert.Equal(t, out, "exit code 1") }) t.Run("copy error", func(t *testing.T) {