From 23ca92ed17dfd79a9ba9bf2a3baaf388def0b023 Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Mon, 24 Jun 2024 10:40:21 +1000 Subject: [PATCH 1/5] Fix make command to ensure coroc --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 178431b..0721460 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,7 @@ integration-test: clean coroc go run -tags durable ./dispatchtest/integration # durable mode clean: - find . -name '*_durable.go' -delete + @find . -name '*_durable.go' -delete coroc: - @which coroc &>/dev/null \ - || echo "Installing coroc..." \ - && go install github.com/dispatchrun/coroutine/compiler/cmd/coroc@latest + @which coroc >/dev/null || go install github.com/dispatchrun/coroutine/compiler/cmd/coroc@latest From ebec6349b47d7f9a6522a55d8cbac93dcdde5269 Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Mon, 24 Jun 2024 10:40:38 +1000 Subject: [PATCH 2/5] Add \!durable build tags --- dispatchclient/client.go | 2 ++ dispatchclient/serde.go | 2 ++ dispatchcoro/volatile.go | 2 ++ dispatchproto/any.go | 2 ++ dispatchproto/error.go | 2 ++ dispatchproto/function.go | 2 ++ dispatchproto/id.go | 2 ++ dispatchproto/proto.go | 2 ++ dispatchproto/serde.go | 2 ++ dispatchproto/status.go | 2 ++ dispatchproto/unsafe.go | 2 ++ dispatchserver/endpoint.go | 2 ++ dispatchserver/server.go | 2 ++ dispatchtest/endpoint.go | 2 ++ dispatchtest/key.go | 2 ++ dispatchtest/run.go | 2 ++ dispatchtest/server.go | 2 ++ internal/auth/key.go | 2 ++ internal/auth/signature.go | 2 ++ internal/env/env.go | 2 ++ 20 files changed, 40 insertions(+) diff --git a/dispatchclient/client.go b/dispatchclient/client.go index 22ec311..c5cd499 100644 --- a/dispatchclient/client.go +++ b/dispatchclient/client.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchclient import ( diff --git a/dispatchclient/serde.go b/dispatchclient/serde.go index bb47225..b06d2af 100644 --- a/dispatchclient/serde.go +++ b/dispatchclient/serde.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchclient import "github.com/dispatchrun/coroutine/types" diff --git a/dispatchcoro/volatile.go b/dispatchcoro/volatile.go index ccab6d7..096f9a5 100644 --- a/dispatchcoro/volatile.go +++ b/dispatchcoro/volatile.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchcoro import ( diff --git a/dispatchproto/any.go b/dispatchproto/any.go index 5b1672b..6da878c 100644 --- a/dispatchproto/any.go +++ b/dispatchproto/any.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchproto import ( diff --git a/dispatchproto/error.go b/dispatchproto/error.go index d1f76e3..4aac910 100644 --- a/dispatchproto/error.go +++ b/dispatchproto/error.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchproto import ( diff --git a/dispatchproto/function.go b/dispatchproto/function.go index 936762f..cdc0863 100644 --- a/dispatchproto/function.go +++ b/dispatchproto/function.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchproto import "context" diff --git a/dispatchproto/id.go b/dispatchproto/id.go index d548c94..278b58d 100644 --- a/dispatchproto/id.go +++ b/dispatchproto/id.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchproto // ID is an identifier for a dispatched function call. diff --git a/dispatchproto/proto.go b/dispatchproto/proto.go index 3adcb79..ba9c35c 100644 --- a/dispatchproto/proto.go +++ b/dispatchproto/proto.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchproto import ( diff --git a/dispatchproto/serde.go b/dispatchproto/serde.go index 4228b39..91d96b1 100644 --- a/dispatchproto/serde.go +++ b/dispatchproto/serde.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchproto import ( diff --git a/dispatchproto/status.go b/dispatchproto/status.go index 4b62435..82d5ed2 100644 --- a/dispatchproto/status.go +++ b/dispatchproto/status.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchproto import ( diff --git a/dispatchproto/unsafe.go b/dispatchproto/unsafe.go index 6160238..bcfa766 100644 --- a/dispatchproto/unsafe.go +++ b/dispatchproto/unsafe.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchproto import ( diff --git a/dispatchserver/endpoint.go b/dispatchserver/endpoint.go index 4021d11..d4d9155 100644 --- a/dispatchserver/endpoint.go +++ b/dispatchserver/endpoint.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchserver import ( diff --git a/dispatchserver/server.go b/dispatchserver/server.go index 65e51f9..96458e4 100644 --- a/dispatchserver/server.go +++ b/dispatchserver/server.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchserver import ( diff --git a/dispatchtest/endpoint.go b/dispatchtest/endpoint.go index 99b2b6c..fc7b46d 100644 --- a/dispatchtest/endpoint.go +++ b/dispatchtest/endpoint.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchtest import ( diff --git a/dispatchtest/key.go b/dispatchtest/key.go index 9bd56ac..4693e25 100644 --- a/dispatchtest/key.go +++ b/dispatchtest/key.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchtest import ( diff --git a/dispatchtest/run.go b/dispatchtest/run.go index 476701a..f03e44b 100644 --- a/dispatchtest/run.go +++ b/dispatchtest/run.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchtest import ( diff --git a/dispatchtest/server.go b/dispatchtest/server.go index dcf01d3..ac77568 100644 --- a/dispatchtest/server.go +++ b/dispatchtest/server.go @@ -1,3 +1,5 @@ +//go:build !durable + package dispatchtest import ( diff --git a/internal/auth/key.go b/internal/auth/key.go index 3d92283..1a406b1 100644 --- a/internal/auth/key.go +++ b/internal/auth/key.go @@ -1,3 +1,5 @@ +//go:build !durable + package auth import ( diff --git a/internal/auth/signature.go b/internal/auth/signature.go index 9af50b6..f9a6a38 100644 --- a/internal/auth/signature.go +++ b/internal/auth/signature.go @@ -1,3 +1,5 @@ +//go:build !durable + package auth import ( diff --git a/internal/env/env.go b/internal/env/env.go index b240568..c8816a2 100644 --- a/internal/env/env.go +++ b/internal/env/env.go @@ -1,3 +1,5 @@ +//go:build !durable + package env import "strings" From d2c420b763d5d30c35d1e2958eb2067cd3d2e0b6 Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Mon, 24 Jun 2024 11:53:36 +1000 Subject: [PATCH 3/5] Print something to show the test is working --- dispatchtest/integration/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/dispatchtest/integration/main.go b/dispatchtest/integration/main.go index 550a3ca..ccfa2d5 100644 --- a/dispatchtest/integration/main.go +++ b/dispatchtest/integration/main.go @@ -52,5 +52,6 @@ func run() error { if output != "88888888" { return fmt.Errorf("unexpected output: %q", output) } + fmt.Println("OK") return nil } From 543632847e56a6e034feb264d0b1a173e33ff73a Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Mon, 24 Jun 2024 11:54:28 +1000 Subject: [PATCH 4/5] Enable the integration test in CI --- .github/workflows/test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93fe623..fdcac87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,4 +32,13 @@ jobs: - uses: actions/setup-go@v5 with: go-version: ${{ env.GOVERSION }} - - run: go test -cover ./... + - run: make test + + integration_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ${{ env.GOVERSION }} + - run: make integration-test From f64f12a084887647f698586168021e1475e4896f Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Tue, 25 Jun 2024 05:46:19 +1000 Subject: [PATCH 5/5] Bump --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d2d3096..0b52a2c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( connectrpc.com/connect v1.16.2 connectrpc.com/validate v0.1.0 github.com/aws/aws-lambda-go v1.47.0 - github.com/dispatchrun/coroutine v0.9.0 + github.com/dispatchrun/coroutine v0.9.1 github.com/offblocks/httpsig v0.8.1 golang.org/x/sys v0.21.0 google.golang.org/protobuf v1.34.2 diff --git a/go.sum b/go.sum index 3aa4470..0ce5cb1 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,8 @@ github.com/bufbuild/protovalidate-go v0.6.2/go.mod h1:4BR3rKEJiUiTy+sqsusFn2ladO github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dispatchrun/coroutine v0.9.0 h1:OKDggtjKVbEYP6DRKzRSvwcFHlXnLuhncqpH/bUf7Bg= -github.com/dispatchrun/coroutine v0.9.0/go.mod h1:4/Lb6fpuR+IQa3CPWBBbVG5gbZEIBqC48Q/PgWmRxKM= +github.com/dispatchrun/coroutine v0.9.1 h1:EYJEXrB2ogbXnN4pJGTxzv260vxgAmZnstouTzqwA/E= +github.com/dispatchrun/coroutine v0.9.1/go.mod h1:4/Lb6fpuR+IQa3CPWBBbVG5gbZEIBqC48Q/PgWmRxKM= github.com/dunglas/httpsfv v1.0.2 h1:iERDp/YAfnojSDJ7PW3dj1AReJz4MrwbECSSE59JWL0= github.com/dunglas/httpsfv v1.0.2/go.mod h1:zID2mqw9mFsnt7YC3vYQ9/cjq30q41W+1AnDwH8TiMg= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=