Skip to content

Commit

Permalink
temp: Replace (not available) in both logic and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
janpio committed Jun 14, 2023
1 parent 810585b commit 77574a7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion libs/user-facing-errors/src/query_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl fmt::Display for DatabaseConstraint {
}
Self::Index(index) => write!(f, "constraint: `{index}`"),
Self::ForeignKey => write!(f, "foreign key"),
Self::CannotParse => write!(f, "(not available)"),
Self::CannotParse => write!(f, "THIS SHOULD BE SOMETHING ELSE (mod.rs, DatabaseConstraint, parsing)"),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion quaint/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl fmt::Display for Name {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Available(name) => name.fmt(f),
Self::Unavailable => write!(f, "(not available)"),
Self::Unavailable => write!(f, "THIS SHOULD BE SOMETHING ELSE (error.rs, Display, Name, Unavailable"),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ mod byoid {

let error_target = match runner.connector_version() {
query_engine_tests::ConnectorVersion::MySql(_) => "constraint: `PRIMARY`",
query_engine_tests::ConnectorVersion::Vitess(_) => "(not available)",
query_engine_tests::ConnectorVersion::Vitess(_) => "MISSING",
_ => "fields: (`id`)",
};

Expand Down Expand Up @@ -84,7 +84,7 @@ mod byoid {

let error_target = match runner.connector_version() {
ConnectorVersion::MySql(_) => "constraint: `PRIMARY`",
ConnectorVersion::Vitess(_) => "(not available)",
ConnectorVersion::Vitess(_) => "MISSING",
_ => "fields: (`id`)",
};

Expand Down Expand Up @@ -142,7 +142,7 @@ mod byoid {

let error_target = match runner.connector_version() {
ConnectorVersion::MySql(_) => "constraint: `PRIMARY`",
ConnectorVersion::Vitess(_) => "(not available)",
ConnectorVersion::Vitess(_) => "MISSING",
_ => "fields: (`id`)",
};

Expand Down Expand Up @@ -170,7 +170,7 @@ mod byoid {

let error_target = match runner.connector_version() {
ConnectorVersion::MySql(_) => "constraint: `PRIMARY`",
ConnectorVersion::Vitess(_) => "(not available)",
ConnectorVersion::Vitess(_) => "MISSING",
_ => "fields: (`id`)",
};

Expand Down
2 changes: 1 addition & 1 deletion query-engine/connectors/query-connector/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl ConnectorError {
DatabaseConstraint::Fields(fields) => fields.join(","),
DatabaseConstraint::Index(index) => format!("{index} (index)"),
DatabaseConstraint::ForeignKey => "foreign key".to_string(),
DatabaseConstraint::CannotParse => "(not available)".to_string(),
DatabaseConstraint::CannotParse => "THIS SHOULD BE SOMETHING ELSE (error.rs, CannotParse)".to_string(),
};

Some(KnownError::new(user_facing_errors::query_engine::ForeignKeyViolation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ fn unique_constraint_errors_in_migrations_must_return_a_known_error(api: TestApi
let json_error = serde_json::to_value(&res).unwrap();

let expected_msg = if api.is_vitess() {
"Unique constraint failed on the (not available)"
"Unique constraint failed on the MISSING"
} else if api.is_mysql() || api.is_mssql() {
"Unique constraint failed on the constraint: `Fruit_name_key`"
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ fn unique_constraint_errors_in_migrations_must_return_a_known_error(api: TestApi
let json_error = serde_json::to_value(&res).unwrap();

let expected_msg = if api.is_vitess() {
"Unique constraint failed on the (not available)"
"Unique constraint failed on the MISSING"
} else if api.is_mysql() || api.is_mssql() {
"Unique constraint failed on the constraint: `Fruit_name_key`"
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ fn diagnose_migrations_history_reports_migrations_failing_to_apply_cleanly(api:
assert!(
known_error.message.contains("yolo")
|| known_error.message.contains("YOLO")
|| known_error.message.contains("(not available)")
|| known_error.message.contains("MISSING")
);
}
_ => panic!("assertion failed"),
Expand Down

0 comments on commit 77574a7

Please sign in to comment.