Skip to content

CDRIVER-4645 add mock-server-test variant #1277

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 14 commits into from
May 23, 2023

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented May 21, 2023

Summary

This PR partially resolves CDRIVER-4645.

  • Remove some unused tasks from legacy Evergreen config.
  • Add a mock-server-test variant.

Here is a patch build for the new mock-server-test variant: https://spruce.mongodb.com/version/646a3d470305b97abfa79790

Unused tasks

This validate.py script can print unused tasks. Before these changes, this is the output:

% evergreen evaluate ./.evergreen/config.yml > evaluated.yml
% python validate.py                                        
`tasks` not referenced in `buildvariants` or `task_groups`:
-authentication-tests-openssl-static
-debug-compile-asan-clang
-debug-compile-asan-clang-openssl
-debug-compile-asan-openssl-cse
-debug-compile-compression
-debug-compile-sasl-darwinssl-cse
-debug-compile-sasl-nossl
-debug-compile-sasl-openssl-cse
-debug-compile-sasl-openssl-static-cse
-debug-compile-sasl-winssl
-debug-compile-sasl-winssl-cse
-debug-compile-sspi-nossl
-debug-compile-sspi-openssl
-debug-compile-sspi-openssl-static
-test-asan-memcheck-mock-server
-test-aws-openssl-assume_role-5.0
-test-aws-openssl-ec2-5.0
-test-aws-openssl-ecs-5.0
-test-aws-openssl-lambda-5.0
-test-aws-openssl-regular-5.0
-test-latest-server-compression
-test-loadbalanced-asan-auth-openssl-5.0
-test-loadbalanced-asan-auth-openssl-latest
-test-loadbalanced-asan-noauth-nossl-5.0
-test-loadbalanced-asan-noauth-nossl-latest

Here is the rationale for the tasks that were removed in this PR:

  • authentication-tests-openssl-static

    IMO there is little value (if any) in testing both openssl and openssl_static. The only value would be from verifying the C driver can compile and link to both openssl and openssl_static.

  • debug-compile-asan-openssl-cse
    • Seems redundant with asan-cse-sasl-cyrus-openssl-ubuntu1804-clang-compile.
  • debug-compile-sasl-darwinssl-cse
    • Seems redundant with cse-sasl-cyrus-darwinssl-macos-1100-clang-compile.
  • debug-compile-sasl-openssl-cse
    • Seems redundant with cse-sasl-cyrus-openssl-* tasks.
  • debug-compile-sasl-winssl
    • Seems redundant with sasl-cyrus-winssl-* tasks.
  • debug-compile-sasl-winssl-cse
    • Seems redundant with cse-sasl-cyrus-winssl-* tasks.
  • test-asan-memcheck-mock-server
    • Replaced by the new mock-server-test task.

The remaining tasks may still provide value and have not been removed. They may be used or migrated in a future PR.

Adding the mock-server-test variant

The mock-server-test has been added to the new Evergreen config generator. It uses the ubuntu2204-small distro to agree with suggestions in Guidelines around Evergreen distros. gcc is used since clang does not appear installed on ubuntu2204 distros:

[2023/05/19 20:05:04.811] CMake Error at /home/ubuntu/.cache/mongo-c-driver/tmp.vxxXctRSNK/cmake-3.25.2-linux-x86_64/share/cmake-3.25/Modules/CMakeDetermineCCompiler.cmake:49 (message):
[2023/05/19 20:05:04.811]   Could not find compiler set in environment variable CC:
[2023/05/19 20:05:04.811]   clang.

The mock-server-test variant has been added to the GitHub Patch Definitions to run the task on each GitHub PR.

kevinAlbs added 11 commits May 18, 2023 16:06
Seems redundant with `asan-cse-sasl-cyrus-openssl-ubuntu1804-clang-compile`
Seems redundant with `cse-sasl-cyrus-darwinssl-macos-1100-clang-compile`.
Seems redundant with `cse-sasl-cyrus-openssl-*` tasks.
Seems redundant with `sasl-cyrus-winssl-*` tasks.
Seems redundant with `cse-sasl-cyrus-winssl-*` tasks.
CDRIVER-4193 changes to use OP_MSG and hello for handshake when in loadbalanced
Replaced by the new `mock-server-test` task.
@kevinAlbs kevinAlbs marked this pull request as ready for review May 22, 2023 16:45
@kevinAlbs kevinAlbs requested a review from eramongodb May 22, 2023 16:45
Copy link
Contributor

@eramongodb eramongodb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestions; otherwise, LGTM.

mock_server_receives_legacy_hello (server, "{'loadBalanced': true}");
request = mock_server_receives_hello_op_msg (server);
const bson_t *match_loadBalanced = tmp_bson ("{'loadBalanced': true}");
ASSERT (request_matches_msg (request, MONGOC_MSG_NONE, &match_loadBalanced, 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ASSERT (request_matches_msg (request, MONGOC_MSG_NONE, &match_loadBalanced, 1));
ASSERT (
request_matches_msg (request, MONGOC_MSG_NONE, &match_loadBalanced, 1));

This file has not been formatted.

request =
mock_server_receives_legacy_hello (server, "{'loadBalanced': true}");
request = mock_server_receives_hello_op_msg (server);
const bson_t *match_loadBalanced = tmp_bson ("{'loadBalanced': true}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest moving reused variable up above outside the current "test block" to denote its value is not specific to this block.

"test-asan-memcheck-mock-server",
tags=["test-asan"],
get_build="debug-compile-asan-clang",
commands=[func("run mock server tests", ASAN="on", SSL="ssl")],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "run mock server tests" function in legacy config generator functions.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants