Skip to content

Commit

Permalink
refactor: move the skip marker into the heading (#1920)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddOnTop authored May 12, 2024
1 parent 6fbeebc commit b1c49f5
Show file tree
Hide file tree
Showing 97 changed files with 115 additions and 117 deletions.
36 changes: 16 additions & 20 deletions tests/core/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ impl ExecutionSpec {
let split = expect.value.splitn(2, ':').collect::<Vec<&str>>();
match split[..] {
[a, b] => {
check_identity =
a.contains("check_identity") && b.ends_with("true");
sdl_error = a.contains("expect_validation_error")
&& b.ends_with("true");
check_identity = a.contains("identity") && b.ends_with("true");
sdl_error = a.contains("error") && b.ends_with("true");
if a.contains("skip") && b.ends_with("true") {
runner = Some(Annotation::Skip);
}
}
_ => {
return Err(anyhow!(
Expand All @@ -100,31 +101,26 @@ impl ExecutionSpec {
}
} else if heading.depth == 5 {
// Parse annotation
if runner.is_none() {
return if runner.is_none() {
if let Some(Node::Text(text)) = heading.children.first() {
runner = Some(match text.value.as_str() {
"skip" => Annotation::Skip,
_ => {
return Err(anyhow!(
"Unexpected runner annotation {:?} in {:?}",
text.value,
path,
));
}
});
Err(anyhow!(
"Unexpected runner annotation {:?} in {:?}",
text.value,
path,
))
} else {
return Err(anyhow!(
Err(anyhow!(
"Unexpected content of level 5 heading in {:?}: {:#?}",
path,
heading
));
))
}
} else {
return Err(anyhow!(
Err(anyhow!(
"Unexpected double-declaration of runner annotation in {:?}",
path
));
}
))
};
} else if heading.depth == 4 {
} else {
return Err(anyhow!(
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/add-field-many-list.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# add-field-many-list
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/add-field-many.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# add-field-many
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/auth-protected-without-auth.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# Using @protected operator without specifying server.auth config
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/auth.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# auth
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/cors-invalid-expose-headers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# Cors invalid exposeHeaders
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/cors-invalid-headers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# Cors invalid allowHeaders
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/cors-invalid-methods.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# Cors invalid allowMethods
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/cors-invalid-origins.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# Cors invalid allowOrigins
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/experimental-headers-error.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-experimental-headers-error
Expand Down
6 changes: 4 additions & 2 deletions tests/execution/graphql-dataloader-batch-keys.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# GraphQL datasource
---
skip: true
---

##### skip
# GraphQL datasource

[//]: # "nested @graphql directives currently not supported"
[//]: # "This test had an assertion with a fail annotation that testconv cannot convert losslessly. If you need the original responses, you can find it in git history. For example, at commit https://github.com/tailcallhq/tailcall/tree/1c32ca9e8080ae3b17e9cf41078d028d3e0289da"
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/inline-many-list.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# inline-many-list
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/inline-many.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# inline-many
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/input-type-protected-error.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# input-type-protected-error
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/omit-many.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# omit-many
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-add-field-error.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-add-field-error
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-add-field-list.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-add-field-list
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-add-field.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-add-field
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-add-link-to-empty-config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-add-link-to-empty-config
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-all-blueprint-errors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-all-blueprint-errors
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-batch-operator-post.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-batch-operator-post
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-batching-group-by.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-batching-group-by
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-cache.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-cache
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-call-operator-errors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-call-operator
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-custom-scalar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-custom-scalar
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-custom-types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-custom-types
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-dbl-usage-many.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-dbl-usage-many
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-dbl-usage.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-dbl-usage
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-description-many.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-description-many
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-directives-undef-null-fields.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-directives-undef-null-fields
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-duplicated-link.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-duplicated-link
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-empty-link.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-empty-link
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-enum-description.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-enum-description
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-enum-empty.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-enum-empty
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-enum.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-enum
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-expr-error.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-expr-error
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-expr-with-add-field.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-expr-with-add-field
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-expr-with-inline.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-expr-with-inline
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-expr.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-expr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-field-already-implemented-from-Interface
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-graphqlsource-no-base-url.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-graphqlsource-no-base-url
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-graphqlsource.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
check_identity: true
identity: true
---

# test-graphqlsource
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-groupby-without-batching.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-groupby-without-batching
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-grpc-group-by.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-grpc-group-by
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-grpc-invalid-method-format.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-grpc-invalid-method-format
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-grpc-invalid-proto-id.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-grpc-invalid-proto-id
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-grpc-missing-fields.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-grpc-missing-fields
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-grpc-nested-data.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-grpc-nested-data
Expand Down
2 changes: 1 addition & 1 deletion tests/execution/test-grpc-nested-optional.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
expect_validation_error: true
error: true
---

# test-grpc-nested-optional
Expand Down
Loading

1 comment on commit b1c49f5

@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.03ms 3.11ms 78.63ms 71.49%
Req/Sec 3.60k 131.86 4.10k 89.33%

429382 requests in 30.01s, 2.15GB read

Requests/sec: 14308.96

Transfer/sec: 73.44MB

Please sign in to comment.