-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasm bug fixes, and added smoke tests and ci workflow (#389)
- Loading branch information
1 parent
d5d39ad
commit a82d687
Showing
37 changed files
with
3,076 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[target.wasm32-unknown-unknown] | ||
rustflags = [ | ||
"-C", "link-args=-z stack-size=3000000", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "smoke_tests" | ||
version = "0.0.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
path = "src/lib.rs" | ||
|
||
[dependencies] | ||
tokio = { workspace = true, features = ["full"] } | ||
reqwest = { workspace = true, features = ["json"] } | ||
conductor_common = { path = "../common", features = ["test_utils"] } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
insta = "1.34.0" | ||
lazy_static = "1.4.0" | ||
|
||
[features] | ||
binary = [] | ||
wasm = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Smoke Tests | ||
|
||
The purpose of these tests is to execute different flows that are connected to real data sources and other third-party dependencies. | ||
|
||
Failure in one of these tests during a PR, might indicate that one of the crucial flows is broken. | ||
|
||
## CI Setup | ||
|
||
Check the `.github/workflows/ci.yaml` (job: `smoke-test`). We are running the same tests against WASM and binary builds. | ||
|
||
## Running Locally | ||
|
||
To run locally, following these instructions: | ||
|
||
1. Make sure you have Docker engine installed and running. | ||
2. Start the third-pary dependencies by running: `docker compose -f docker-compose.yaml up -d --remove-orphans --wait --force-recreate` inside the `libs/smoke_tests` directory. | ||
3. Start a real GraphQL server by running: `cargo run` inside `tests/test-server` directory. | ||
|
||
Now, run Conductor with one of the configurations: | ||
|
||
- For binary runtime, use: `cargo run --bin conductor -- ./libs/smoke_tests/test_gw.yaml` in the root workspace dir. | ||
- For WASM runtime, use: `pnpm start:smoke` inside `bin/cloudflare_worker`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: "3.8" | ||
name: "conductor-smoke-test" | ||
services: | ||
# Keycloak (JWT/JWKS Provider) | ||
keycloak: | ||
image: quay.io/keycloak/keycloak:23.0.4 | ||
environment: | ||
KEYCLOAK_ADMIN: admin | ||
KEYCLOAK_ADMIN_PASSWORD: admin | ||
command: ["start-dev", "--import-realm"] | ||
volumes: | ||
- ./volumes/keycloak:/opt/keycloak/data/import | ||
ports: | ||
- 4001:8080 | ||
|
||
# Jaeger (Telmetry) | ||
jaeger: | ||
image: jaegertracing/all-in-one:1.53 | ||
environment: | ||
COLLECTOR_OTLP_ENABLED: true | ||
ports: | ||
- 4317:4317 # OTLP over gRPC | ||
- 4318:4318 # OTLP over HTTP | ||
- 6831:6831/udp # Jaeger Thrift over compact thrift protocol, UDP | ||
- 6832:6832/udp # Jaeger Thrift over binary thrift protocol, UDP | ||
- 16686:16686 # Jaeger UI / API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#[cfg(test)] | ||
mod smoke_http_get { | ||
use insta::assert_debug_snapshot; | ||
use lazy_static::lazy_static; | ||
use reqwest::header::{HeaderMap, CONTENT_TYPE}; | ||
use serde_json::Value; | ||
use std::env::var; | ||
|
||
lazy_static! { | ||
static ref CONDUCTOR_URL: String = var("CONDUCTOR_URL").expect("CONDUCTOR_URL env var not set"); | ||
} | ||
|
||
#[tokio::test] | ||
async fn http_get() { | ||
let mut headers = HeaderMap::default(); | ||
headers.append( | ||
CONTENT_TYPE, | ||
"application/x-www-form-urlencoded".parse().unwrap(), | ||
); | ||
|
||
let req = reqwest::Client::new() | ||
.request( | ||
reqwest::Method::GET, | ||
format!( | ||
"{}/http-get?query=query%20%7B%20__typename%20%7D", | ||
CONDUCTOR_URL.as_str() | ||
), | ||
) | ||
.headers(headers); | ||
|
||
let gql_response = req | ||
.send() | ||
.await | ||
.expect("failed to run http req to conductor"); | ||
assert_eq!(gql_response.status(), 200); | ||
let json_body = gql_response.json::<Value>().await.unwrap(); | ||
assert_debug_snapshot!(json_body); | ||
} | ||
} |
Oops, something went wrong.