Skip to content

Commit

Permalink
refactor: Clean up JSON Like (#2423)
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath authored Jul 13, 2024
1 parent d98772d commit 6e3a880
Show file tree
Hide file tree
Showing 14 changed files with 373 additions and 308 deletions.
2 changes: 1 addition & 1 deletion benches/request_template_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl PathValue for Context {
}

impl PathString for Context {
fn path_string<T: AsRef<str>>(&self, parts: &[T]) -> Option<Cow<'_, str>> {
fn path_string<'a, T: AsRef<str>>(&'a self, parts: &'a [T]) -> Option<Cow<'_, str>> {
self.value.path_string(parts)
}
}
Expand Down
1 change: 1 addition & 0 deletions project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ entr
Hasher
Htpasswd
httpmock
indexmap
inlines
insta
jsonplaceholder
Expand Down
2 changes: 1 addition & 1 deletion src/core/blueprint/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ fn update_args<'a>(
{
TryFold::<(&ConfigModule, &Field, &config::Type, &str), FieldDefinition, String>::new(
move |(_, field, _typ, name), _| {
// TODO! assert type name
// TODO: assert type name
Valid::from_iter(field.args.iter(), |(name, arg)| {
Valid::succeed(InputFieldDefinition {
name: name.clone(),
Expand Down
8 changes: 4 additions & 4 deletions src/core/grpc/request_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ mod tests {
}

impl crate::core::path::PathString for Context {
fn path_string<T: AsRef<str>>(&self, parts: &[T]) -> Option<Cow<'_, str>> {
fn path_string<'a, T: AsRef<str>>(&'a self, parts: &'a [T]) -> Option<Cow<'_, str>> {
self.value.path_string(parts)
}
}
Expand Down Expand Up @@ -283,7 +283,7 @@ mod tests {

#[tokio::test]
async fn test_grpc_cache_key_collision() {
let tmpls = [
let arr = [
r#"{ "name": "test" }"#,
r#"{ "name": "test1" }"#,
r#"{ "name1": "test" }"#,
Expand All @@ -292,7 +292,7 @@ mod tests {

let ctx = Context::default();
let tmpl_set: HashSet<_> =
futures_util::future::join_all(tmpls.iter().cloned().zip(std::iter::repeat(&ctx)).map(
futures_util::future::join_all(arr.iter().cloned().zip(std::iter::repeat(&ctx)).map(
|(body_str, ctx)| async {
let tmpl = request_template_with_body(body_str).await;
tmpl.cache_key(ctx)
Expand All @@ -302,6 +302,6 @@ mod tests {
.into_iter()
.collect();

assert_eq!(tmpls.len(), tmpl_set.len());
assert_eq!(arr.len(), tmpl_set.len());
}
}
2 changes: 1 addition & 1 deletion src/core/http/request_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ mod tests {
}

impl crate::core::path::PathString for Context {
fn path_string<T: AsRef<str>>(&self, parts: &[T]) -> Option<Cow<'_, str>> {
fn path_string<'a, T: AsRef<str>>(&'a self, parts: &'a [T]) -> Option<Cow<'_, str>> {
self.value.path_string(parts)
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/jit/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct Executor<Synth, IRExec> {

impl<Input: Clone, Output, Error, Synth, Exec> Executor<Synth, Exec>
where
Output: JsonLike<Json = Output> + Debug,
Output: for<'a> JsonLike<'a> + Debug,
Synth: Synthesizer<Value = Result<Output, Error>, Variable = Input>,
Exec: IRExecutor<Input = Input, Output = Output, Error = Error>,
{
Expand Down Expand Up @@ -56,7 +56,7 @@ struct ExecutorInner<'a, Input, Output, Error, Exec> {

impl<'a, Input, Output, Error, Exec> ExecutorInner<'a, Input, Output, Error, Exec>
where
Output: JsonLike<Json = Output> + Debug,
Output: for<'i> JsonLike<'i> + Debug,
Exec: IRExecutor<Input = Input, Output = Output, Error = Error>,
{
fn new(
Expand Down Expand Up @@ -93,7 +93,7 @@ where
if let Ok(array) = value.as_array_ok() {
join_all(field.nested().iter().map(|field| {
join_all(array.iter().enumerate().map(|(index, value)| {
let ctx = ctx.with_value(value);
let ctx = ctx.with_value(value); // Output::JsonArray::Value
let data_path = data_path.clone().with_index(index);
async move { self.execute(field, &ctx, data_path).await }
}))
Expand Down
2 changes: 1 addition & 1 deletion src/core/jit/synth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{Store, Variables};
use crate::core::json::JsonLike;
pub trait Synthesizer {
type Value;
type Variable: JsonLike;
type Variable: for<'a> JsonLike<'a>;
fn synthesize(
self,
store: Store<Self::Value>,
Expand Down
92 changes: 92 additions & 0 deletions src/core/json/borrow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
use serde_json_borrow::{ObjectAsVec, Value};

use super::{gather_path_matches, group_by_key, JsonLike, JsonObjectLike};

// BorrowedValue
impl<'a> JsonObjectLike<'a> for ObjectAsVec<'a> {
type Value = Value<'a>;
fn get_key(&'a self, key: &str) -> Option<&Value> {
self.get(key)
}
}

impl<'a> JsonLike<'a> for Value<'a> {
type JsonObject = ObjectAsVec<'a>;

fn null() -> Self {
Value::Null
}

fn as_array_ok(&'a self) -> Result<&'a Vec<Self>, &str> {
match self {
Value::Array(array) => Ok(array),
_ => Err("expected array"),
}
}

fn as_object_ok(&'a self) -> Result<&Self::JsonObject, &str> {
self.as_object().ok_or("expected object")
}

fn as_str_ok(&'a self) -> Result<&str, &str> {
self.as_str().ok_or("expected str")
}

fn as_i64_ok(&'a self) -> Result<i64, &str> {
self.as_i64().ok_or("expected i64")
}

fn as_u64_ok(&'a self) -> Result<u64, &str> {
self.as_u64().ok_or("expected u64")
}

fn as_f64_ok(&'a self) -> Result<f64, &str> {
self.as_f64().ok_or("expected f64")
}

fn as_bool_ok(&'a self) -> Result<bool, &str> {
self.as_bool().ok_or("expected bool")
}

fn as_null_ok(&'a self) -> Result<(), &str> {
if self.is_null() {
Ok(())
} else {
Err("expected null")
}
}

fn as_option_ok(&'a self) -> Result<Option<&Self>, &str> {
match self {
Value::Null => Ok(None),
_ => Ok(Some(self)),
}
}

fn get_path<T: AsRef<str>>(&'a self, path: &'a [T]) -> Option<&Self> {
let mut val = self;
for token in path {
val = match val {
Value::Array(arr) => {
let index = token.as_ref().parse::<usize>().ok()?;
arr.get(index)?
}
Value::Object(map) => map.get(token.as_ref())?,
_ => return None,
};
}
Some(val)
}

fn get_key(&'a self, _path: &'a str) -> Option<&Self> {
match self {
Value::Object(map) => map.get(_path),
_ => None,
}
}

fn group_by(&'a self, path: &'a [String]) -> std::collections::HashMap<String, Vec<&Self>> {
let src = gather_path_matches(self, path, vec![]);
group_by_key(src)
}
}
112 changes: 112 additions & 0 deletions src/core/json/graphql.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
use std::collections::HashMap;

use async_graphql::Name;
use async_graphql_value::ConstValue;
use indexmap::IndexMap;

use super::*;

impl<'a, Value: JsonLike<'a> + Clone> JsonObjectLike<'a> for IndexMap<Name, Value> {
type Value = Value;
fn get_key(&'a self, key: &str) -> Option<&Self::Value> {
self.get(&Name::new(key))
}
}

impl<'a> JsonLike<'a> for ConstValue {
type JsonObject = IndexMap<Name, ConstValue>;

fn as_array_ok(&'a self) -> Result<&'a Vec<Self>, &str> {
match self {
ConstValue::List(seq) => Ok(seq),
_ => Err("array"),
}
}

fn as_str_ok(&self) -> Result<&str, &str> {
match self {
ConstValue::String(s) => Ok(s),
_ => Err("str"),
}
}

fn as_i64_ok(&self) -> Result<i64, &str> {
match self {
ConstValue::Number(n) => n.as_i64().ok_or("expected i64"),
_ => Err("i64"),
}
}

fn as_u64_ok(&self) -> Result<u64, &str> {
match self {
ConstValue::Number(n) => n.as_u64().ok_or("expected u64"),
_ => Err("u64"),
}
}

fn as_f64_ok(&self) -> Result<f64, &str> {
match self {
ConstValue::Number(n) => n.as_f64().ok_or("expected f64"),
_ => Err("f64"),
}
}

fn as_bool_ok(&self) -> Result<bool, &str> {
match self {
ConstValue::Boolean(b) => Ok(*b),
_ => Err("bool"),
}
}

fn as_null_ok(&self) -> Result<(), &str> {
match self {
ConstValue::Null => Ok(()),
_ => Err("null"),
}
}

fn as_option_ok(&self) -> Result<Option<&Self>, &str> {
match self {
ConstValue::Null => Ok(None),
_ => Ok(Some(self)),
}
}

fn get_path<T: AsRef<str>>(&self, path: &[T]) -> Option<&Self> {
let mut val = self;
for token in path {
val = match val {
ConstValue::List(seq) => {
let index = token.as_ref().parse::<usize>().ok()?;
seq.get(index)?
}
ConstValue::Object(map) => map.get(token.as_ref())?,
_ => return None,
};
}
Some(val)
}

fn get_key(&self, path: &str) -> Option<&Self> {
match self {
ConstValue::Object(map) => map.get(&async_graphql::Name::new(path)),
_ => None,
}
}

fn group_by(&'a self, path: &'a [String]) -> HashMap<String, Vec<&'a Self>> {
let src = gather_path_matches(self, path, vec![]);
group_by_key(src)
}

fn null() -> Self {
Default::default()
}

fn as_object_ok(&'a self) -> Result<&Self::JsonObject, &str> {
match self {
ConstValue::Object(map) => Ok(map),
_ => Err("expected object"),
}
}
}
Loading

2 comments on commit 6e3a880

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running 227 tests
test run_execution_spec::add-field-index-list.md ... ok
test run_execution_spec::add-field-many.md ... ok
test run_execution_spec::add-field-many-list.md ... ok
test run_execution_spec::add-field-modify.md ... ok
test run_execution_spec::add-field-with-modify.md ... ok
test run_execution_spec::add-field-with-composition.md ... ok
test run_execution_spec::add-field.md ... ok
test run_execution_spec::apollo-tracing.md ... ok
test run_execution_spec::async-cache-disabled.md ... ok
test run_execution_spec::async-cache-enable-multiple-resolvers.md ... FAILED
test run_execution_spec::async-cache-enabled.md ... FAILED
test run_execution_spec::async-cache-global.md ... FAILED
test run_execution_spec::async-cache-inflight-request.md ... FAILED
test run_execution_spec::auth-protected-without-auth.md ... ok
test run_execution_spec::auth-jwt.md ... FAILED
test run_execution_spec::auth-basic.md ... FAILED
test run_execution_spec::auth.md ... ok
test run_execution_spec::batching-disabled.md ... FAILED
test run_execution_spec::batching-default.md ... ok
test run_execution_spec::batching-group-by-default.md ... ok
test run_execution_spec::batching-group-by.md ... ok
test run_execution_spec::batching-post.md ... ok
test run_execution_spec::batching.md ... FAILED
test run_execution_spec::cache-control.md ... FAILED
test run_execution_spec::caching-collision.md ... ok
test run_execution_spec::caching.md ... ok
test run_execution_spec::call-graphql-datasource.md ... FAILED
test run_execution_spec::call-multiple-steps-piping.md ... FAILED
test run_execution_spec::call-mutation.md ... FAILED
test run_execution_spec::call-operator.md ... FAILED
test run_execution_spec::cors-allow-cred-false.md ... ok
test run_execution_spec::cors-invalid-expose-headers.md ... ok
test run_execution_spec::cors-invalid-headers.md ... ok
test run_execution_spec::cors-invalid-methods.md ... ok
test run_execution_spec::cors-invalid-origins.md ... ok
test run_execution_spec::cors-allow-cred-true.md ... ok
test run_execution_spec::cors-allow-cred-vary.md ... ok
test run_execution_spec::custom-headers.md ... ok
test run_execution_spec::dedupe_batch_query_execution.md ... FAILED
test run_execution_spec::default-value-arg.md ... FAILED
test run_execution_spec::experimental-headers-error.md ... ok
test run_execution_spec::default-value-config.md ... ok
test run_execution_spec::env-value.md ... ok
test run_execution_spec::experimental-headers.md ... FAILED
test run_execution_spec::graphql-dataloader-batch-request.md ... FAILED
test run_execution_spec::graphql-dataloader-no-batch-request.md ... FAILED
test run_execution_spec::graphql-datasource-errors.md ... FAILED
test run_execution_spec::graphql-datasource-mutation.md ... FAILED
test run_execution_spec::graphql-datasource-no-args.md ... FAILED
test run_execution_spec::graphql-datasource-with-args.md ... FAILED
test run_execution_spec::graphql-datasource-with-empty-enum.md ... ok
test run_execution_spec::graphql-datasource-with-mandatory-enum.md ... FAILED
test run_execution_spec::graphql-nested-datasource.md ... FAILED
test run_execution_spec::grpc-batch.md ... FAILED
test run_execution_spec::grpc-json.md ... FAILED
test run_execution_spec::grpc-error.md ... FAILED
test run_execution_spec::grpc-map.md ... FAILED
test run_execution_spec::grpc-oneof.md ... FAILED
test run_execution_spec::grpc-proto-with-same-package.md ... ok
test run_execution_spec::grpc-override-url-from-upstream.md ... ok
test run_execution_spec::grpc-reflection.md ... ok
test run_execution_spec::grpc-simple.md ... ok
test run_execution_spec::grpc-url-from-upstream.md ... ok
test run_execution_spec::https.md ... ok
test run_execution_spec::inline-field.md ... FAILED
test run_execution_spec::inline-index-list.md ... ok
test run_execution_spec::input-type-protected-error.md ... ok
test run_execution_spec::io-cache.md ... ok
test run_execution_spec::inline-many-list.md ... ok
test run_execution_spec::inline-many.md ... ok
test run_execution_spec::js-directive.md ... FAILED
test run_execution_spec::modified-field.md ... ok
test run_execution_spec::mutation-put.md ... FAILED
test run_execution_spec::mutation.md ... FAILED
test run_execution_spec::jsonplaceholder-call-post.md ... ok
test run_execution_spec::n-plus-one-list.md ... ok
test run_execution_spec::n-plus-one.md ... ok
test run_execution_spec::nested-objects.md ... ok
test run_execution_spec::nesting-level3.md ... ok
test run_execution_spec::nullable-arg-query.md ... FAILED
test run_execution_spec::omit-index-list.md ... ok
test run_execution_spec::omit-many.md ... ok
test run_execution_spec::recursive-types-no-resolver.md ... ok
test run_execution_spec::omit-resolved-by-parent.md ... FAILED
test run_execution_spec::recursive-types-json.md ... FAILED
test run_execution_spec::ref-other-nested.md ... ok
test run_execution_spec::recursive-types.md ... FAILED
test run_execution_spec::ref-other.md ... ok
test run_execution_spec::rename-field.md ... ok
test run_execution_spec::request-to-upstream-batching.md ... FAILED
test run_execution_spec::resolve-with-headers.md ... FAILED
test run_execution_spec::resolve-with-vars.md ... ok
test run_execution_spec::rest-api-error.md ... ok
test run_execution_spec::resolved-by-parent.md ... FAILED
test run_execution_spec::rest-api-post.md ... ok
test run_execution_spec::rest-api.md ... ok
test run_execution_spec::showcase.md ... ok
test run_execution_spec::test-add-field-error.md ... ok
test run_execution_spec::simple-graphql.md ... ok
test run_execution_spec::simple-query.md ... ok
test run_execution_spec::test-add-field-list.md ... ok
test run_execution_spec::test-all-blueprint-errors.md ... ok
test run_execution_spec::test-batch-operator-post.md ... ok
test run_execution_spec::test-add-field.md ... ok
test run_execution_spec::test-add-link-to-empty-config.md ... ok
test run_execution_spec::test-call-operator-errors.md ... ok
test run_execution_spec::test-conflict-allowed-headers.md ... ok
test run_execution_spec::test-batching-group-by.md ... ok
test run_execution_spec::test-conflict-vars.md ... ok
test run_execution_spec::test-cache.md ... ok
test run_execution_spec::test-dbl-usage-many.md ... ok
test run_execution_spec::test-custom-scalar.md ... ok
test run_execution_spec::test-custom-types.md ... ok
test run_execution_spec::test-directives-undef-null-fields.md ... ok
test run_execution_spec::test-empty-link.md ... ok
test run_execution_spec::test-duplicated-link.md ... ok
test run_execution_spec::test-enable-jit.md ... ok
test run_execution_spec::test-description-many.md ... ok
test run_execution_spec::test-enum-aliases.md ... ok
test run_execution_spec::test-enum-empty.md ... ok
test run_execution_spec::test-enum-default.md ... ok
test run_execution_spec::test-enum-merge.md ... ok
test run_execution_spec::test-expr-error.md ... ok
test run_execution_spec::test-enum-description.md ... FAILED
test run_execution_spec::test-expr-scalar-as-string.md ... ok
test run_execution_spec::test-expr-with-inline.md ... ok
test run_execution_spec::test-expr-with-add-field.md ... ok
test run_execution_spec::test-enum.md ... FAILED
test run_execution_spec::test-field-already-implemented-from-Interface.md ... ok
test run_execution_spec::test-graphqlsource-no-base-url.md ... ok
test run_execution_spec::test-expr-with-mustache.md ... ok
test run_execution_spec::test-groupby-without-batching.md ... ok
test run_execution_spec::test-grpc-group-by.md ... ok
test run_execution_spec::test-grpc-invalid-method-format.md ... ok
test run_execution_spec::test-grpc-invalid-proto-id.md ... ok
test run_execution_spec::test-grpc-missing-fields.md ... ok
test run_execution_spec::test-grpc-nested-data.md ... ok
test run_execution_spec::test-grpc-nested-optional.md ... ok
test run_execution_spec::test-grpc-optional.md ... ok
test run_execution_spec::test-grpc-proto-path.md ... ok
test run_execution_spec::test-grpc-service-method.md ... ok
test run_execution_spec::test-grpc-service.md ... ok
test run_execution_spec::test-expr.md ... ok
test run_execution_spec::test-hostname-faliure.md ... ok
test run_execution_spec::test-graphqlsource.md ... ok
test run_execution_spec::test-grpc.md ... ok
test run_execution_spec::test-http-baseurl.md ... ok
test run_execution_spec::test-http-with-add-field.md ... ok
test run_execution_spec::test-http-with-inline.md ... ok
test run_execution_spec::test-http-headers.md ... ok
test run_execution_spec::test-http-with-mustache-expr.md ... ok
test run_execution_spec::test-inline-error.md ... ok
test run_execution_spec::test-http-tmpl.md ... ok
test run_execution_spec::test-http.md ... ok
test run_execution_spec::test-inline-list.md ... ok
test run_execution_spec::test-inline.md ... ok
test run_execution_spec::test-input-out.md ... FAILED
test run_execution_spec::test-input-with-arg-out.md ... FAILED
test run_execution_spec::test-input-documentation.md ... ok
test run_execution_spec::test-interface-from-json.md ... ok
test run_execution_spec::test-invalid-query-in-http.md ... ok
test run_execution_spec::test-invalid-server.md ... ok
test run_execution_spec::test-js-multi-onRequest-handlers.md ... ok
test run_execution_spec::test-js-multiple-scripts.md ... ok
test run_execution_spec::test-interface-result.md ... ok
test run_execution_spec::test-interface.md ... ok
test run_execution_spec::test-lack-resolver.md ... ok
test run_execution_spec::test-js-request-response-2.md ... ok
test run_execution_spec::test-js-request-response.md ... ok
test run_execution_spec::test-merge-batch.md ... ok
test run_execution_spec::test-list-args.md ... FAILED
test run_execution_spec::test-merge-nested.md ... ok
test run_execution_spec::test-merge-query.md ... ok
test run_execution_spec::test-merge-right-with-link-config.md ... ok
test run_execution_spec::test-merge-union.md ... ok
test run_execution_spec::test-missing-mutation-resolver.md ... ok
test run_execution_spec::test-missing-query-resolver.md ... ok
test run_execution_spec::test-missing-argument-on-all-resolvers.md ... ok
test run_execution_spec::test-missing-root-types.md ... ok
test run_execution_spec::test-missing-schema-query.md ... ok
test run_execution_spec::test-merge-server-sdl.md ... ok
test run_execution_spec::test-multiple-config-types.md ... FAILED
test run_execution_spec::test-multiple-resolvable-directives-on-field.md ... ok
test run_execution_spec::test-modify.md ... ok
test run_execution_spec::test-multi-interface.md ... ok
test run_execution_spec::test-nested-input.md ... ok
test run_execution_spec::test-no-base-url.md ... ok
test run_execution_spec::test-nested-link.md ... ok
test run_execution_spec::test-nested-value.md ... ok
test run_execution_spec::test-null-in-array.md ... ok
test run_execution_spec::test-null-in-object.md ... ok
test run_execution_spec::test-omit-list.md ... ok
test run_execution_spec::test-params-as-body.md ... FAILED
test run_execution_spec::test-omit.md ... ok
test run_execution_spec::test-query-documentation.md ... ok
test run_execution_spec::test-query.md ... ok
test run_execution_spec::test-response-header-value.md ... ok
test run_execution_spec::test-response-headers-multi.md ... ok
test run_execution_spec::test-response-headers-name.md ... ok
test run_execution_spec::test-response-header-merge.md ... ok
test run_execution_spec::test-ref-other.md ... ok
test run_execution_spec::test-scalars-builtin.md ... FAILED
test run_execution_spec::test-scalars-integers.md ... FAILED
test run_execution_spec::test-scalars-validation.md ... FAILED
test run_execution_spec::test-server-base-types.md ... ok
test run_execution_spec::test-scalars.md ... FAILED
test run_execution_spec::test-static-value.md ... ok
test run_execution_spec::test-set-cookie-headers.md ... FAILED
test run_execution_spec::test-undefined-query.md ... ok
test run_execution_spec::test-server-vars.md ... ok
test run_execution_spec::test-union-many-types.md ... ok
test run_execution_spec::test-union-same-types.md ... ok
test run_execution_spec::test-union-ambiguous.md ... FAILED
test run_execution_spec::test-tag.md ... ok
test run_execution_spec::test-upstream-headers.md ... ok
test run_execution_spec::undeclared-type-no-base-url.md ... ok
test run_execution_spec::undeclared-type.md ... ok
test run_execution_spec::test-union.md ... FAILED
test run_execution_spec::upstream-batching.md ... FAILED
test run_execution_spec::test-upstream.md ... ok
test run_execution_spec::upstream-fail-request.md ... FAILED
test run_execution_spec::with-args-url.md ... FAILED
test run_execution_spec::with-args.md ... FAILED
test run_execution_spec::with-nesting.md ... ok
test run_execution_spec::yaml-nested-unions.md ... ok
test run_execution_spec::yaml-union-in-type.md ... ok
test run_execution_spec::yaml-union.md ... ok

failures:

---- run_execution_spec::async-cache-enable-multiple-resolvers.md ----
test panicked: not yet implemented

---- run_execution_spec::async-cache-enabled.md ----
test panicked: not yet implemented

---- run_execution_spec::async-cache-global.md ----
test panicked: not yet implemented

---- run_execution_spec::async-cache-inflight-request.md ----
test panicked: not yet implemented

---- run_execution_spec::auth-jwt.md ----
test panicked: snapshot assertion for 'auth-jwt.md_1' failed in line 202

---- run_execution_spec::auth-basic.md ----
test panicked: snapshot assertion for 'auth-basic.md_1' failed in line 202

---- run_execution_spec::batching-disabled.md ----
test panicked: not yet implemented

---- run_execution_spec::batching.md ----
test panicked: not yet implemented

---- run_execution_spec::cache-control.md ----
test panicked: not yet implemented

---- run_execution_spec::call-graphql-datasource.md ----
test panicked: not yet implemented

---- run_execution_spec::call-multiple-steps-piping.md ----
test panicked: not yet implemented

---- run_execution_spec::call-mutation.md ----
test panicked: not yet implemented

---- run_execution_spec::call-operator.md ----
test panicked: not yet implemented

---- run_execution_spec::dedupe_batch_query_execution.md ----
test panicked: not yet implemented

---- run_execution_spec::default-value-arg.md ----
test panicked: not yet implemented

---- run_execution_spec::experimental-headers.md ----
test panicked: snapshot assertion for 'experimental-headers.md_0' failed in line 202

---- run_execution_spec::graphql-dataloader-batch-request.md ----
test panicked: not yet implemented

---- run_execution_spec::graphql-dataloader-no-batch-request.md ----
test panicked: not yet implemented

---- run_execution_spec::graphql-datasource-errors.md ----
test panicked: not yet implemented

---- run_execution_spec::graphql-datasource-mutation.md ----
test panicked: not yet implemented

---- run_execution_spec::graphql-datasource-no-args.md ----
test panicked: not yet implemented

---- run_execution_spec::graphql-datasource-with-args.md ----
test panicked: not yet implemented

---- run_execution_spec::graphql-datasource-with-mandatory-enum.md ----
test panicked: snapshot assertion for 'graphql-datasource-with-mandatory-enum.md_0' failed in line 202

---- run_execution_spec::graphql-nested-datasource.md ----
test panicked: not yet implemented

---- run_execution_spec::grpc-batch.md ----
test panicked: not yet implemented

---- run_execution_spec::grpc-json.md ----
test panicked: not yet implemented

---- run_execution_spec::grpc-error.md ----
test panicked: snapshot assertion for 'grpc-error.md_0' failed in line 202

---- run_execution_spec::grpc-map.md ----
test panicked: not yet implemented

---- run_execution_spec::grpc-oneof.md ----
test panicked: not yet implemented

---- run_execution_spec::inline-field.md ----
test panicked: snapshot assertion for 'inline-field.md_0' failed in line 202

---- run_execution_spec::js-directive.md ----
test panicked: snapshot assertion for 'js-directive.md_0' failed in line 202

---- run_execution_spec::mutation-put.md ----
test panicked: not yet implemented

---- run_execution_spec::mutation.md ----
test panicked: not yet implemented

---- run_execution_spec::nullable-arg-query.md ----
test panicked: not yet implemented

---- run_execution_spec::omit-resolved-by-parent.md ----
test panicked: snapshot assertion for 'omit-resolved-by-parent.md_0' failed in line 202

---- run_execution_spec::recursive-types-json.md ----
test panicked: snapshot assertion for 'recursive-types-json.md_0' failed in line 202

---- run_execution_spec::recursive-types.md ----
test panicked: snapshot assertion for 'recursive-types.md_0' failed in line 202

---- run_execution_spec::request-to-upstream-batching.md ----
test panicked: not yet implemented

---- run_execution_spec::resolve-with-headers.md ----
test panicked: snapshot assertion for 'resolve-with-headers.md_0' failed in line 202

---- run_execution_spec::resolved-by-parent.md ----
test panicked: snapshot assertion for 'resolved-by-parent.md_0' failed in line 202

---- run_execution_spec::test-enum-description.md ----
test panicked: not yet implemented

---- run_execution_spec::test-enum.md ----
test panicked: not yet implemented

---- run_execution_spec::test-input-out.md ----
test panicked: not yet implemented

---- run_execution_spec::test-input-with-arg-out.md ----
test panicked: not yet implemented

---- run_execution_spec::test-list-args.md ----
test panicked: not yet implemented

---- run_execution_spec::test-multiple-config-types.md ----
test panicked: not yet implemented

---- run_execution_spec::test-params-as-body.md ----
test panicked: not yet implemented

---- run_execution_spec::test-scalars-builtin.md ----
test panicked: not yet implemented

---- run_execution_spec::test-scalars-integers.md ----
test panicked: not yet implemented

---- run_execution_spec::test-scalars-validation.md ----
test panicked: not yet implemented

---- run_execution_spec::test-scalars.md ----
test panicked: not yet implemented

---- run_execution_spec::test-set-cookie-headers.md ----
test panicked: not yet implemented

---- run_execution_spec::test-union-ambiguous.md ----
test panicked: snapshot assertion for 'test-union-ambiguous.md_3' failed in line 202

---- run_execution_spec::test-union.md ----
test panicked: snapshot assertion for 'test-union.md_3' failed in line 202

---- run_execution_spec::upstream-batching.md ----
test panicked: not yet implemented

---- run_execution_spec::upstream-fail-request.md ----
test panicked: snapshot assertion for 'upstream-fail-request.md_0' failed in line 202

---- run_execution_spec::with-args-url.md ----
test panicked: not yet implemented

---- run_execution_spec::with-args.md ----
test panicked: not yet implemented

failures:
run_execution_spec::async-cache-enable-multiple-resolvers.md
run_execution_spec::async-cache-enabled.md
run_execution_spec::async-cache-global.md
run_execution_spec::async-cache-inflight-request.md
run_execution_spec::auth-jwt.md
run_execution_spec::auth-basic.md
run_execution_spec::batching-disabled.md
run_execution_spec::batching.md
run_execution_spec::cache-control.md
run_execution_spec::call-graphql-datasource.md
run_execution_spec::call-multiple-steps-piping.md
run_execution_spec::call-mutation.md
run_execution_spec::call-operator.md
run_execution_spec::dedupe_batch_query_execution.md
run_execution_spec::default-value-arg.md
run_execution_spec::experimental-headers.md
run_execution_spec::graphql-dataloader-batch-request.md
run_execution_spec::graphql-dataloader-no-batch-request.md
run_execution_spec::graphql-datasource-errors.md
run_execution_spec::graphql-datasource-mutation.md
run_execution_spec::graphql-datasource-no-args.md
run_execution_spec::graphql-datasource-with-args.md
run_execution_spec::graphql-datasource-with-mandatory-enum.md
run_execution_spec::graphql-nested-datasource.md
run_execution_spec::grpc-batch.md
run_execution_spec::grpc-json.md
run_execution_spec::grpc-error.md
run_execution_spec::grpc-map.md
run_execution_spec::grpc-oneof.md
run_execution_spec::inline-field.md
run_execution_spec::js-directive.md
run_execution_spec::mutation-put.md
run_execution_spec::mutation.md
run_execution_spec::nullable-arg-query.md
run_execution_spec::omit-resolved-by-parent.md
run_execution_spec::recursive-types-json.md
run_execution_spec::recursive-types.md
run_execution_spec::request-to-upstream-batching.md
run_execution_spec::resolve-with-headers.md
run_execution_spec::resolved-by-parent.md
run_execution_spec::test-enum-description.md
run_execution_spec::test-enum.md
run_execution_spec::test-input-out.md
run_execution_spec::test-input-with-arg-out.md
run_execution_spec::test-list-args.md
run_execution_spec::test-multiple-config-types.md
run_execution_spec::test-params-as-body.md
run_execution_spec::test-scalars-builtin.md
run_execution_spec::test-scalars-integers.md
run_execution_spec::test-scalars-validation.md
run_execution_spec::test-scalars.md
run_execution_spec::test-set-cookie-headers.md
run_execution_spec::test-union-ambiguous.md
run_execution_spec::test-union.md
run_execution_spec::upstream-batching.md
run_execution_spec::upstream-fail-request.md
run_execution_spec::with-args-url.md
run_execution_spec::with-args.md

test result: FAILED. 169 passed; 58 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.58s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running 30s test @ http://localhost:8000/graphql

4 threads and 100 connections

Thread Stats Avg Stdev Max +/- Stdev
Latency 7.47ms 3.35ms 76.71ms 70.95%
Req/Sec 3.38k 183.57 3.68k 91.83%

404067 requests in 30.01s, 2.03GB read

Requests/sec: 13464.44

Transfer/sec: 69.11MB

Please sign in to comment.