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

enable integration tests for mongo 5 skipping problem test in that version #60

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
merged 2 commits into from
Apr 27, 2024
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
1 change: 1 addition & 0 deletions arion-compose/services/integration-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let
environment = {
ENGINE_GRAPHQL_URL = engine-graphql-url;
INSTA_WORKSPACE_ROOT = repo-source-mount-point;
MONGODB_IMAGE = builtins.getEnv "MONGODB_IMAGE";
};
volumes = [
"${builtins.getEnv "PWD"}:${repo-source-mount-point}:rw"
Expand Down
11 changes: 11 additions & 0 deletions crates/integration-tests/src/tests/native_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ use insta::assert_yaml_snapshot;

#[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!(
query(
r#"
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ 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 # there's a problem with the native query example in v5
MONGODB_IMAGE=mongo:5 just test-integration
MONGODB_IMAGE=mongo:6 just test-integration
MONGODB_IMAGE=mongo:7 just test-integration

Expand Down