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
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
48 changes: 48 additions & 0 deletions .evergreen/config_generator/components/mock_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from shrub.v3.evg_build_variant import BuildVariant
from shrub.v3.evg_command import EvgCommandType
from shrub.v3.evg_task import EvgTaskRef

from config_generator.components.funcs.fetch_det import FetchDET
from config_generator.components.funcs.run_simple_http_server import RunSimpleHTTPServer
from config_generator.etc.utils import Task
from config_generator.etc.utils import bash_exec

def tasks():
return [
Task(
name="mock-server-test",
run_on="ubuntu2204-small",
commands=[
# Call fetch-det to define PYTHON3_BINARY expansion required for run-simple-http-server.
FetchDET.call(),
RunSimpleHTTPServer.call(),
bash_exec(
command_type=EvgCommandType.TEST,
add_expansions_to_env=True,
working_dir='mongoc',
script='.evergreen/scripts/compile.sh',
),
bash_exec(
command_type=EvgCommandType.TEST,
working_dir='mongoc',
script='.evergreen/scripts/run-mock-server-tests.sh',
)
],
)
]

def variants():
return [
BuildVariant(
name="mock-server-test",
display_name="Mock Server Test",
tasks=[EvgTaskRef(name='mock-server-test')],
expansions={
'CC': 'gcc',
'ASAN': 'on',
'CFLAGS': '-fno-omit-frame-pointer',
'EXTRA_CONFIGURE_FLAGS': '-DENABLE_EXTRA_ALIGNMENT=OFF',
'SANITIZE': 'address,undefined',
}
),
]
122 changes: 0 additions & 122 deletions .evergreen/generated_configs/legacy-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ functions:
script: |-
set -o errexit
bash .evergreen/scripts/run-auth-tests.sh
run mock server tests:
- command: shell.exec
type: test
params:
working_dir: mongoc
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
bash .evergreen/scripts/run-mock-server-tests.sh
link sample program:
- command: shell.exec
type: test
Expand Down Expand Up @@ -640,22 +630,6 @@ tasks:
set -o errexit
env DEBUG="ON" SASL="AUTO" SSL="DARWIN" bash .evergreen/scripts/compile.sh
- func: upload-build
- name: debug-compile-sasl-winssl
tags:
- debug-compile
- sasl
- winssl
commands:
- command: shell.exec
type: test
params:
working_dir: mongoc
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env DEBUG="ON" SASL="CYRUS" SSL="WINDOWS" bash .evergreen/scripts/compile.sh
- func: upload-build
- name: debug-compile-sspi-nossl
tags:
- debug-compile
Expand Down Expand Up @@ -1036,24 +1010,6 @@ tasks:
set -o errexit
env CFLAGS="-Werror -Wno-cast-align" DEBUG="ON" bash .evergreen/scripts/compile.sh
- func: upload-build
- name: debug-compile-sasl-openssl-cse
tags:
- client-side-encryption
- debug-compile
- openssl
- sasl
- special
commands:
- command: shell.exec
type: test
params:
working_dir: mongoc
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON" SASL="AUTO" SSL="OPENSSL" bash .evergreen/scripts/compile.sh
- func: upload-build
- name: debug-compile-sasl-openssl-static-cse
tags:
- client-side-encryption
Expand All @@ -1072,58 +1028,6 @@ tasks:
set -o errexit
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON" SASL="AUTO" SSL="OPENSSL_STATIC" bash .evergreen/scripts/compile.sh
- func: upload-build
- name: debug-compile-sasl-darwinssl-cse
tags:
- client-side-encryption
- darwinssl
- debug-compile
- sasl
- special
commands:
- command: shell.exec
type: test
params:
working_dir: mongoc
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON" SASL="AUTO" SSL="DARWIN" bash .evergreen/scripts/compile.sh
- func: upload-build
- name: debug-compile-sasl-winssl-cse
tags:
- client-side-encryption
- debug-compile
- sasl
- special
- winssl
commands:
- command: shell.exec
type: test
params:
working_dir: mongoc
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON" SASL="AUTO" SSL="WINDOWS" bash .evergreen/scripts/compile.sh
- func: upload-build
- name: debug-compile-asan-openssl-cse
tags:
- asan-clang
- client-side-encryption
- debug-compile
commands:
- command: shell.exec
type: test
params:
working_dir: mongoc
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env CFLAGS="-fno-omit-frame-pointer" CHECK_LOG="ON" COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_EXTRA_ALIGNMENT=OFF" PATH="/usr/lib/llvm-3.8/bin:$PATH" SANITIZE="address" SSL="OPENSSL" bash .evergreen/scripts/compile.sh
- func: upload-build
- name: debug-compile-nosasl-openssl-1.0.1
commands:
- func: install ssl
Expand Down Expand Up @@ -1485,19 +1389,6 @@ tasks:
BUILD_NAME: debug-compile-sasl-openssl
- func: prepare-kerberos
- func: run auth tests
- name: authentication-tests-openssl-static
tags:
- authentication-tests
- openssl-static
- sasl
depends_on:
name: debug-compile-sasl-openssl-static
commands:
- func: fetch-build
vars:
BUILD_NAME: debug-compile-sasl-openssl-static
- func: prepare-kerberos
- func: run auth tests
- name: authentication-tests-darwinssl
tags:
- authentication-tests
Expand Down Expand Up @@ -1537,19 +1428,6 @@ tasks:
BUILD_NAME: debug-compile-nosasl-openssl
- func: prepare-kerberos
- func: run auth tests
- name: test-asan-memcheck-mock-server
tags:
- test-asan
depends_on:
name: debug-compile-asan-clang
commands:
- func: fetch-build
vars:
BUILD_NAME: debug-compile-asan-clang
- func: run mock server tests
vars:
ASAN: 'on'
SSL: ssl
- name: test-mongohouse
depends_on:
name: debug-compile-sasl-openssl
Expand Down
22 changes: 22 additions & 0 deletions .evergreen/generated_configs/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,28 @@ tasks:
- func: upload-man-pages
- func: upload-build
- func: upload-release
- name: mock-server-test
run_on: ubuntu2204-small
commands:
- func: fetch-det
- func: run-simple-http-server
- command: subprocess.exec
type: test
params:
binary: bash
working_dir: mongoc
add_expansions_to_env: true
args:
- -c
- .evergreen/scripts/compile.sh
- command: subprocess.exec
type: test
params:
binary: bash
working_dir: mongoc
args:
- -c
- .evergreen/scripts/run-mock-server-tests.sh
- name: openssl-static-compile-debian10-gcc
run_on: debian10-large
tags: [openssl-static-matrix, debian10, gcc]
Expand Down
10 changes: 10 additions & 0 deletions .evergreen/generated_configs/variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ buildvariants:
DEBUG: "ON"
tasks:
- name: .cse-matrix-winssl
- name: mock-server-test
display_name: Mock Server Test
expansions:
ASAN: "on"
CC: gcc
CFLAGS: -fno-omit-frame-pointer
EXTRA_CONFIGURE_FLAGS: -DENABLE_EXTRA_ALIGNMENT=OFF
SANITIZE: address,undefined
tasks:
- name: mock-server-test
- name: openssl-static-matrix
display_name: openssl-static-matrix
tasks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@
bash .evergreen/scripts/run-auth-tests.sh
''', add_expansions_to_env=True),
)),
('run mock server tests', Function(
shell_mongoc(r'''
bash .evergreen/scripts/run-mock-server-tests.sh
''', add_expansions_to_env=True),
)),
('link sample program', Function(
shell_mongoc(r'''
# Compile a program that links dynamically or statically to libmongoc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ def __init__(
self.compile_sh_opt["ENABLE_RDTSCP"] = ENABLE_RDTSCP
if SRV:
self.compile_sh_opt["SRV"] = SRV
if TOPOLOGY:
self.compile_sh_opt["TOPOLOGY"] = TOPOLOGY

