I've been looking around in dagger codebase to look for a way to run tests that use dagger itself. For example I have a test that spins up a container and checks if it acutally performs the tasks it's supposed to. Is there a good example of a way to achive this? If that's not the right way to test, how do I go about testing dagger pipelines? Passing the docker.sock is not an option as I don't have permissions to do so. I also tried to bring up a sidecar dind with a service binding (https://github.com/dagger/dagger/pull/4677/files#diff-2f732241fe4998f181c3703849d454990682cc44f9981c719b75ad7de777e340) but it didn't work either. Here's a simple test i'm trying to run
package pipeline
import (
"context"
"os"
"strings"
"testing"
"dagger.io/dagger"
"github.com/stretchr/testify/require"
)
func TestSetupMavenBuildImage(t *testing.T) {
t.Parallel()
ctx := context.Background()
c, err := dagger.Connect(ctx)
require.NoError(t, err)
ts, err := os.CreateTemp(".", "settings*.xml")
require.NoError(t, err)
defer ts.Close()
defer os.Remove(ts.Name())
i, err := setupMavenBuildImage(c, c.SetSecret("test", "test"), "test", ".", ts.Name(), "myregistry.com", ".")
require.NoError(t, err)
s, err := i.WithExec([]string{"ls", "/src/.m2"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "settings.xml", strings.TrimSpace(s))
}