Working on a new workflow for running ijhttp for integration tests and pretty happy with it so far
test.go
func (i *Integration) Test(server, test *dagger.Directory) (string, error) {
serverService := dag.Container().
From("golang:latest").
WithDirectory("/src", server).
WithExposedPort(1323).
WithWorkdir("/src/server").
WithExec([]string{"go", "run", "main.go"}).
AsService()return dag.Container(). From("alpine:latest"). WithDirectory("/workdir", test). WithExec([]string{"apk", "add", "openjdk17-jdk", "curl", "unzip"}). WithExec([]string{"/bin/sh", "-c", "mkdir /ijhttp"}). WithExec([]string{"curl", "-f", "-L", "-o", "/ijhttp/ijhttp.zip", "https://jb.gg/ijhttp/latest"}). WithExec([]string{"unzip", "/ijhttp/ijhttp.zip"}). WithExec([]string{"/bin/sh", "-c", "chmod +x /ijhttp/ijhttp"}). WithServiceBinding("server", serverService). WithExec([]string{"sh", "/ijhttp/ijhttp", "/workdir/test.http"}). Stdout(context.Background())}
test.http
{%
client.test("Test status code", function() {
client.assert(response.status === 200, "Response status is not 200");
});
%}