Skip to content

Commit

Permalink
Updated/added the comments on tests (#5445)
Browse files Browse the repository at this point in the history
Co-authored-by: Iryna Shestak <shestak.irina@gmail.com>
  • Loading branch information
duckki and lrlna authored Jun 15, 2024
1 parent 8f848ee commit 1b3434c
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 22 deletions.
2 changes: 0 additions & 2 deletions apollo-federation/src/operation/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1439,9 +1439,7 @@ fn add_at_path_merge_subselections() {
insta::assert_snapshot!(selection_set, @r#"{ a { b { c { d e(arg: 1) } } } }"#);
}

// TODO: `.add_at_path` should collapse unnecessary fragments
#[test]
#[ignore]
fn add_at_path_collapses_unnecessary_fragments() {
let schema =
apollo_compiler::Schema::parse_and_validate(ADD_AT_PATH_TEST_SCHEMA, "schema.graphql")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ const SUBGRAPH: &str = r#"

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: when QueryPlannerConfig::generate_query_fragments is implemented remove the
// "not implemented yet" note in its doc comment
// TODO: generate_query_fragments (https://apollographql.atlassian.net/browse/FED-76)
fn it_respects_generate_query_fragments_option() {
let planner = planner!(
config = QueryPlannerConfig { generate_query_fragments: true, ..Default::default() },
Expand Down Expand Up @@ -74,7 +72,7 @@ fn it_respects_generate_query_fragments_option() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: generate_query_fragments (https://apollographql.atlassian.net/browse/FED-76)
fn it_handles_nested_fragment_generation() {
let planner = planner!(
config = QueryPlannerConfig { generate_query_fragments: true, ..Default::default() },
Expand Down Expand Up @@ -137,7 +135,7 @@ fn it_handles_nested_fragment_generation() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: generate_query_fragments (https://apollographql.atlassian.net/browse/FED-76)
fn it_handles_fragments_with_one_non_leaf_field() {
let planner = planner!(
config = QueryPlannerConfig { generate_query_fragments: true, ..Default::default() },
Expand Down Expand Up @@ -185,7 +183,7 @@ fn it_handles_fragments_with_one_non_leaf_field() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: generate_query_fragments (https://apollographql.atlassian.net/browse/FED-76)
fn it_identifies_and_reuses_equivalent_fragments_that_arent_identical() {
let planner = planner!(
config = QueryPlannerConfig { generate_query_fragments: true, ..Default::default() },
Expand Down Expand Up @@ -235,7 +233,7 @@ fn it_identifies_and_reuses_equivalent_fragments_that_arent_identical() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: generate_query_fragments (https://apollographql.atlassian.net/browse/FED-76)
fn fragments_that_share_a_hash_but_are_not_identical_generate_their_own_fragment_definitions() {
let planner = planner!(
config = QueryPlannerConfig { generate_query_fragments: true, ..Default::default() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const SUBGRAPH_B: &str = r#"

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: investigate this failure (missing directives on fetch operation)
fn test_if_directives_at_the_operation_level_are_passed_down_to_subgraph_queries() {
let planner = planner!(
subgraphA: SUBGRAPH_A,
Expand Down Expand Up @@ -154,7 +154,7 @@ fn test_if_directives_at_the_operation_level_are_passed_down_to_subgraph_queries

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: investigate this failure (missing `mutation` keyword and operation name)
fn test_if_directives_on_mutations_are_passed_down_to_subgraph_queries() {
let planner = planner!(
subgraphA: SUBGRAPH_A,
Expand Down Expand Up @@ -199,7 +199,7 @@ fn test_if_directives_on_mutations_are_passed_down_to_subgraph_queries() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: investigate this failure (missing directives on fetch query)
fn test_if_directives_with_arguments_applied_on_queries_are_ok() {
let planner = planner!(
Subgraph1: r#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const SUBGRAPH2: &str = r#"

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: investigate this failure (fetch node for `iFromS1.y` is missing)
fn can_use_a_key_on_an_interface_object_type() {
let planner = planner!(
S1: SUBGRAPH1,
Expand Down Expand Up @@ -299,6 +299,7 @@ fn does_not_rely_on_an_interface_object_directly_if_a_specific_implementation_is

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure (fetch node for `iFromS1.y` is missing)
fn can_use_a_key_on_an_interface_object_type_even_for_a_concrete_implementation() {
let planner = planner!(
S1: SUBGRAPH1,
Expand Down Expand Up @@ -524,6 +525,7 @@ fn it_avoids_buffering_interface_object_results_that_may_have_to_be_filtered_wit

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure (missing fetch nodes for i.x and i.y)
fn it_handles_requires_on_concrete_type_of_field_provided_by_interface_object() {
let planner = planner!(
S1: r#"
Expand Down Expand Up @@ -619,7 +621,7 @@ fn it_handles_requires_on_concrete_type_of_field_provided_by_interface_object()

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: investigate this failure (missing fetch node for `i.t.relatedIs.id`)
fn it_handles_interface_object_in_nested_entity() {
let planner = planner!(
S1: r#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn it_preservers_aliased_typename() {

#[test]
#[should_panic(expected = r#"snapshot assertion"#)]
// TODO: investigate this failure (`x` is missing in the query plan)
// TODO: investigate this failure (`__typename: __typename` is not expected)
fn it_does_not_needlessly_consider_options_for_typename() {
let planner = planner!(
Subgraph1: r#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ fn handles_spread_unions_correctly() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: investigate this failure (reverse order of parallel fetches)
fn handles_case_of_key_chains_in_parallel_requires() {
let planner = planner!(
Subgraph1: r#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ fn handles_mix_of_fragments_indirection_and_unions() {
}

#[test]
// #[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
fn another_mix_of_fragments_indirection_and_unions() {
// This tests that the issue reported on https://github.com/apollographql/router/issues/3172 is resolved.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ fn it_works_on_interfaces() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: investigate this failure (missing parallel fetches)
fn it_works_on_unions() {
let planner = planner!(
Subgraph1: r#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn it_handles_multiple_requires_within_the_same_entity_fetch() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure after optimize is merged
// TODO: investigate this failure after optimize is merged (reverse order of parallel fetches)
fn handles_multiple_requires_involving_different_nestedness() {
let planner = planner!(
Subgraph1: r#"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO will be fixed with selection set updates in https://apollographql.atlassian.net/browse/FED-241
// TODO: investigate this failure (redundant inline spread)
fn it_handles_a_simple_at_requires_triggered_within_a_conditional() {
let planner = planner!(
Subgraph1: r#"
Expand Down Expand Up @@ -136,7 +136,7 @@ fn it_handles_an_at_requires_triggered_conditionally() {

#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: investigate this failure
// TODO: investigate this failure (redundant inline spread)
fn it_handles_an_at_requires_where_multiple_conditional_are_involved() {
let planner = planner!(
Subgraph1: r#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ fn basic_subscription_with_single_subgraph() {
// subscriptions".
#[test]
#[should_panic(expected = "snapshot assertion")]
// TODO: Subscription handling
fn trying_to_use_defer_with_a_subcription_results_in_an_error() {
let config = QueryPlannerConfig {
incremental_delivery: QueryPlanIncrementalDeliveryConfig { enable_defer: true },
Expand Down

0 comments on commit 1b3434c

Please sign in to comment.