Hey, we have a e2e test script that sometimes exit's with code 1. We'd like to export a test report directory after that but it doesn't seem to work. Here's a minimal repro of what we found:
package main
import (
"context"
"dagger.io/dagger"
"os"
)
func main() {
ctx := context.Background()
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
dir := client.Directory().WithNewFile("test.py", `
print("exiting")
exit(1)
`)
ctr := client.Container().From("python").
WithDirectory("app", dir).
WithWorkdir("app").
WithExec([]string{"python3", "test.py"})
ctr.Directory("").Export(ctx, "test-export")
}
I'd expect the directory export still to work even if the test.py fails. If I do exit(0) the export works.
Is this expected? Am I missing something?
Thanks!