这是indexloc提供的服务,不要输入任何密码
Skip to content

ci: run integration tests with MongoDB v8; remove MongoDB v5 from testing #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions crates/integration-tests/src/tests/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ async fn runs_aggregation_over_top_level_fields() -> anyhow::Result<()> {

#[tokio::test]
async fn aggregates_extended_json_representing_mixture_of_numeric_types() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This doesn't affect native queries that don't use the $documents stage.
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
graphql_query(
r#"
Expand Down Expand Up @@ -83,17 +72,6 @@ async fn aggregates_extended_json_representing_mixture_of_numeric_types() -> any

#[tokio::test]
async fn aggregates_mixture_of_numeric_and_null_values() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This doesn't affect native queries that don't use the $documents stage.
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
graphql_query(
r#"
Expand Down
11 changes: 0 additions & 11 deletions crates/integration-tests/src/tests/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ use crate::{connector::Connector, graphql_query, run_connector_query};

#[tokio::test]
async fn evaluates_field_name_that_requires_escaping_in_nested_expression() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This means that remote joins are not working in MongoDB 5
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
graphql_query(
r#"
Expand Down
22 changes: 0 additions & 22 deletions crates/integration-tests/src/tests/filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ use crate::{connector::Connector, graphql_query, run_connector_query};

#[tokio::test]
async fn filters_on_extended_json_using_string_comparison() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This doesn't affect native queries that don't use the $documents stage.
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
graphql_query(
r#"
Expand Down Expand Up @@ -76,17 +65,6 @@ async fn filters_by_comparisons_on_elements_of_array_of_scalars() -> anyhow::Res
#[tokio::test]
async fn filters_by_comparisons_on_elements_of_array_of_scalars_against_variable(
) -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This doesn't affect native queries that don't use the $documents stage.
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
run_connector_query(
Connector::SampleMflix,
Expand Down
22 changes: 0 additions & 22 deletions crates/integration-tests/src/tests/native_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ use ndc_test_helpers::{asc, binop, field, query, query_request, target, variable

#[tokio::test]
async fn runs_native_query_with_function_representation() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This doesn't affect native queries that don't use the $documents stage.
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
graphql_query(
r#"
Expand Down Expand Up @@ -55,17 +44,6 @@ async fn runs_native_query_with_collection_representation() -> anyhow::Result<()

#[tokio::test]
async fn runs_native_query_with_variable_sets() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This means that remote joins are not working in MongoDB 5
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
run_connector_query(
Connector::SampleMflix,
Expand Down
33 changes: 0 additions & 33 deletions crates/integration-tests/src/tests/remote_relationship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ use serde_json::json;

#[tokio::test]
async fn provides_source_and_target_for_remote_relationship() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This means that remote joins are not working in MongoDB 5
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
graphql_query(
r#"
Expand All @@ -40,17 +29,6 @@ async fn provides_source_and_target_for_remote_relationship() -> anyhow::Result<

#[tokio::test]
async fn handles_request_with_single_variable_set() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This means that remote joins are not working in MongoDB 5
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
run_connector_query(
Connector::SampleMflix,
Expand All @@ -70,17 +48,6 @@ async fn handles_request_with_single_variable_set() -> anyhow::Result<()> {

#[tokio::test]
async fn variable_used_in_multiple_type_contexts() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This means that remote joins are not working in MongoDB 5
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
run_connector_query(
Connector::SampleMflix,
Expand Down
11 changes: 0 additions & 11 deletions crates/integration-tests/src/tests/sorting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ use crate::graphql_query;

#[tokio::test]
async fn sorts_on_extended_json() -> anyhow::Result<()> {
// Skip this test in MongoDB 5 because the example fails there. We're getting an error:
//
// > Kind: Command failed: Error code 5491300 (Location5491300): $documents' is not allowed in user requests, labels: {}
//
// This doesn't affect native queries that don't use the $documents stage.
if let Ok(image) = std::env::var("MONGODB_IMAGE") {
if image == "mongo:5" {
return Ok(());
}
}

assert_yaml_snapshot!(
graphql_query(
r#"
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ test-e2e: (_arion "arion-compose/e2e-testing.nix" "test")

# Run `just test-integration` on several MongoDB versions
test-mongodb-versions:
MONGODB_IMAGE=mongo:5 just test-integration
MONGODB_IMAGE=mongo:6 just test-integration
MONGODB_IMAGE=mongo:7 just test-integration
MONGODB_IMAGE=mongo:8 just test-integration

# Runs a specified service in a specified project config using arion (a nix
# frontend for docker-compose). Propagates the exit status from that service.
Expand Down
Loading