Skip to content

Commit cc5e576

Browse files
ardatangemini-code-assist[bot]kamilkisiela
authored
fix(ci): fail when audit tests failing (#495)
Federation audit tests are currently failing but CI workflow wasn't failing. So this makes CI workflow fail if some of audit test cases are failing. The failing test cases fixed here; #496 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Kamil Kisiela <[email protected]>
1 parent ef3dbfd commit cc5e576

File tree

2 files changed

+10
-62
lines changed

2 files changed

+10
-62
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ jobs:
159159
report_paths: "audits/reports/*.xml"
160160
group_reports: false
161161
annotate_only: true
162-
fail_on_failure: true # do not fail the job if the report fails
163-
fail_on_parse_error: true # do not fail the job if the report cannot be parsed
162+
fail_on_failure: true
163+
fail_on_parse_error: true
164164
job_summary: true
165165
verbose_summary: false
166166
skip_success_summary: true
@@ -211,8 +211,8 @@ jobs:
211211
job_name: federation-audit
212212
check_name: federation-audit
213213
check_title_template: "{{FILE_NAME}}"
214-
fail_on_failure: false # do not fail the job if the report fails
215-
fail_on_parse_error: false # do not fail the job if the report cannot be parsed
214+
fail_on_failure: true
215+
fail_on_parse_error: true
216216
annotate_only: true
217217
job_summary: true
218218
verbose_summary: false

lib/executor/src/response/graphql_error.rs

Lines changed: 6 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use graphql_parser::Pos;
22
use graphql_tools::validation::utils::ValidationError;
3-
use serde::{de, Deserialize, Deserializer, Serialize};
3+
use serde::{Deserialize, Serialize};
44
use sonic_rs::Value;
5-
use std::{collections::HashMap, fmt};
5+
use std::collections::HashMap;
66

77
#[derive(Clone, Debug, Deserialize, Serialize)]
88
#[serde(rename_all = "camelCase")]
@@ -120,68 +120,16 @@ pub struct GraphQLErrorLocation {
120120
pub column: usize,
121121
}
122122

123-
#[derive(Clone, Debug, Serialize, PartialEq)]
123+
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
124+
#[serde(untagged)]
124125
pub enum GraphQLErrorPathSegment {
125126
String(String),
126127
Index(usize),
127128
}
128129

129-
impl<'de> Deserialize<'de> for GraphQLErrorPathSegment {
130-
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
131-
where
132-
D: Deserializer<'de>,
133-
{
134-
struct PathSegmentVisitor;
135-
136-
impl<'de> de::Visitor<'de> for PathSegmentVisitor {
137-
type Value = GraphQLErrorPathSegment;
138-
139-
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
140-
formatter.write_str("a string or an integer for a GraphQL path segment")
141-
}
142-
143-
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
144-
where
145-
E: de::Error,
146-
{
147-
Ok(GraphQLErrorPathSegment::String(value.to_owned()))
148-
}
149-
150-
fn visit_string<E>(self, value: String) -> Result<Self::Value, E>
151-
where
152-
E: de::Error,
153-
{
154-
Ok(GraphQLErrorPathSegment::String(value))
155-
}
156-
157-
fn visit_u64<E>(self, value: u64) -> Result<Self::Value, E>
158-
where
159-
E: de::Error,
160-
{
161-
Ok(GraphQLErrorPathSegment::Index(value as usize))
162-
}
163-
164-
fn visit_i64<E>(self, value: i64) -> Result<Self::Value, E>
165-
where
166-
E: de::Error,
167-
{
168-
if value < 0 {
169-
return Err(E::custom(format!(
170-
"path segment must be a non-negative integer, but got {}",
171-
value
172-
)));
173-
}
174-
Ok(GraphQLErrorPathSegment::Index(value as usize))
175-
}
176-
}
177-
178-
deserializer.deserialize_any(PathSegmentVisitor)
179-
}
180-
}
181-
182-
#[derive(Clone, Debug, Deserialize, Serialize, Default)]
130+
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
131+
#[serde(transparent)]
183132
pub struct GraphQLErrorPath {
184-
#[serde(flatten)]
185133
pub segments: Vec<GraphQLErrorPathSegment>,
186134
}
187135

0 commit comments

Comments
 (0)