Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- stable
workflow_dispatch:

jobs:
Expand Down
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

End-to-end test suite for E2Engine.

Part of [E2Engine](https://e2engine.dev), an open-source platform for declarative end-to-end testing.

This repository verifies E2Engine through its public interfaces using the CLI, Docker, real and mocked HTTP/gRPC services, direct and socket transports, persistence, and asynchronous execution flows.

The CLI, Docker images, and helper service binaries required by the tests are built locally by the Makefile before the corresponding test suites run.
Expand Down Expand Up @@ -65,6 +67,33 @@ make verify

The test targets build the binaries and Docker images required by their respective suites before running the tests.

## Stable branch

The `stable` branch provides a known-good version of the E2E test suite for downstream E2Engine repositories.

Downstream CI, such as the CLI build, should use `stable` rather than `main`. This prevents changes under development in the test suite from unexpectedly breaking downstream builds.

Changes are promoted in the following order:

1. Update dependencies and tests on `main`.
2. Run the complete test repository CI and ensure it passes.
3. Promote `main` to `stable`.
4. Update downstream repositories that depend on the new versions.

For example, when updating Core or instrumentation dependencies:

```text
dependency release
↓
tests/main
↓
tests CI passes
↓
tests/stable
↓
downstream repository update
```

## E2Engine

This repository is part of E2Engine.
Expand All @@ -74,8 +103,9 @@ This repository is part of E2Engine.
- [runner-local](https://github.com/e2engine/runner-local) — local test execution
- [cli](https://github.com/e2engine/cli) — command-line interface
- [tests](https://github.com/e2engine/tests) — end-to-end tests for E2Engine
- demo — executable demonstration system and E2Engine usage examples
- [demo](https://github.com/e2engine/demo) — executable demonstration system and E2Engine usage examples
- [instrumentation-go](https://github.com/e2engine/instrumentation-go) — Go instrumentation library for E2Engine

## License

Licensed under the Apache License, Version 2.0.
Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE).
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ module github.com/e2engine/tests
go 1.27

require (
github.com/e2engine/core v0.1.0
github.com/e2engine/core v0.1.2
github.com/e2engine/instrumentation-go/grpc v0.1.1
github.com/e2engine/instrumentation-go/http v0.1.1
google.golang.org/grpc v1.84.0
google.golang.org/protobuf v1.36.12
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/e2engine/instrumentation-go v0.1.1 // indirect
github.com/ygrebnov/errorc v0.6.1 // indirect
github.com/ygrebnov/keys v0.2.0 // indirect
github.com/ygrebnov/model v0.7.5 // indirect
Expand Down
10 changes: 8 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
github.com/e2engine/core v0.1.0 h1:gCnHAVbK0635C6w9N2rC0PLi9PWh0SJLQNDkKarxpBw=
github.com/e2engine/core v0.1.0/go.mod h1:EDzClKKllCF5U/iv2Trk7MODOk2pfURXDAi8NiTvXeU=
github.com/e2engine/core v0.1.2 h1:QPFPtdWizSPfC9zw1l2moO+yVSvli174LILfTnFAq3E=
github.com/e2engine/core v0.1.2/go.mod h1:JM4y6XlRsLgYSFXph1T8qPU+Cp5s+WkQYlaJUBvnTzA=
github.com/e2engine/instrumentation-go v0.1.1 h1:pkOQIQWWkGqHdU1F/b0tCtpFyNDc09kKebYZElHZS9k=
github.com/e2engine/instrumentation-go v0.1.1/go.mod h1:zpWF7koAp+vFqYAfOx3mOJFn4GpLtzetguAs8n7+wIE=
github.com/e2engine/instrumentation-go/grpc v0.1.1 h1:0sqxF3oCdxdVaJwzTshaf79VMXglVHJQ1bLte7vnH14=
github.com/e2engine/instrumentation-go/grpc v0.1.1/go.mod h1:l74IeAGD1lOKbrc/rqQJ3qHvrQF1rvefC50v8unCo1U=
github.com/e2engine/instrumentation-go/http v0.1.1 h1:Xu+yRVgv6jsq7eBLzeOeccwM0dyNz2ga1ybaXNUFhTk=
github.com/e2engine/instrumentation-go/http v0.1.1/go.mod h1:dFgPXV8kq17HHTecABNLaAio8td8LtdiNj9cZYS6Kng=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
Expand Down
21 changes: 10 additions & 11 deletions services/gateway-grpc-message/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"log"
"net/http"

e2enginegrpc "github.com/e2engine/instrumentation-go/grpc"
e2enginehttp "github.com/e2engine/instrumentation-go/http"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protodesc"
"google.golang.org/protobuf/reflect/protoreflect"
Expand All @@ -26,6 +27,9 @@ func main() {
connection, err := grpc.NewClient(
entitlementsAddress,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithUnaryInterceptor(
e2enginegrpc.UnaryClientInterceptor(),
),
)
if err != nil {
http.Error(w, "dependency request failed", http.StatusBadGateway)
Expand All @@ -41,16 +45,8 @@ func main() {

response := dynamicpb.NewMessage(method.Output())

const testExecutionIDKey = "e2engine-test-execution-id"

callCtx := metadata.AppendToOutgoingContext(
r.Context(),
testExecutionIDKey,
r.Header.Get("E2Engine-Test-Execution-ID"),
)

if err := connection.Invoke(
callCtx,
r.Context(),
entitlementsRPC,
request,
response,
Expand Down Expand Up @@ -78,7 +74,10 @@ func main() {
_, _ = w.Write([]byte(`{"entitled":false}`))
})

if err := http.ListenAndServe("127.0.0.1:9000", nil); err != nil {
if err := http.ListenAndServe(
"127.0.0.1:9000",
e2enginehttp.Handler(),
); err != nil {
log.Fatal(err)
}
}
Expand Down
21 changes: 10 additions & 11 deletions services/gateway-grpc-method/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"log"
"net/http"

e2enginegrpc "github.com/e2engine/instrumentation-go/grpc"
e2enginehttp "github.com/e2engine/instrumentation-go/http"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protodesc"
"google.golang.org/protobuf/reflect/protoreflect"
Expand All @@ -26,6 +27,9 @@ func main() {
connection, err := grpc.NewClient(
entitlementsAddress,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithUnaryInterceptor(
e2enginegrpc.UnaryClientInterceptor(),
),
)
if err != nil {
http.Error(w, "dependency request failed", http.StatusBadGateway)
Expand All @@ -41,16 +45,8 @@ func main() {

response := dynamicpb.NewMessage(method.Output())

const testExecutionIDKey = "e2engine-test-execution-id"

callCtx := metadata.AppendToOutgoingContext(
r.Context(),
testExecutionIDKey,
r.Header.Get("E2Engine-Test-Execution-ID"),
)

if err := connection.Invoke(
callCtx,
r.Context(),
entitlementsRPC,
request,
response,
Expand Down Expand Up @@ -78,7 +74,10 @@ func main() {
_, _ = w.Write([]byte(`{"entitled":false}`))
})

if err := http.ListenAndServe("127.0.0.1:9000", nil); err != nil {
if err := http.ListenAndServe(
"127.0.0.1:9000",
e2enginehttp.Handler(),
); err != nil {
log.Fatal(err)
}
}
Expand Down
19 changes: 11 additions & 8 deletions services/gateway-http-body/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ import (
"io"
"log"
"net/http"

e2enginehttp "github.com/e2engine/instrumentation-go/http"
)

func main() {
client := &http.Client{
Transport: e2enginehttp.Transport(),
}

http.HandleFunc("/check", func(w http.ResponseWriter, r *http.Request) {
req, err := http.NewRequestWithContext(
r.Context(),
Expand All @@ -20,13 +26,7 @@ func main() {
return
}

const testExecutionIDHeader = "E2Engine-Test-Execution-ID"
req.Header.Set(
testExecutionIDHeader,
r.Header.Get(testExecutionIDHeader),
)

resp, err := http.DefaultClient.Do(req)
resp, err := client.Do(req)
if err != nil {
http.Error(w, "dependency request failed", http.StatusBadGateway)
return
Expand All @@ -50,7 +50,10 @@ func main() {
_, _ = w.Write(body)
})

if err := http.ListenAndServe("127.0.0.1:9000", nil); err != nil {
if err := http.ListenAndServe(
"127.0.0.1:9000",
e2enginehttp.Handler(),
); err != nil {
log.Fatal(err)
}
}
8 changes: 7 additions & 1 deletion services/gateway-http-path/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"os"
"strconv"
"time"

e2enginehttp "github.com/e2engine/instrumentation-go/http"
)

func main() {
Expand All @@ -20,6 +22,10 @@ func main() {
}
}

client := &http.Client{
Transport: e2enginehttp.Transport(),
}

http.HandleFunc("/check", func(w http.ResponseWriter, r *http.Request) {
req, err := http.NewRequestWithContext(
r.Context(),
Expand All @@ -38,7 +44,7 @@ func main() {
r.Header.Get(testExecutionIDHeader),
)

resp, err := http.DefaultClient.Do(req)
resp, err := client.Do(req)
if err != nil {
http.Error(w, "dependency request failed", http.StatusBadGateway)
return
Expand Down
Loading
Loading