if compression != "default":
self.compile_sh_opt["SNAPPY"] = "ON" if compression in ("all", "snappy") else "OFF"
Expand Down Expand Up @@ -238,13 +236,6 @@ def __init__(
SSL="OPENSSL_STATIC",
),
CompileTask("debug-compile-sasl-darwinssl", tags=["debug-compile", "sasl", "darwinssl"], SASL="AUTO", SSL="DARWIN"),
CompileTask(
"debug-compile-sasl-winssl",
tags=["debug-compile", "sasl", "winssl"],
# Explicitly use CYRUS.
SASL="CYRUS",
SSL="WINDOWS",
),
CompileTask("debug-compile-sspi-nossl", tags=["debug-compile", "sspi", "nossl"], SASL="SSPI", SSL="OFF"),
CompileTask("debug-compile-sspi-openssl", tags=["debug-compile", "sspi", "openssl"], SASL="SSPI", SSL="OPENSSL"),
CompileTask(
Expand Down Expand Up @@ -380,24 +371,12 @@ def __init__(
],
),
CompileTask("debug-compile-with-warnings", CFLAGS="-Werror -Wno-cast-align"),
CompileWithClientSideEncryption(
"debug-compile-sasl-openssl-cse", tags=["debug-compile", "sasl", "openssl"], SASL="AUTO", SSL="OPENSSL"
),
CompileWithClientSideEncryption(
"debug-compile-sasl-openssl-static-cse",
tags=["debug-compile", "sasl", "openssl-static"],
SASL="AUTO",
SSL="OPENSSL_STATIC",
),
CompileWithClientSideEncryption(
"debug-compile-sasl-darwinssl-cse", tags=["debug-compile", "sasl", "darwinssl"], SASL="AUTO", SSL="DARWIN"
),
CompileWithClientSideEncryption(
"debug-compile-sasl-winssl-cse", tags=["debug-compile", "sasl", "winssl"], SASL="AUTO", SSL="WINDOWS"
),
CompileWithClientSideEncryptionAsan(
"debug-compile-asan-openssl-cse", tags=["debug-compile", "asan-clang"], SSL="OPENSSL", sanitize=["address"]
),
CompileTask(
"debug-compile-nosasl-openssl-1.0.1",
prefix_commands=[func("install ssl", SSL="openssl-1.0.1u")],
Expand Down Expand Up @@ -675,7 +654,7 @@ def pre_commands(self) -> Iterable[Value]:


class AuthTask(MatrixTask):
axes = OD([("sasl", ["sasl", "sspi", False]), ("ssl", ["openssl", "openssl-static", "darwinssl", "winssl"])])
axes = OD([("sasl", ["sasl", "sspi", False]), ("ssl", ["openssl", "darwinssl", "winssl"])])

name_prefix = "authentication-tests"

Expand Down Expand Up @@ -725,12 +704,6 @@ def pre_commands(self) -> Iterable[Value]:
all_tasks = chain(
all_tasks,
[
PostCompileTask(
"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.

),
PostCompileTask(
"test-mongohouse",
tags=[],
Expand Down
6 changes: 4 additions & 2 deletions src/libmongoc/tests/test-mongoc-counters.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,13 +1555,15 @@ test_counters_install (TestSuite *suite)
test_counters_op_msg,
NULL,
NULL,
test_framework_skip_if_compressors);
test_framework_skip_if_compressors,
TestSuite_CheckLive);
TestSuite_AddFull (suite,
"/counters/op_compressed",
test_counters_op_compressed,
NULL,
NULL,
test_framework_skip_if_no_compressors);
test_framework_skip_if_no_compressors,
TestSuite_CheckLive);
TestSuite_AddLive (suite, "/counters/cursors", test_counters_cursors);
TestSuite_AddLive (suite, "/counters/clients", test_counters_clients);
TestSuite_AddFull (suite,
Expand Down
Loading