From 92ee5f8aa95a1b30921659e24c4e7c28ec7dc6be Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Fri, 20 Oct 2023 21:27:57 +0000 Subject: [PATCH 01/22] WIP: bisecting virtualenv issue. Signed-off-by: Jakub Sobon --- .azure-pipelines/pipelines.yml | 240 ++++++++++++++++----------------- bazel/repositories.bzl | 4 +- 2 files changed, 122 insertions(+), 122 deletions(-) diff --git a/.azure-pipelines/pipelines.yml b/.azure-pipelines/pipelines.yml index a0a3bbe62..514f80487 100644 --- a/.azure-pipelines/pipelines.yml +++ b/.azure-pipelines/pipelines.yml @@ -14,8 +14,8 @@ stages: strategy: maxParallel: 2 matrix: - build: - CI_TARGET: "build" + #build: + # CI_TARGET: "build" format: CI_TARGET: "check_format" timeoutInMinutes: 120 @@ -24,121 +24,121 @@ stages: parameters: ciTarget: $(CI_TARGET) -- stage: test - dependsOn: ["check"] - pool: "envoy-x64-large" - jobs: - - job: test_and_benchmark - displayName: "do_ci.sh" - strategy: - # Both test and benchmark need dedicated resources for stability. - maxParallel: 1 - matrix: - test: - CI_TARGET: "test" - benchmark: - CI_TARGET: "benchmark_with_own_binaries" - timeoutInMinutes: 120 - steps: - - template: bazel.yml - parameters: - ciTarget: $(CI_TARGET) - -- stage: clang_tidy - dependsOn: ["check"] - pool: "envoy-x64-large" - jobs: - - job: clang_tidy - displayName: "do_ci.sh" - strategy: - maxParallel: 1 - matrix: - clang_tidy: - CI_TARGET: "clang_tidy" - timeoutInMinutes: 120 - steps: - - template: bazel.yml - parameters: - ciTarget: $(CI_TARGET) - -- stage: test_gcc - dependsOn: ["check"] - pool: "envoy-x64-large" - jobs: - - job: test_gcc - displayName: "do_ci.sh" - strategy: - maxParallel: 1 - matrix: - test_gcc: - CI_TARGET: "test_gcc" - timeoutInMinutes: 120 - steps: - - template: bazel.yml - parameters: - ciTarget: $(CI_TARGET) - -- stage: sanitizers - dependsOn: ["test"] - pool: "envoy-x64-large" - jobs: - - job: sanitizers - displayName: "do_ci.sh" - strategy: - maxParallel: 2 - matrix: - asan: - CI_TARGET: "asan" - tsan: - CI_TARGET: "tsan" - timeoutInMinutes: 120 - steps: - - template: bazel.yml - parameters: - ciTarget: $(CI_TARGET) - -- stage: coverage_unit - dependsOn: ["test"] - pool: "envoy-x64-large" - jobs: - - job: coverage_unit - displayName: "do_ci.sh" - strategy: - maxParallel: 1 - matrix: - coverage: - CI_TARGET: "coverage" - timeoutInMinutes: 120 - steps: - - template: bazel.yml - parameters: - ciTarget: $(CI_TARGET) - - task: PublishPipelineArtifact@1 - condition: always() - displayName: 'Publish the line coverage report' - inputs: - targetPath: $(Build.SourcesDirectory)/coverage_html.zip - artifactName: UnitTestCoverageReport-$(System.JobAttempt) - -# coverage_integration stage was temporarily removed due to the issue -# reported by https://github.com/envoyproxy/nighthawk/issues/1006 -- stage: release - dependsOn: - - "clang_tidy" - - "test_gcc" - - "sanitizers" - - "coverage_unit" - condition: eq(variables['PostSubmit'], true) - pool: "envoy-x64-large" - jobs: - - job: release - displayName: "do_ci.sh" - strategy: - matrix: - release: - CI_TARGET: "docker" - timeoutInMinutes: 120 - steps: - - template: bazel.yml - parameters: - ciTarget: $(CI_TARGET) +#- stage: test +# dependsOn: ["check"] +# pool: "envoy-x64-large" +# jobs: +# - job: test_and_benchmark +# displayName: "do_ci.sh" +# strategy: +# # Both test and benchmark need dedicated resources for stability. +# maxParallel: 1 +# matrix: +# test: +# CI_TARGET: "test" +# benchmark: +# CI_TARGET: "benchmark_with_own_binaries" +# timeoutInMinutes: 120 +# steps: +# - template: bazel.yml +# parameters: +# ciTarget: $(CI_TARGET) +# +#- stage: clang_tidy +# dependsOn: ["check"] +# pool: "envoy-x64-large" +# jobs: +# - job: clang_tidy +# displayName: "do_ci.sh" +# strategy: +# maxParallel: 1 +# matrix: +# clang_tidy: +# CI_TARGET: "clang_tidy" +# timeoutInMinutes: 120 +# steps: +# - template: bazel.yml +# parameters: +# ciTarget: $(CI_TARGET) +# +#- stage: test_gcc +# dependsOn: ["check"] +# pool: "envoy-x64-large" +# jobs: +# - job: test_gcc +# displayName: "do_ci.sh" +# strategy: +# maxParallel: 1 +# matrix: +# test_gcc: +# CI_TARGET: "test_gcc" +# timeoutInMinutes: 120 +# steps: +# - template: bazel.yml +# parameters: +# ciTarget: $(CI_TARGET) +# +#- stage: sanitizers +# dependsOn: ["test"] +# pool: "envoy-x64-large" +# jobs: +# - job: sanitizers +# displayName: "do_ci.sh" +# strategy: +# maxParallel: 2 +# matrix: +# asan: +# CI_TARGET: "asan" +# tsan: +# CI_TARGET: "tsan" +# timeoutInMinutes: 120 +# steps: +# - template: bazel.yml +# parameters: +# ciTarget: $(CI_TARGET) +# +#- stage: coverage_unit +# dependsOn: ["test"] +# pool: "envoy-x64-large" +# jobs: +# - job: coverage_unit +# displayName: "do_ci.sh" +# strategy: +# maxParallel: 1 +# matrix: +# coverage: +# CI_TARGET: "coverage" +# timeoutInMinutes: 120 +# steps: +# - template: bazel.yml +# parameters: +# ciTarget: $(CI_TARGET) +# - task: PublishPipelineArtifact@1 +# condition: always() +# displayName: 'Publish the line coverage report' +# inputs: +# targetPath: $(Build.SourcesDirectory)/coverage_html.zip +# artifactName: UnitTestCoverageReport-$(System.JobAttempt) +# +## coverage_integration stage was temporarily removed due to the issue +## reported by https://github.com/envoyproxy/nighthawk/issues/1006 +#- stage: release +# dependsOn: +# - "clang_tidy" +# - "test_gcc" +# - "sanitizers" +# - "coverage_unit" +# condition: eq(variables['PostSubmit'], true) +# pool: "envoy-x64-large" +# jobs: +# - job: release +# displayName: "do_ci.sh" +# strategy: +# matrix: +# release: +# CI_TARGET: "docker" +# timeoutInMinutes: 120 +# steps: +# - template: bazel.yml +# parameters: +# ciTarget: $(CI_TARGET) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 842e26cce..37b3d05c0 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -1,7 +1,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -ENVOY_COMMIT = "6ef1bb476da8d050347b462b2d8efa1cddeb420f" -ENVOY_SHA = "22a12c8bef5e476a4894143344d6aa386dced755ea2a1da798b573d0620a4f8a" +ENVOY_COMMIT = "7db0b4a299730e9c4dd4872788bd56cc7b11018a" +ENVOY_SHA = "52f76e1d2e35cbe454f8bff389c5ba74d630830c38e3b619c0207db3bee567a8" HDR_HISTOGRAM_C_VERSION = "0.11.2" # October 12th, 2020 HDR_HISTOGRAM_C_SHA = "637f28b5f64de2e268131e4e34e6eef0b91cf5ff99167db447d9b2825eae6bad" From 4a8543e2eb3439458f0bd7b878ec236f476c8513 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Fri, 20 Oct 2023 22:08:13 +0000 Subject: [PATCH 02/22] Latest docker image. Signed-off-by: Jakub Sobon --- .bazelrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index 2752d2b8e..9f4b89fd3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -246,6 +246,8 @@ build:fuzz-coverage --config=plain-fuzzer build:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh build:fuzz-coverage --test_tag_filters=-nocoverage +build:cache-local --remote_cache=grpc://localhost:9092 + # Remote execution: https://docs.bazel.build/versions/master/remote-execution.html build:rbe-toolchain --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 @@ -364,7 +366,7 @@ build:compile-time-options --@envoy//source/extensions/filters/http/kill_request # Docker sandbox # NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/main/toolchains/rbe_toolchains_config.bzl#L8 -build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:94e5d873c145ae86f205117e76276161c9af4806@sha256:8d3763e19d5b71fdc95666d75073ce4581e566ce28ca09106607b6a3ef7ba902 +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:fdd65c6270a8507a18d5acd6cf19a18cb695e4fa@sha256:3c8a3ce6f90dcfb5d09dc8f79bb01404d3526d420061f9a176e0a8e91e1e573e build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker @@ -524,7 +526,7 @@ build:rbe-envoy-engflow --grpc_keepalive_time=30s build:rbe-envoy-engflow --remote_timeout=3600s build:rbe-envoy-engflow --bes_timeout=3600s build:rbe-envoy-engflow --bes_upload_mode=fully_async -build:rbe-envoy-engflow --remote_default_exec_properties=container-image=docker://docker.io/envoyproxy/envoy-build-ubuntu:94e5d873c145ae86f205117e76276161c9af4806@sha256:8d3763e19d5b71fdc95666d75073ce4581e566ce28ca09106607b6a3ef7ba902 +build:rbe-envoy-engflow --remote_default_exec_properties=container-image=docker://docker.io/envoyproxy/envoy-build-ubuntu:fdd65c6270a8507a18d5acd6cf19a18cb695e4fa@sha256:3c8a3ce6f90dcfb5d09dc8f79bb01404d3526d420061f9a176e0a8e91e1e573e ############################################################################# # debug: Various Bazel debugging flags From e7988d7ce8baad2f20b3b2ba9e232603071a139c Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Fri, 20 Oct 2023 22:09:02 +0000 Subject: [PATCH 03/22] Run outside of Docker. Signed-off-by: Jakub Sobon --- .azure-pipelines/bazel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/bazel.yml b/.azure-pipelines/bazel.yml index 38c4ff509..f962ff090 100644 --- a/.azure-pipelines/bazel.yml +++ b/.azure-pipelines/bazel.yml @@ -10,7 +10,7 @@ steps: df -h displayName: "Check disk space at beginning" -- script: ci/run_envoy_docker.sh 'ci/do_ci.sh ${{ parameters.ciTarget }}' +- script: ci/do_ci.sh ${{ parameters.ciTarget }} workingDirectory: $(Build.SourcesDirectory) displayName: "Run the CI script" env: From 10bf5b9dc96ce3d2c306610e8340806ef0147344 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Fri, 20 Oct 2023 22:21:36 +0000 Subject: [PATCH 04/22] Revert "Run outside of Docker." This reverts commit 752f9436e6efa3154bdae35f3730f76dde20bc35. Signed-off-by: Jakub Sobon --- .azure-pipelines/bazel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/bazel.yml b/.azure-pipelines/bazel.yml index f962ff090..38c4ff509 100644 --- a/.azure-pipelines/bazel.yml +++ b/.azure-pipelines/bazel.yml @@ -10,7 +10,7 @@ steps: df -h displayName: "Check disk space at beginning" -- script: ci/do_ci.sh ${{ parameters.ciTarget }} +- script: ci/run_envoy_docker.sh 'ci/do_ci.sh ${{ parameters.ciTarget }}' workingDirectory: $(Build.SourcesDirectory) displayName: "Run the CI script" env: From a19b0b3094f41e0d2f80f7ed32fd138227d8847c Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Fri, 20 Oct 2023 22:22:03 +0000 Subject: [PATCH 05/22] Exclude check_envoy_includes.py. Signed-off-by: Jakub Sobon --- tools/check_format.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/check_format.sh b/tools/check_format.sh index 4fd02b56c..e95cb5200 100755 --- a/tools/check_format.sh +++ b/tools/check_format.sh @@ -19,6 +19,6 @@ bazel run @envoy//tools/code_format:check_format -- \ # The include checker doesn't support per-file checking, so we only # run it when a full check is requested. -if [ $FULL_CHECK == $TO_CHECK ]; then - bazel run //tools:check_envoy_includes.py -fi +#if [ $FULL_CHECK == $TO_CHECK ]; then +# bazel run //tools:check_envoy_includes.py +#fi From f1e3bc89bdd274612bc42a4f1c71cc548521a887 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 06:29:22 +0000 Subject: [PATCH 06/22] Fix scripts that chek format. Signed-off-by: Jakub Sobon --- bazel/repositories.bzl | 4 ++-- ci/do_ci.sh | 2 +- requirements.txt | 8 ++++++++ tools/BUILD | 19 +++++++++++++++++++ tools/check_format.sh | 14 +++++--------- tools/format_python_tools.py | 20 +++++++++++--------- tools/format_python_tools.sh | 17 +++++------------ tools/requirements.txt | 3 --- 8 files changed, 51 insertions(+), 36 deletions(-) delete mode 100644 tools/requirements.txt diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 37b3d05c0..842e26cce 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -1,7 +1,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -ENVOY_COMMIT = "7db0b4a299730e9c4dd4872788bd56cc7b11018a" -ENVOY_SHA = "52f76e1d2e35cbe454f8bff389c5ba74d630830c38e3b619c0207db3bee567a8" +ENVOY_COMMIT = "6ef1bb476da8d050347b462b2d8efa1cddeb420f" +ENVOY_SHA = "22a12c8bef5e476a4894143344d6aa386dced755ea2a1da798b573d0620a4f8a" HDR_HISTOGRAM_C_VERSION = "0.11.2" # October 12th, 2020 HDR_HISTOGRAM_C_SHA = "637f28b5f64de2e268131e4e34e6eef0b91cf5ff99167db447d9b2825eae6bad" diff --git a/ci/do_ci.sh b/ci/do_ci.sh index b8fb9340c..c843c3200 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -222,7 +222,7 @@ function do_benchmark_with_own_binaries() { function do_check_format() { echo "check_format..." cd "${SRCDIR}" - ./tools/check_format.sh check + #./tools/check_format.sh check ./tools/format_python_tools.sh check } diff --git a/requirements.txt b/requirements.txt index 933d03705..4ab03dedc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,3 +24,11 @@ tomli==2.0.1 pyparsing==3.1.1 charset_normalizer==2.1.1 # Don't update charset_normalizer to 3.x.x; the latest requests==2.28.1 can only use >=2 <3. exceptiongroup==1.1.3 +flake8-docstrings==1.5.0 +flake8==3.8.3 +mccabe==0.6.1 +pycodestyle==2.6.0 +pydocstyle==6.3.0 +pyflakes==2.2.0 +snowballstemmer==2.2.0 +yapf==0.30.0 diff --git a/tools/BUILD b/tools/BUILD index 3abecf575..67663d940 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -1,3 +1,4 @@ +load("@python_pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_binary") licenses(["notice"]) # Apache 2 @@ -16,3 +17,21 @@ py_binary( "//:nighthawk_test_server", ], ) + +py_binary( + name = "format_python_tools", + srcs = ["format_python_tools.py"], + data = [ + ":.style.yapf", + ], + deps = [ + requirement("flake8"), + requirement("flake8-docstrings"), + requirement("mccabe"), + requirement("pycodestyle"), + requirement("pydocstyle"), + requirement("pyflakes"), + requirement("snowballstemmer"), + requirement("yapf"), + ], +) diff --git a/tools/check_format.sh b/tools/check_format.sh index e95cb5200..683c6efef 100755 --- a/tools/check_format.sh +++ b/tools/check_format.sh @@ -2,23 +2,19 @@ set -e -# Using a path like ./../nighthawk is a workaround that allows us to skip Envoy -# specific code checks performed by @envoy//tools/code_format:check_format.py. -# TODO(https://github.com/envoyproxy/nighthawk/issues/815): Replace this -# workaround with a permanent solution. -CURRENT_DIRECTORY=${PWD##*/} -FULL_CHECK="./../$CURRENT_DIRECTORY" +FULL_CHECK="$PWD" TO_CHECK="${2:-$FULL_CHECK}" # TODO(https://github.com/envoyproxy/nighthawk/issues/165): fully excluding everything # from the build fixer isn't ideal. bazel run @envoy//tools/code_format:check_format -- \ + --config_path=${PWD}/tools/code_format/config.yaml \ --skip_envoy_build_rule_check --namespace_check Nighthawk \ --build_fixer_check_excluded_paths=$TO_CHECK \ $1 $TO_CHECK # The include checker doesn't support per-file checking, so we only # run it when a full check is requested. -#if [ $FULL_CHECK == $TO_CHECK ]; then -# bazel run //tools:check_envoy_includes.py -#fi +if [ $FULL_CHECK == $TO_CHECK ]; then + bazel run //tools:check_envoy_includes.py +fi diff --git a/tools/format_python_tools.py b/tools/format_python_tools.py index 7f8a0b1a7..c55bde662 100755 --- a/tools/format_python_tools.py +++ b/tools/format_python_tools.py @@ -12,7 +12,7 @@ EXCLUDE_FILES = ['gen_compilation_database.py'] -def collectFiles(): +def collectFiles(directory): """Collect all Python files in the tools directory. Returns: A collection of python files in the tools directory excluding @@ -21,19 +21,20 @@ def collectFiles(): # TODO: Add ability to collect a specific file or files. matches = [] path_parts = os.getcwd().split('/') - dirname = '.' - if path_parts[-1] == 'tools': - dirname = '/'.join(path_parts[:-1]) - for root, dirnames, filenames in os.walk(dirname): + #dirname = '.' + #if path_parts[-1] == 'tools': + # dirname = '/'.join(path_parts[:-1]) + for root, dirnames, filenames in os.walk(directory): dirnames[:] = [d for d in dirnames if d not in EXCLUDE_DIRECTORIES] for filename in fnmatch.filter(filenames, '*.py'): if filename in EXCLUDE_FILES: continue + print("XXXXXX adding %s", os.path.join(root, filename)) matches.append(os.path.join(root, filename)) return matches -def validateFormat(fix=False): +def validateFormat(directory, fix=False): """Check the format of python files in the tools directory. Arguments: @@ -42,9 +43,9 @@ def validateFormat(fix=False): fixes_required = False failed_update_files = set() successful_update_files = set() - for python_file in collectFiles(): + for python_file in collectFiles(directory): reformatted_source, encoding, changed = FormatFile(python_file, - style_config='.style.yapf', + style_config='./tools/.style.yapf', in_place=fix, print_diff=not fix) if not fix: @@ -76,6 +77,7 @@ def displayFixResults(successful_files, failed_files): choices=['check', 'fix'], default='check', help='Fix invalid syntax in files.') + parser.add_argument('--directory', default='.', help='directory where to search for Python files that will be formatted. Default ".".') args = parser.parse_args() - is_valid = validateFormat(args.action == 'fix') + is_valid = validateFormat(args.directory, args.action == 'fix') sys.exit(0 if is_valid else 1) diff --git a/tools/format_python_tools.sh b/tools/format_python_tools.sh index e1657df41..4e2a845a6 100755 --- a/tools/format_python_tools.sh +++ b/tools/format_python_tools.sh @@ -2,17 +2,10 @@ set -e -VENV_DIR="pyformat" -SCRIPTPATH=$(realpath "$(dirname $0)") -. $SCRIPTPATH/shell_utils.sh -cd "$SCRIPTPATH" - -source_venv "$VENV_DIR" -echo "Installing requirements..." -pip install -r requirements.txt +DIRECTORY=${PWD} echo "Running Python format check..." -python format_python_tools.py $1 +bazel run //tools:format_python_tools -- --directory=${DIRECTORY} $1 echo "Running Python3 flake8 check..." cd .. @@ -31,8 +24,8 @@ EXCLUDE="--exclude=benchmarks/tmp/*,.cache/*,*/venv/*,tools/format_python_tools. # We ignore false positives because of what look like pytest peculiarities # F401 Module imported but unused # F811 Redefinition of unused name from line n -flake8 . ${EXCLUDE} --ignore=E114,E111,E501,F401,F811,E124,E125,E126,W504,D --count --show-source --statistics +flake8 ${DIRECTORY} ${EXCLUDE} --ignore=E114,E111,E501,F401,F811,E124,E125,E126,W504,D --count --show-source --statistics # D = Doc comment related checks (We check both p257 AND google conventions). -flake8 . ${EXCLUDE} --docstring-convention pep257 --select=D --count --show-source --statistics -flake8 . ${EXCLUDE} --docstring-convention google --select=D --count --show-source --statistics +flake8 ${DIRECTORY} ${EXCLUDE} --docstring-convention pep257 --select=D --count --show-source --statistics +flake8 ${DIRECTORY} ${EXCLUDE} --docstring-convention google --select=D --count --show-source --statistics diff --git a/tools/requirements.txt b/tools/requirements.txt deleted file mode 100644 index f1d27c321..000000000 --- a/tools/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -flake8==3.8.3 -yapf==0.30.0 -flake8-docstrings==1.5.0 From 71640382a416fe88a705fff4f2962cf270b50c2e Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 06:30:37 +0000 Subject: [PATCH 07/22] Re-enable check_format. Signed-off-by: Jakub Sobon --- ci/do_ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index c843c3200..b8fb9340c 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -222,7 +222,7 @@ function do_benchmark_with_own_binaries() { function do_check_format() { echo "check_format..." cd "${SRCDIR}" - #./tools/check_format.sh check + ./tools/check_format.sh check ./tools/format_python_tools.sh check } From 61b59181d90bb6938f3c291bdc34a9546ceae2f4 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 07:53:35 +0000 Subject: [PATCH 08/22] Format all files. Signed-off-by: Jakub Sobon --- .../test_cds_churn_with_traffic.py | 1 + .../test_eds_churn_with_traffic.py | 1 + benchmarks/test/test_discovery.py | 14 +++++--- .../adaptive_load/input_variable_setter.h | 2 ++ .../nighthawk/adaptive_load/metrics_plugin.h | 6 ++-- .../adaptive_load/scoring_function.h | 2 ++ .../nighthawk/adaptive_load/step_controller.h | 2 ++ include/nighthawk/common/operation_callback.h | 4 ++- include/nighthawk/common/phase.h | 3 +- include/nighthawk/common/sequencer.h | 3 +- include/nighthawk/sink/sink.h | 3 +- requirements.txt | 19 +++++------ .../adaptive_load_client_main.cc | 4 +-- .../adaptive_load_controller_impl.h | 2 ++ source/adaptive_load/config_validator_impl.h | 2 ++ .../adaptive_load/metrics_evaluator_impl.cc | 4 +-- source/adaptive_load/metrics_evaluator_impl.h | 2 ++ source/adaptive_load/scoring_function_impl.h | 2 ++ .../session_spec_proto_helper_impl.h | 2 ++ source/client/flush_worker_impl.h | 2 ++ source/client/process_bootstrap.h | 2 ++ source/client/process_impl.cc | 2 -- source/common/nighthawk_service_client_impl.h | 2 ++ source/common/phase_impl.h | 3 +- source/common/termination_predicate_impl.h | 4 ++- .../request_options_list_plugin_impl.h | 2 ++ .../adaptive_load_client_main_test.cc | 31 +++++++++++------- .../fake_input_variable_setter.h | 1 - test/benchmark_http_client_test.cc | 2 +- test/client_worker_test.cc | 2 +- test/flush_worker_test.cc | 2 +- test/output_collector_test.cc | 2 +- test/output_formatter_test.cc | 32 +++++++++---------- test/process_test.cc | 2 +- test/request_source/stub_plugin_impl.h | 2 ++ test/statistic_test.cc | 16 ++++++---- test/test_common/proto_matchers.h | 2 ++ .../fake_user_defined_output_test.cc | 4 +-- .../log_response_headers_plugin_test.cc | 2 +- ...user_defined_output_plugin_creator_test.cc | 2 +- test/worker_test.cc | 5 ++- tools/BUILD | 10 ++++++ tools/flake8.py | 12 +++++++ tools/format_python_tools.py | 8 +++-- tools/format_python_tools.sh | 18 ++++------- 45 files changed, 159 insertions(+), 91 deletions(-) create mode 100644 tools/flake8.py diff --git a/benchmarks/dynamic_test/test_cds_churn_with_traffic.py b/benchmarks/dynamic_test/test_cds_churn_with_traffic.py index 3776a0a8f..68f606edf 100644 --- a/benchmarks/dynamic_test/test_cds_churn_with_traffic.py +++ b/benchmarks/dynamic_test/test_cds_churn_with_traffic.py @@ -100,6 +100,7 @@ def _config_generation_single_cluster(temp_dir: str, endpoints: list[utility.Soc @pytest.mark.parametrize('dynamic_config_generator', [_config_generation_single_cluster]) def test_dynamic_http_single_cluster_traffic(inject_dynamic_envoy_http_proxy_fixture, proxy_config): # noqa + """Dynamic HTTP test on a single cluster.""" _run_benchmark(inject_dynamic_envoy_http_proxy_fixture) diff --git a/benchmarks/dynamic_test/test_eds_churn_with_traffic.py b/benchmarks/dynamic_test/test_eds_churn_with_traffic.py index c7c38d95c..1050906ff 100644 --- a/benchmarks/dynamic_test/test_eds_churn_with_traffic.py +++ b/benchmarks/dynamic_test/test_eds_churn_with_traffic.py @@ -96,4 +96,5 @@ def _config_generation_single_cluster(temp_dir: str, endpoints: list[utility.Soc @pytest.mark.parametrize('dynamic_config_generator', [_config_generation_single_cluster]) def test_dynamic_http_single_cluster_traffic(inject_dynamic_envoy_http_proxy_fixture, proxy_config): # noqa + """Dynamic HTTP test on a single cluster.""" _run_benchmark(inject_dynamic_envoy_http_proxy_fixture) diff --git a/benchmarks/test/test_discovery.py b/benchmarks/test/test_discovery.py index 2cea505d0..11c00f50d 100644 --- a/benchmarks/test/test_discovery.py +++ b/benchmarks/test/test_discovery.py @@ -57,36 +57,42 @@ def _run_benchmark(fixture, utilities.output_benchmark_results(parsed_json, fixture) -# Test via injected Envoy @pytest.mark.parametrize('proxy_config', ["nighthawk/benchmarks/configurations/envoy_proxy.yaml"]) @pytest.mark.parametrize('server_config', ["nighthawk/test/integration/configurations/nighthawk_http_origin.yaml"]) def test_http_h1_small_request_small_reply_via(inject_envoy_http_proxy_fixture, proxy_config): # noqa + """H1 test with small request and reply via injected Envoy.""" _run_benchmark(inject_envoy_http_proxy_fixture) -# via Envoy, 4 workers. global targets: 1000 qps / 4 connections. @pytest.mark.parametrize('proxy_config', ["nighthawk/benchmarks/configurations/envoy_proxy.yaml"]) @pytest.mark.parametrize('server_config', ["nighthawk/test/integration/configurations/nighthawk_http_origin.yaml"]) def test_http_h1_small_request_small_reply_via_multiple_workers(inject_envoy_http_proxy_fixture, proxy_config): # noqa + """H1 test with small request and reply via multiple workers. + + via Envoy, 4 workers. global targets: 1000 qps / 4 connections. + """ _run_benchmark(inject_envoy_http_proxy_fixture, rps=125, concurrency=4) -# Test the origin directly, using a stock fixture @pytest.mark.parametrize('server_config', ["nighthawk/test/integration/configurations/nighthawk_http_origin.yaml"]) def test_http_h1_small_request_small_reply_direct(http_test_server_fixture): # noqa + """H1 test with small request and reply that tests the origin directly, using a stock fixture.""" _run_benchmark(http_test_server_fixture) -# Direct, 4 workers. global targets: 1000 qps / 4 connections. @pytest.mark.parametrize('server_config', ["nighthawk/test/integration/configurations/nighthawk_http_origin.yaml"]) def test_http_h1_small_request_small_reply_direct_multiple_workers( http_test_server_fixture): # noqa + """H1 test with small request and reply that tests the origin directly. + + 4 workers. global targets: 1000 qps / 4 connections. + """ _run_benchmark(http_test_server_fixture, rps=125, concurrency=4) diff --git a/include/nighthawk/adaptive_load/input_variable_setter.h b/include/nighthawk/adaptive_load/input_variable_setter.h index 2659a624b..a090ac403 100644 --- a/include/nighthawk/adaptive_load/input_variable_setter.h +++ b/include/nighthawk/adaptive_load/input_variable_setter.h @@ -1,3 +1,5 @@ +#pragma once + // Interfaces for InputVariableSetter plugins and plugin factories. #pragma once diff --git a/include/nighthawk/adaptive_load/metrics_plugin.h b/include/nighthawk/adaptive_load/metrics_plugin.h index a4599ca5e..654e659a6 100644 --- a/include/nighthawk/adaptive_load/metrics_plugin.h +++ b/include/nighthawk/adaptive_load/metrics_plugin.h @@ -1,3 +1,5 @@ +#pragma once + // Interfaces for MetricsPlugin plugins and plugin factories. #pragma once @@ -20,10 +22,10 @@ struct ReportingPeriod { // start time of the latest (current) iteration of Nighthawk test in the adaptive stage. See // https://github.com/envoyproxy/nighthawk/blob/main/docs/root/adaptive_load_controller.md#the-adaptive-load-controller // for more information on adaptive load testing. - google::protobuf::Timestamp start_time; + Envoy::ProtobufWkt::Timestamp start_time; // The duration of the time where nighthawk is sending the intended load in the adaptive stage. - google::protobuf::Duration duration; + Envoy::ProtobufWkt::Duration duration; }; /** diff --git a/include/nighthawk/adaptive_load/scoring_function.h b/include/nighthawk/adaptive_load/scoring_function.h index 591c4919c..8e0c6468b 100644 --- a/include/nighthawk/adaptive_load/scoring_function.h +++ b/include/nighthawk/adaptive_load/scoring_function.h @@ -1,3 +1,5 @@ +#pragma once + // Interfaces for ScoringFunction plugins and plugin factories. #pragma once diff --git a/include/nighthawk/adaptive_load/step_controller.h b/include/nighthawk/adaptive_load/step_controller.h index 7ccc61261..8e679126f 100644 --- a/include/nighthawk/adaptive_load/step_controller.h +++ b/include/nighthawk/adaptive_load/step_controller.h @@ -1,3 +1,5 @@ +#pragma once + // Interfaces for StepController plugins and plugin factories. #pragma once diff --git a/include/nighthawk/common/operation_callback.h b/include/nighthawk/common/operation_callback.h index fc564597e..945b570b6 100644 --- a/include/nighthawk/common/operation_callback.h +++ b/include/nighthawk/common/operation_callback.h @@ -1,3 +1,5 @@ +#pragma once + #include namespace Nighthawk { @@ -9,4 +11,4 @@ namespace Nighthawk { * a success, and is meaningful only when done equals true. */ using OperationCallback = std::function; -} // namespace Nighthawk \ No newline at end of file +} // namespace Nighthawk diff --git a/include/nighthawk/common/phase.h b/include/nighthawk/common/phase.h index bcbed7cf6..64ad31b03 100644 --- a/include/nighthawk/common/phase.h +++ b/include/nighthawk/common/phase.h @@ -1,4 +1,3 @@ - #pragma once #include @@ -48,4 +47,4 @@ class Phase { using PhasePtr = std::unique_ptr; -} // namespace Nighthawk \ No newline at end of file +} // namespace Nighthawk diff --git a/include/nighthawk/common/sequencer.h b/include/nighthawk/common/sequencer.h index 56e177032..4f1c05202 100644 --- a/include/nighthawk/common/sequencer.h +++ b/include/nighthawk/common/sequencer.h @@ -1,4 +1,3 @@ - #pragma once #include @@ -59,4 +58,4 @@ class Sequencer { using SequencerPtr = std::unique_ptr; -} // namespace Nighthawk \ No newline at end of file +} // namespace Nighthawk diff --git a/include/nighthawk/sink/sink.h b/include/nighthawk/sink/sink.h index 10eeb6ce2..4813259ba 100644 --- a/include/nighthawk/sink/sink.h +++ b/include/nighthawk/sink/sink.h @@ -1,4 +1,3 @@ - #pragma once #include @@ -44,4 +43,4 @@ class Sink { LoadExecutionResult(absl::string_view execution_id) const PURE; }; -} // namespace Nighthawk \ No newline at end of file +} // namespace Nighthawk diff --git a/requirements.txt b/requirements.txt index 4ab03dedc..d1f788cac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,24 @@ # Last updated 2023-09-25 apipkg==3.0.2 chardet==5.2.0 +flake8-docstrings==1.7.0 +flake8==6.1.0 importlib_metadata==6.8.0 +mccabe==0.7.0 more_itertools==10.1.0 +platformdirs==3.11.0 py==1.11.0 -pytest==7.4.2 +pycodestyle==2.11.1 +pydocstyle==6.3.0 +pyflakes==3.1.0 pytest-dependency==0.5.1 # versions below 1.0.0 are unstable, so we should only take in bugfixes automatically pytest-xdist==3.3.1 +pytest==7.4.2 pyyaml==6.0.1 requests==2.31.0 six==1.16.0 +snowballstemmer==2.2.0 +yapf==0.40.2 zipp==3.17.0 # TODO(935): Remove all below dependencies after using actual dependency manager if possible. certifi==2023.7.22 @@ -24,11 +33,3 @@ tomli==2.0.1 pyparsing==3.1.1 charset_normalizer==2.1.1 # Don't update charset_normalizer to 3.x.x; the latest requests==2.28.1 can only use >=2 <3. exceptiongroup==1.1.3 -flake8-docstrings==1.5.0 -flake8==3.8.3 -mccabe==0.6.1 -pycodestyle==2.6.0 -pydocstyle==6.3.0 -pyflakes==2.2.0 -snowballstemmer==2.2.0 -yapf==0.30.0 diff --git a/source/adaptive_load/adaptive_load_client_main.cc b/source/adaptive_load/adaptive_load_client_main.cc index 63b40f380..edeedc5af 100644 --- a/source/adaptive_load/adaptive_load_client_main.cc +++ b/source/adaptive_load/adaptive_load_client_main.cc @@ -105,8 +105,8 @@ uint32_t AdaptiveLoadClientMain::Run() { if (!spec_textproto.ok()) { throw Nighthawk::NighthawkException("Failed to read spec textproto file \"" + spec_filename_ + "\": " + std::string(spec_textproto.status().message())); - } - + } + nighthawk::adaptive_load::AdaptiveLoadSessionSpec spec; if (!Envoy::Protobuf::TextFormat::ParseFromString(*spec_textproto, &spec)) { throw Nighthawk::NighthawkException("Unable to parse file \"" + spec_filename_ + diff --git a/source/adaptive_load/adaptive_load_controller_impl.h b/source/adaptive_load/adaptive_load_controller_impl.h index 4dc073892..7cd6b1e58 100644 --- a/source/adaptive_load/adaptive_load_controller_impl.h +++ b/source/adaptive_load/adaptive_load_controller_impl.h @@ -1,3 +1,5 @@ +#pragma once + #include "envoy/common/time.h" #include "nighthawk/adaptive_load/adaptive_load_controller.h" diff --git a/source/adaptive_load/config_validator_impl.h b/source/adaptive_load/config_validator_impl.h index 3ee2c8113..94776d600 100644 --- a/source/adaptive_load/config_validator_impl.h +++ b/source/adaptive_load/config_validator_impl.h @@ -1,3 +1,5 @@ +#pragma once + #include "nighthawk/adaptive_load/config_validator.h" namespace Nighthawk { diff --git a/source/adaptive_load/metrics_evaluator_impl.cc b/source/adaptive_load/metrics_evaluator_impl.cc index 71ec07f81..59e1b424c 100644 --- a/source/adaptive_load/metrics_evaluator_impl.cc +++ b/source/adaptive_load/metrics_evaluator_impl.cc @@ -24,8 +24,8 @@ absl::StatusOr GetReportingPeriod(const nighthawk::client::Outp // Find the reporting_period in which all workers are active and thus sending the intended amount // of traffic. ReportingPeriod reporting_period; - google::protobuf::Timestamp max_start_time = output.results(0).execution_start(); - google::protobuf::Timestamp min_end_time = + Envoy::ProtobufWkt::Timestamp max_start_time = output.results(0).execution_start(); + Envoy::ProtobufWkt::Timestamp min_end_time = output.results(0).execution_start() + output.results(0).execution_duration(); for (const auto& result : output.results()) { if (result.execution_start() > max_start_time) { diff --git a/source/adaptive_load/metrics_evaluator_impl.h b/source/adaptive_load/metrics_evaluator_impl.h index 432571730..50b9d00e3 100644 --- a/source/adaptive_load/metrics_evaluator_impl.h +++ b/source/adaptive_load/metrics_evaluator_impl.h @@ -1,3 +1,5 @@ +#pragma once + #include "nighthawk/adaptive_load/metrics_evaluator.h" namespace Nighthawk { diff --git a/source/adaptive_load/scoring_function_impl.h b/source/adaptive_load/scoring_function_impl.h index 94bfe88d9..e1fabbfbd 100644 --- a/source/adaptive_load/scoring_function_impl.h +++ b/source/adaptive_load/scoring_function_impl.h @@ -1,3 +1,5 @@ +#pragma once + // Implementations of ScoringFunction plugins and corresponding factories. #pragma once diff --git a/source/adaptive_load/session_spec_proto_helper_impl.h b/source/adaptive_load/session_spec_proto_helper_impl.h index d26dcd586..8a9b57c88 100644 --- a/source/adaptive_load/session_spec_proto_helper_impl.h +++ b/source/adaptive_load/session_spec_proto_helper_impl.h @@ -1,3 +1,5 @@ +#pragma once + #include "nighthawk/adaptive_load/session_spec_proto_helper.h" namespace Nighthawk { diff --git a/source/client/flush_worker_impl.h b/source/client/flush_worker_impl.h index eb916771f..e40f2b95e 100644 --- a/source/client/flush_worker_impl.h +++ b/source/client/flush_worker_impl.h @@ -1,3 +1,5 @@ +#pragma once + // Flush worker implementation. Flush worker periodically flushes metrics // snapshot to all configured stats sinks in Nighthawk. #pragma once diff --git a/source/client/process_bootstrap.h b/source/client/process_bootstrap.h index 5592403cd..f83cd03d8 100644 --- a/source/client/process_bootstrap.h +++ b/source/client/process_bootstrap.h @@ -1,3 +1,5 @@ +#pragma once + #include #include "nighthawk/client/options.h" diff --git a/source/client/process_impl.cc b/source/client/process_impl.cc index f0c2abcf6..fe3fdb295 100644 --- a/source/client/process_impl.cc +++ b/source/client/process_impl.cc @@ -310,8 +310,6 @@ class NighthawkServerFactoryContext : public Envoy::Server::Configuration::Serve PANIC("NighthawkServerFactoryContext::initManager not implemented"); }; - - Envoy::Grpc::Context& grpcContext() override { return server_.grpcContext(); }; Envoy::Router::Context& routerContext() override { return server_.routerContext(); }; diff --git a/source/common/nighthawk_service_client_impl.h b/source/common/nighthawk_service_client_impl.h index d8a14eb44..410f2a660 100644 --- a/source/common/nighthawk_service_client_impl.h +++ b/source/common/nighthawk_service_client_impl.h @@ -1,3 +1,5 @@ +#pragma once + #include "nighthawk/common/nighthawk_service_client.h" #include "external/envoy/source/common/common/statusor.h" diff --git a/source/common/phase_impl.h b/source/common/phase_impl.h index 1b40164c3..03731549f 100644 --- a/source/common/phase_impl.h +++ b/source/common/phase_impl.h @@ -1,4 +1,3 @@ - #pragma once #include "envoy/common/time.h" @@ -35,4 +34,4 @@ class PhaseImpl : public Phase, public Envoy::Logger::Loggable #include "envoy/common/time.h" @@ -61,4 +63,4 @@ class StatsCounterAbsoluteThresholdTerminationPredicateImpl : public Termination const TerminationPredicate::Status termination_status_; }; -} // namespace Nighthawk \ No newline at end of file +} // namespace Nighthawk diff --git a/source/request_source/request_options_list_plugin_impl.h b/source/request_source/request_options_list_plugin_impl.h index 8f35fdb42..92a2ff7c2 100644 --- a/source/request_source/request_options_list_plugin_impl.h +++ b/source/request_source/request_options_list_plugin_impl.h @@ -1,3 +1,5 @@ +#pragma once + // Implementations of RequestSourceConfigFactories that make a OptionsListRequestSource. #pragma once diff --git a/test/adaptive_load/adaptive_load_client_main_test.cc b/test/adaptive_load/adaptive_load_client_main_test.cc index 83914122b..49077f485 100644 --- a/test/adaptive_load/adaptive_load_client_main_test.cc +++ b/test/adaptive_load/adaptive_load_client_main_test.cc @@ -183,8 +183,10 @@ TEST(AdaptiveLoadClientMainTest, FailsIfOpeningOutputFileFails) { NiceMock filesystem; std::string infile_contents = - Envoy::Filesystem::fileSystemForTest().fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( - std::string("test/adaptive_load/test_data/valid_session_spec.textproto"))).value(); + Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( + std::string("test/adaptive_load/test_data/valid_session_spec.textproto"))) + .value(); EXPECT_CALL(filesystem, fileReadToEnd(_)).WillOnce(Return(infile_contents)); auto* mock_file = new NiceMock; @@ -213,8 +215,10 @@ TEST(AdaptiveLoadClientMainTest, FailsIfWritingOutputFileFails) { NiceMock filesystem; std::string infile_contents = - Envoy::Filesystem::fileSystemForTest().fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( - std::string("test/adaptive_load/test_data/valid_session_spec.textproto"))).value(); + Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( + std::string("test/adaptive_load/test_data/valid_session_spec.textproto"))) + .value(); EXPECT_CALL(filesystem, fileReadToEnd(_)).WillOnce(Return(infile_contents)); auto* mock_file = new NiceMock; @@ -246,8 +250,10 @@ TEST(AdaptiveLoadClientMainTest, FailsIfClosingOutputFileFails) { NiceMock filesystem; std::string infile_contents = - Envoy::Filesystem::fileSystemForTest().fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( - std::string("test/adaptive_load/test_data/valid_session_spec.textproto"))).value(); + Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( + std::string("test/adaptive_load/test_data/valid_session_spec.textproto"))) + .value(); EXPECT_CALL(filesystem, fileReadToEnd(_)).WillOnce(Return(infile_contents)); auto* mock_file = new NiceMock; @@ -285,8 +291,10 @@ TEST(AdaptiveLoadClientMainTest, WritesOutputProtoToFile) { NiceMock filesystem; std::string infile_contents = - Envoy::Filesystem::fileSystemForTest().fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( - std::string("test/adaptive_load/test_data/valid_session_spec.textproto"))).value(); + Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( + std::string("test/adaptive_load/test_data/valid_session_spec.textproto"))) + .value(); EXPECT_CALL(filesystem, fileReadToEnd(_)).WillOnce(Return(infile_contents)); std::string actual_outfile_contents; @@ -313,9 +321,10 @@ TEST(AdaptiveLoadClientMainTest, WritesOutputProtoToFile) { AdaptiveLoadClientMain main(5, argv.data(), controller, filesystem); main.Run(); - std::string golden_text = - Envoy::Filesystem::fileSystemForTest().fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath( - std::string("test/adaptive_load/test_data/golden_output.textproto"))).value(); + std::string golden_text = Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(Nighthawk::TestEnvironment::runfilesPath(std::string( + "test/adaptive_load/test_data/golden_output.textproto"))) + .value(); nighthawk::adaptive_load::AdaptiveLoadSessionOutput golden_proto; Envoy::Protobuf::TextFormat::ParseFromString(golden_text, &golden_proto); EXPECT_EQ(actual_outfile_contents, golden_proto.DebugString()); diff --git a/test/adaptive_load/fake_plugins/fake_input_variable_setter/fake_input_variable_setter.h b/test/adaptive_load/fake_plugins/fake_input_variable_setter/fake_input_variable_setter.h index 5f3b75d97..b84ced041 100644 --- a/test/adaptive_load/fake_plugins/fake_input_variable_setter/fake_input_variable_setter.h +++ b/test/adaptive_load/fake_plugins/fake_input_variable_setter/fake_input_variable_setter.h @@ -1,4 +1,3 @@ - #pragma once #include "envoy/registry/registry.h" diff --git a/test/benchmark_http_client_test.cc b/test/benchmark_http_client_test.cc index 6f051a3a9..c4afbbf92 100644 --- a/test/benchmark_http_client_test.cc +++ b/test/benchmark_http_client_test.cc @@ -34,7 +34,7 @@ namespace Nighthawk { namespace { using ::envoy::config::core::v3::TypedExtensionConfig; -using ::google::protobuf::TextFormat; +using ::proto2::TextFormat; // Helper function to get headers in a set that should be verified during the test. std::string getPathFromRequest(const Envoy::Http::RequestHeaderMap& header) { diff --git a/test/client_worker_test.cc b/test/client_worker_test.cc index 7de52a3b0..7cc62778c 100644 --- a/test/client_worker_test.cc +++ b/test/client_worker_test.cc @@ -38,7 +38,7 @@ class ClientWorkerTest : public Test { ClientWorkerTest() : api_(Envoy::Api::createApiForTest()), thread_id_(std::this_thread::get_id()) { loader_ = Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( - dispatcher_, tls_, {}, local_info_, store_, rand_, validation_visitor_, *api_)}; + dispatcher_, tls_, {}, local_info_, store_, rand_, validation_visitor_, *api_)}; benchmark_client_ = new MockBenchmarkClient(); sequencer_ = new MockSequencer(); request_generator_ = new MockRequestSource(); diff --git a/test/flush_worker_test.cc b/test/flush_worker_test.cc index 67b8de227..f436867a5 100644 --- a/test/flush_worker_test.cc +++ b/test/flush_worker_test.cc @@ -37,7 +37,7 @@ class FlushWorkerTest : public Test { NiceMock local_info; NiceMock validation_visitor; loader_ = Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( - *dispatcher_, tls_, {}, local_info, store_, rand, validation_visitor, api_)}; + *dispatcher_, tls_, {}, local_info, store_, rand, validation_visitor, api_)}; sink_ = new StrictMock(); stats_sinks_.emplace_back(sink_); diff --git a/test/output_collector_test.cc b/test/output_collector_test.cc index 81756380f..d15af846e 100644 --- a/test/output_collector_test.cc +++ b/test/output_collector_test.cc @@ -15,8 +15,8 @@ namespace Nighthawk { namespace Client { namespace { -using ::google::protobuf::TextFormat; using ::nighthawk::client::UserDefinedOutput; +using ::proto2::TextFormat; class OutputCollectorTest : public Test, public Envoy::Event::TestUsingSimulatedTime { public: diff --git a/test/output_formatter_test.cc b/test/output_formatter_test.cc index ea4a4d08d..2d024ed33 100644 --- a/test/output_formatter_test.cc +++ b/test/output_formatter_test.cc @@ -78,8 +78,9 @@ class OutputCollectorTest : public Test { } std::string readGoldFile(absl::string_view path) { - std::string s = Envoy::Filesystem::fileSystemForTest().fileReadToEnd( - TestEnvironment::runfilesPath(std::string(path))).value(); + std::string s = Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(TestEnvironment::runfilesPath(std::string(path))) + .value(); const auto version = VersionInfo::buildVersion().version(); const std::string major = fmt::format("{}", version.major_number()); const std::string minor = fmt::format("{}", version.minor_number()); @@ -115,9 +116,9 @@ TEST_F(OutputCollectorTest, JsonFormatter) { EXPECT_EQ((formatter.formatProto(collector_->toProto())).ok(), true); std::string expected_str = readGoldFile("test/test_data/output_formatter.json.gold"); nighthawk::client::Output expected_output_proto, output_proto; - google::protobuf::TextFormat::ParseFromString(expected_str, &expected_output_proto); - google::protobuf::TextFormat::ParseFromString( - (formatter.formatProto(collector_->toProto())).value(), &output_proto); + proto2::TextFormat::ParseFromString(expected_str, &expected_output_proto); + proto2::TextFormat::ParseFromString((formatter.formatProto(collector_->toProto())).value(), + &output_proto); EXPECT_THAT(output_proto, EqualsProto(expected_output_proto)); } @@ -126,9 +127,9 @@ TEST_F(OutputCollectorTest, YamlFormatter) { EXPECT_EQ((formatter.formatProto(collector_->toProto())).ok(), true); std::string expected_str = readGoldFile("test/test_data/output_formatter.yaml.gold"); nighthawk::client::Output expected_output_proto, output_proto; - google::protobuf::TextFormat::ParseFromString(expected_str, &expected_output_proto); - google::protobuf::TextFormat::ParseFromString( - (formatter.formatProto(collector_->toProto())).value(), &output_proto); + proto2::TextFormat::ParseFromString(expected_str, &expected_output_proto); + proto2::TextFormat::ParseFromString((formatter.formatProto(collector_->toProto())).value(), + &output_proto); EXPECT_THAT(output_proto, EqualsProto(expected_output_proto)); } @@ -211,8 +212,9 @@ class MediumOutputCollectorTest : public OutputCollectorTest { public: nighthawk::client::Output loadProtoFromFile(absl::string_view path) { nighthawk::client::Output proto; - const auto contents = Envoy::Filesystem::fileSystemForTest().fileReadToEnd( - TestEnvironment::runfilesPath(std::string(path))).value(); + const auto contents = Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(TestEnvironment::runfilesPath(std::string(path))) + .value(); Envoy::MessageUtil::loadFromJson(contents, proto, Envoy::ProtobufMessage::getStrictValidationVisitor()); return proto; @@ -224,10 +226,9 @@ TEST_F(MediumOutputCollectorTest, FortioFormatter) { loadProtoFromFile("test/test_data/output_formatter.medium.proto.gold"); std::string expected_str = readGoldFile("test/test_data/output_formatter.medium.fortio.gold"); nighthawk::client::Output expected_output_proto, output_proto; - google::protobuf::TextFormat::ParseFromString(expected_str, &expected_output_proto); + proto2::TextFormat::ParseFromString(expected_str, &expected_output_proto); FortioOutputFormatterImpl formatter; - google::protobuf::TextFormat::ParseFromString((formatter.formatProto(input_proto)).value(), - &output_proto); + proto2::TextFormat::ParseFromString((formatter.formatProto(input_proto)).value(), &output_proto); EXPECT_THAT(output_proto, EqualsProto(expected_output_proto)); } @@ -286,10 +287,9 @@ TEST_F(MediumOutputCollectorTest, FortioPedanticFormatter) { std::string expected_str = readGoldFile("test/test_data/output_formatter.medium.fortio-noquirks.gold"); nighthawk::client::Output expected_output_proto, output_proto; - google::protobuf::TextFormat::ParseFromString(expected_str, &expected_output_proto); + proto2::TextFormat::ParseFromString(expected_str, &expected_output_proto); FortioPedanticOutputFormatterImpl formatter; - google::protobuf::TextFormat::ParseFromString((formatter.formatProto(input_proto)).value(), - &output_proto); + proto2::TextFormat::ParseFromString((formatter.formatProto(input_proto)).value(), &output_proto); EXPECT_THAT(output_proto, EqualsProto(expected_output_proto)); } diff --git a/test/process_test.cc b/test/process_test.cc index c08a1ee53..e78b16c00 100644 --- a/test/process_test.cc +++ b/test/process_test.cc @@ -30,7 +30,7 @@ namespace Client { namespace { using ::envoy::config::core::v3::TypedExtensionConfig; -using ::google::protobuf::TextFormat; +using ::proto2::TextFormat; using ::testing::HasSubstr; using ::testing::TestWithParam; using ::testing::ValuesIn; diff --git a/test/request_source/stub_plugin_impl.h b/test/request_source/stub_plugin_impl.h index f5bcf46d3..6cce371c3 100644 --- a/test/request_source/stub_plugin_impl.h +++ b/test/request_source/stub_plugin_impl.h @@ -1,3 +1,5 @@ +#pragma once + // Test implementations of RequestSourceConfigFactory and RequestSource that perform minimum // functionality for testing purposes. #pragma once diff --git a/test/statistic_test.cc b/test/statistic_test.cc index 74f97f21c..e7ece0b8c 100644 --- a/test/statistic_test.cc +++ b/test/statistic_test.cc @@ -340,9 +340,11 @@ TEST(StatisticTest, HdrStatisticPercentilesProto) { } Envoy::MessageUtil util; - util.loadFromJson(Envoy::Filesystem::fileSystemForTest().fileReadToEnd( - TestEnvironment::runfilesPath("test/test_data/hdr_proto_json.gold")).value(), - parsed_json_proto, Envoy::ProtobufMessage::getStrictValidationVisitor()); + util.loadFromJson( + Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(TestEnvironment::runfilesPath("test/test_data/hdr_proto_json.gold")) + .value(), + parsed_json_proto, Envoy::ProtobufMessage::getStrictValidationVisitor()); const std::string json = util.getJsonStringFromMessageOrError( statistic.toProto(Statistic::SerializationDomain::DURATION), true, true); const std::string golden_json = @@ -363,9 +365,11 @@ TEST(StatisticTest, CircllhistStatisticPercentilesProto) { } Envoy::MessageUtil util; - util.loadFromJson(Envoy::Filesystem::fileSystemForTest().fileReadToEnd( - TestEnvironment::runfilesPath("test/test_data/circllhist_proto_json.gold")).value(), - parsed_json_proto, Envoy::ProtobufMessage::getStrictValidationVisitor()); + util.loadFromJson( + Envoy::Filesystem::fileSystemForTest() + .fileReadToEnd(TestEnvironment::runfilesPath("test/test_data/circllhist_proto_json.gold")) + .value(), + parsed_json_proto, Envoy::ProtobufMessage::getStrictValidationVisitor()); const std::string json = util.getJsonStringFromMessageOrError( statistic.toProto(Statistic::SerializationDomain::DURATION), true, true); const std::string golden_json = diff --git a/test/test_common/proto_matchers.h b/test/test_common/proto_matchers.h index 0a090593d..8809dea48 100644 --- a/test/test_common/proto_matchers.h +++ b/test/test_common/proto_matchers.h @@ -1,3 +1,5 @@ +#pragma once + #include #include "external/envoy/source/common/protobuf/protobuf.h" diff --git a/test/user_defined_output/fake_plugin/fake_user_defined_output_test.cc b/test/user_defined_output/fake_plugin/fake_user_defined_output_test.cc index ea8f32132..710c4f279 100644 --- a/test/user_defined_output/fake_plugin/fake_user_defined_output_test.cc +++ b/test/user_defined_output/fake_plugin/fake_user_defined_output_test.cc @@ -19,9 +19,9 @@ namespace Nighthawk { namespace { using ::Envoy::Http::TestResponseHeaderMapImpl; -using ::google::protobuf::TextFormat; using ::nighthawk::FakeUserDefinedOutput; using ::nighthawk::FakeUserDefinedOutputConfig; +using ::proto2::TextFormat; using ::testing::HasSubstr; absl::StatusOr CreatePlugin(const std::string& config_textproto, @@ -220,4 +220,4 @@ TEST(AggregateGlobalOutput, FailsElegantlyWithIncorrectInput) { } } // namespace -} // namespace Nighthawk \ No newline at end of file +} // namespace Nighthawk diff --git a/test/user_defined_output/log_response_headers_plugin_test.cc b/test/user_defined_output/log_response_headers_plugin_test.cc index f055c9764..54344306d 100644 --- a/test/user_defined_output/log_response_headers_plugin_test.cc +++ b/test/user_defined_output/log_response_headers_plugin_test.cc @@ -22,9 +22,9 @@ namespace { using ::Envoy::Http::HeaderEntry; using ::Envoy::Http::TestResponseHeaderMapImpl; -using ::google::protobuf::TextFormat; using ::nighthawk::LogResponseHeadersConfig; using ::nighthawk::LogResponseHeadersOutput; +using ::proto2::TextFormat; using ::testing::HasSubstr; // Fake Header Logger to enable testing of LogResponseHeadersPlugin. Keeps track of logged headers. diff --git a/test/user_defined_output/user_defined_output_plugin_creator_test.cc b/test/user_defined_output/user_defined_output_plugin_creator_test.cc index 859b88e89..0f9695983 100644 --- a/test/user_defined_output/user_defined_output_plugin_creator_test.cc +++ b/test/user_defined_output/user_defined_output_plugin_creator_test.cc @@ -15,9 +15,9 @@ namespace Nighthawk { namespace { using ::envoy::config::core::v3::TypedExtensionConfig; -using ::google::protobuf::TextFormat; using ::nighthawk::FakeUserDefinedOutputConfig; using ::nighthawk::LogResponseHeadersConfig; +using ::proto2::TextFormat; using ::testing::HasSubstr; UserDefinedOutputConfigFactoryPair diff --git a/test/worker_test.cc b/test/worker_test.cc index 2ad271271..492782eae 100644 --- a/test/worker_test.cc +++ b/test/worker_test.cc @@ -50,9 +50,8 @@ TEST_F(WorkerTest, WorkerExecutesOnThread) { TestWorker worker(*api_, tls_); NiceMock dispatcher; - Envoy::Runtime::LoaderPtr loader = - Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( - dispatcher, tls_, {}, local_info_, test_store_, rand_, validation_visitor_, *api_)}; + Envoy::Runtime::LoaderPtr loader = Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( + dispatcher, tls_, {}, local_info_, test_store_, rand_, validation_visitor_, *api_)}; worker.start(); worker.waitForCompletion(); diff --git a/tools/BUILD b/tools/BUILD index 67663d940..73cace29e 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -1,3 +1,4 @@ +load("@python_pip_deps//:requirements.bzl", "entry_point") load("@python_pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_binary") @@ -35,3 +36,12 @@ py_binary( requirement("yapf"), ], ) + +py_binary( + name = "flake8", + srcs = ["flake8.py"], + deps = [ + requirement("flake8"), + requirement("flake8-docstrings"), + ], +) diff --git a/tools/flake8.py b/tools/flake8.py new file mode 100644 index 000000000..cac880d0a --- /dev/null +++ b/tools/flake8.py @@ -0,0 +1,12 @@ +"""Wrapper around flake8. + +Exists, so that we can define a Bazel py_binary target that combines flake8 and +any flake8 plugins we might need. + +""" +import flake8.main.cli + +import sys + +if __name__ == '__main__': + sys.exit(flake8.main.cli.main()) diff --git a/tools/format_python_tools.py b/tools/format_python_tools.py index c55bde662..df7da0ab2 100755 --- a/tools/format_python_tools.py +++ b/tools/format_python_tools.py @@ -12,7 +12,7 @@ EXCLUDE_FILES = ['gen_compilation_database.py'] -def collectFiles(directory): +def collectFiles(directory): """Collect all Python files in the tools directory. Returns: A collection of python files in the tools directory excluding @@ -29,7 +29,6 @@ def collectFiles(directory): for filename in fnmatch.filter(filenames, '*.py'): if filename in EXCLUDE_FILES: continue - print("XXXXXX adding %s", os.path.join(root, filename)) matches.append(os.path.join(root, filename)) return matches @@ -77,7 +76,10 @@ def displayFixResults(successful_files, failed_files): choices=['check', 'fix'], default='check', help='Fix invalid syntax in files.') - parser.add_argument('--directory', default='.', help='directory where to search for Python files that will be formatted. Default ".".') + parser.add_argument( + '--directory', + default='.', + help='directory where to search for Python files that will be formatted. Default ".".') args = parser.parse_args() is_valid = validateFormat(args.directory, args.action == 'fix') sys.exit(0 if is_valid else 1) diff --git a/tools/format_python_tools.sh b/tools/format_python_tools.sh index 4e2a845a6..e9a120739 100755 --- a/tools/format_python_tools.sh +++ b/tools/format_python_tools.sh @@ -5,14 +5,12 @@ set -e DIRECTORY=${PWD} echo "Running Python format check..." -bazel run //tools:format_python_tools -- --directory=${DIRECTORY} $1 +#bazel run //tools:format_python_tools -- --directory=${DIRECTORY} $1 echo "Running Python3 flake8 check..." -cd .. -EXCLUDE="--exclude=benchmarks/tmp/*,.cache/*,*/venv/*,tools/format_python_tools.py,tools/gen_compilation_database.py,bazel-*" +EXCLUDE="venv,format_python_tools.py,gen_compilation_database.py" - -# Because of conflict with the automatic fix format script, we ignore: +# Because of conflict with the automatic fix format script, we ignore: # E111 Indentation is not a multiple of four # E114 Indentation is not a multiple of four (comment) # E501 Line too long (82 > 79 characters) @@ -21,11 +19,9 @@ EXCLUDE="--exclude=benchmarks/tmp/*,.cache/*,*/venv/*,tools/format_python_tools. # E126 Continuation line over-indented for hanging indent # W504 line break after binary operator -# We ignore false positives because of what look like pytest peculiarities +# We ignore false positives because of what look like pytest peculiarities # F401 Module imported but unused # F811 Redefinition of unused name from line n -flake8 ${DIRECTORY} ${EXCLUDE} --ignore=E114,E111,E501,F401,F811,E124,E125,E126,W504,D --count --show-source --statistics -# D = Doc comment related checks (We check both p257 AND google conventions). -flake8 ${DIRECTORY} ${EXCLUDE} --docstring-convention pep257 --select=D --count --show-source --statistics -flake8 ${DIRECTORY} ${EXCLUDE} --docstring-convention google --select=D --count --show-source --statistics - +bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --ignore=E114,E111,E501,F401,F811,E124,E125,E126,W504,D --count --show-source --statistics +bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --docstring-convention pep257 --select=D --count --show-source --statistics +bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --docstring-convention google --select=D --count --show-source --statistics From 7490b414b29a95866b8e48f31ed5b3d5c597687e Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 08:17:56 +0000 Subject: [PATCH 09/22] Self-review. Signed-off-by: Jakub Sobon --- tools/BUILD | 7 ------- tools/format_python_tools.sh | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/BUILD b/tools/BUILD index 73cace29e..9a0c8c027 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -26,13 +26,6 @@ py_binary( ":.style.yapf", ], deps = [ - requirement("flake8"), - requirement("flake8-docstrings"), - requirement("mccabe"), - requirement("pycodestyle"), - requirement("pydocstyle"), - requirement("pyflakes"), - requirement("snowballstemmer"), requirement("yapf"), ], ) diff --git a/tools/format_python_tools.sh b/tools/format_python_tools.sh index e9a120739..40f2a3fa5 100755 --- a/tools/format_python_tools.sh +++ b/tools/format_python_tools.sh @@ -5,7 +5,7 @@ set -e DIRECTORY=${PWD} echo "Running Python format check..." -#bazel run //tools:format_python_tools -- --directory=${DIRECTORY} $1 +bazel run //tools:format_python_tools -- --directory=${DIRECTORY} $1 echo "Running Python3 flake8 check..." EXCLUDE="venv,format_python_tools.py,gen_compilation_database.py" @@ -22,6 +22,7 @@ EXCLUDE="venv,format_python_tools.py,gen_compilation_database.py" # We ignore false positives because of what look like pytest peculiarities # F401 Module imported but unused # F811 Redefinition of unused name from line n +sudo apt-get install python3-distutils bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --ignore=E114,E111,E501,F401,F811,E124,E125,E126,W504,D --count --show-source --statistics bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --docstring-convention pep257 --select=D --count --show-source --statistics bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --docstring-convention google --select=D --count --show-source --statistics From ef043e6fa0035ec4eb81f777471ab8477788b2dd Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 08:24:59 +0000 Subject: [PATCH 10/22] Add setuptools package. Signed-off-by: Jakub Sobon --- requirements.txt | 1 + tools/format_python_tools.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d1f788cac..99c79c89d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,6 +16,7 @@ pytest-xdist==3.3.1 pytest==7.4.2 pyyaml==6.0.1 requests==2.31.0 +setuptools==68.2.2 six==1.16.0 snowballstemmer==2.2.0 yapf==0.40.2 diff --git a/tools/format_python_tools.sh b/tools/format_python_tools.sh index 40f2a3fa5..90f0172b2 100755 --- a/tools/format_python_tools.sh +++ b/tools/format_python_tools.sh @@ -22,7 +22,6 @@ EXCLUDE="venv,format_python_tools.py,gen_compilation_database.py" # We ignore false positives because of what look like pytest peculiarities # F401 Module imported but unused # F811 Redefinition of unused name from line n -sudo apt-get install python3-distutils bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --ignore=E114,E111,E501,F401,F811,E124,E125,E126,W504,D --count --show-source --statistics bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --docstring-convention pep257 --select=D --count --show-source --statistics bazel run //tools:flake8 -- ${DIRECTORY} --exclude=${EXCLUDE} --docstring-convention google --select=D --count --show-source --statistics From a456ae855ed95888115fa64603c054243bdf443a Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 08:48:51 +0000 Subject: [PATCH 11/22] Install distutils. Signed-off-by: Jakub Sobon --- ci/do_ci.sh | 2 +- tools/format_python_tools.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index b8fb9340c..c843c3200 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -222,7 +222,7 @@ function do_benchmark_with_own_binaries() { function do_check_format() { echo "check_format..." cd "${SRCDIR}" - ./tools/check_format.sh check + #./tools/check_format.sh check ./tools/format_python_tools.sh check } diff --git a/tools/format_python_tools.sh b/tools/format_python_tools.sh index 90f0172b2..282391b2c 100755 --- a/tools/format_python_tools.sh +++ b/tools/format_python_tools.sh @@ -4,6 +4,9 @@ set -e DIRECTORY=${PWD} +sudo apt-get update +sudo apt-get install python3-distutils + echo "Running Python format check..." bazel run //tools:format_python_tools -- --directory=${DIRECTORY} $1 From bceaac985c67cd39d12fb625391e1a877ebe5dd5 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 08:55:23 +0000 Subject: [PATCH 12/22] Remove package installation. Signed-off-by: Jakub Sobon --- tools/BUILD | 1 + tools/format_python_tools.sh | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/BUILD b/tools/BUILD index 9a0c8c027..cc03a9a0d 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -34,6 +34,7 @@ py_binary( name = "flake8", srcs = ["flake8.py"], deps = [ + requirement("setuptools"), requirement("flake8"), requirement("flake8-docstrings"), ], diff --git a/tools/format_python_tools.sh b/tools/format_python_tools.sh index 282391b2c..90f0172b2 100755 --- a/tools/format_python_tools.sh +++ b/tools/format_python_tools.sh @@ -4,9 +4,6 @@ set -e DIRECTORY=${PWD} -sudo apt-get update -sudo apt-get install python3-distutils - echo "Running Python format check..." bazel run //tools:format_python_tools -- --directory=${DIRECTORY} $1 From 18f305387541a861c68b877daf2d9dbecd52c516 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 08:59:19 +0000 Subject: [PATCH 13/22] Back to the old Docker image. Signed-off-by: Jakub Sobon --- .bazelrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index 9f4b89fd3..4858e1d8e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -366,7 +366,7 @@ build:compile-time-options --@envoy//source/extensions/filters/http/kill_request # Docker sandbox # NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/main/toolchains/rbe_toolchains_config.bzl#L8 -build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:fdd65c6270a8507a18d5acd6cf19a18cb695e4fa@sha256:3c8a3ce6f90dcfb5d09dc8f79bb01404d3526d420061f9a176e0a8e91e1e573e +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:94e5d873c145ae86f205117e76276161c9af4806@sha256:8d3763e19d5b71fdc95666d75073ce4581e566ce28ca09106607b6a3ef7ba902 build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker @@ -526,7 +526,7 @@ build:rbe-envoy-engflow --grpc_keepalive_time=30s build:rbe-envoy-engflow --remote_timeout=3600s build:rbe-envoy-engflow --bes_timeout=3600s build:rbe-envoy-engflow --bes_upload_mode=fully_async -build:rbe-envoy-engflow --remote_default_exec_properties=container-image=docker://docker.io/envoyproxy/envoy-build-ubuntu:fdd65c6270a8507a18d5acd6cf19a18cb695e4fa@sha256:3c8a3ce6f90dcfb5d09dc8f79bb01404d3526d420061f9a176e0a8e91e1e573e +build:rbe-envoy-engflow --remote_default_exec_properties=container-image=docker://docker.io/envoyproxy/envoy-build-ubuntu:94e5d873c145ae86f205117e76276161c9af4806@sha256:8d3763e19d5b71fdc95666d75073ce4581e566ce28ca09106607b6a3ef7ba902 ############################################################################# # debug: Various Bazel debugging flags From 806fe42fd41c15ccec735c920b3e53d068f2fbc0 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 09:07:14 +0000 Subject: [PATCH 14/22] Revert pipeline changes. Signed-off-by: Jakub Sobon --- .azure-pipelines/pipelines.yml | 240 ++++++++++++++++----------------- .bazelrc | 2 - ci/do_ci.sh | 2 +- requirements.txt | 1 - 4 files changed, 121 insertions(+), 124 deletions(-) diff --git a/.azure-pipelines/pipelines.yml b/.azure-pipelines/pipelines.yml index 514f80487..a0a3bbe62 100644 --- a/.azure-pipelines/pipelines.yml +++ b/.azure-pipelines/pipelines.yml @@ -14,8 +14,8 @@ stages: strategy: maxParallel: 2 matrix: - #build: - # CI_TARGET: "build" + build: + CI_TARGET: "build" format: CI_TARGET: "check_format" timeoutInMinutes: 120 @@ -24,121 +24,121 @@ stages: parameters: ciTarget: $(CI_TARGET) -#- stage: test -# dependsOn: ["check"] -# pool: "envoy-x64-large" -# jobs: -# - job: test_and_benchmark -# displayName: "do_ci.sh" -# strategy: -# # Both test and benchmark need dedicated resources for stability. -# maxParallel: 1 -# matrix: -# test: -# CI_TARGET: "test" -# benchmark: -# CI_TARGET: "benchmark_with_own_binaries" -# timeoutInMinutes: 120 -# steps: -# - template: bazel.yml -# parameters: -# ciTarget: $(CI_TARGET) -# -#- stage: clang_tidy -# dependsOn: ["check"] -# pool: "envoy-x64-large" -# jobs: -# - job: clang_tidy -# displayName: "do_ci.sh" -# strategy: -# maxParallel: 1 -# matrix: -# clang_tidy: -# CI_TARGET: "clang_tidy" -# timeoutInMinutes: 120 -# steps: -# - template: bazel.yml -# parameters: -# ciTarget: $(CI_TARGET) -# -#- stage: test_gcc -# dependsOn: ["check"] -# pool: "envoy-x64-large" -# jobs: -# - job: test_gcc -# displayName: "do_ci.sh" -# strategy: -# maxParallel: 1 -# matrix: -# test_gcc: -# CI_TARGET: "test_gcc" -# timeoutInMinutes: 120 -# steps: -# - template: bazel.yml -# parameters: -# ciTarget: $(CI_TARGET) -# -#- stage: sanitizers -# dependsOn: ["test"] -# pool: "envoy-x64-large" -# jobs: -# - job: sanitizers -# displayName: "do_ci.sh" -# strategy: -# maxParallel: 2 -# matrix: -# asan: -# CI_TARGET: "asan" -# tsan: -# CI_TARGET: "tsan" -# timeoutInMinutes: 120 -# steps: -# - template: bazel.yml -# parameters: -# ciTarget: $(CI_TARGET) -# -#- stage: coverage_unit -# dependsOn: ["test"] -# pool: "envoy-x64-large" -# jobs: -# - job: coverage_unit -# displayName: "do_ci.sh" -# strategy: -# maxParallel: 1 -# matrix: -# coverage: -# CI_TARGET: "coverage" -# timeoutInMinutes: 120 -# steps: -# - template: bazel.yml -# parameters: -# ciTarget: $(CI_TARGET) -# - task: PublishPipelineArtifact@1 -# condition: always() -# displayName: 'Publish the line coverage report' -# inputs: -# targetPath: $(Build.SourcesDirectory)/coverage_html.zip -# artifactName: UnitTestCoverageReport-$(System.JobAttempt) -# -## coverage_integration stage was temporarily removed due to the issue -## reported by https://github.com/envoyproxy/nighthawk/issues/1006 -#- stage: release -# dependsOn: -# - "clang_tidy" -# - "test_gcc" -# - "sanitizers" -# - "coverage_unit" -# condition: eq(variables['PostSubmit'], true) -# pool: "envoy-x64-large" -# jobs: -# - job: release -# displayName: "do_ci.sh" -# strategy: -# matrix: -# release: -# CI_TARGET: "docker" -# timeoutInMinutes: 120 -# steps: -# - template: bazel.yml -# parameters: -# ciTarget: $(CI_TARGET) +- stage: test + dependsOn: ["check"] + pool: "envoy-x64-large" + jobs: + - job: test_and_benchmark + displayName: "do_ci.sh" + strategy: + # Both test and benchmark need dedicated resources for stability. + maxParallel: 1 + matrix: + test: + CI_TARGET: "test" + benchmark: + CI_TARGET: "benchmark_with_own_binaries" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: clang_tidy + dependsOn: ["check"] + pool: "envoy-x64-large" + jobs: + - job: clang_tidy + displayName: "do_ci.sh" + strategy: + maxParallel: 1 + matrix: + clang_tidy: + CI_TARGET: "clang_tidy" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: test_gcc + dependsOn: ["check"] + pool: "envoy-x64-large" + jobs: + - job: test_gcc + displayName: "do_ci.sh" + strategy: + maxParallel: 1 + matrix: + test_gcc: + CI_TARGET: "test_gcc" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: sanitizers + dependsOn: ["test"] + pool: "envoy-x64-large" + jobs: + - job: sanitizers + displayName: "do_ci.sh" + strategy: + maxParallel: 2 + matrix: + asan: + CI_TARGET: "asan" + tsan: + CI_TARGET: "tsan" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + +- stage: coverage_unit + dependsOn: ["test"] + pool: "envoy-x64-large" + jobs: + - job: coverage_unit + displayName: "do_ci.sh" + strategy: + maxParallel: 1 + matrix: + coverage: + CI_TARGET: "coverage" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) + - task: PublishPipelineArtifact@1 + condition: always() + displayName: 'Publish the line coverage report' + inputs: + targetPath: $(Build.SourcesDirectory)/coverage_html.zip + artifactName: UnitTestCoverageReport-$(System.JobAttempt) + +# coverage_integration stage was temporarily removed due to the issue +# reported by https://github.com/envoyproxy/nighthawk/issues/1006 +- stage: release + dependsOn: + - "clang_tidy" + - "test_gcc" + - "sanitizers" + - "coverage_unit" + condition: eq(variables['PostSubmit'], true) + pool: "envoy-x64-large" + jobs: + - job: release + displayName: "do_ci.sh" + strategy: + matrix: + release: + CI_TARGET: "docker" + timeoutInMinutes: 120 + steps: + - template: bazel.yml + parameters: + ciTarget: $(CI_TARGET) diff --git a/.bazelrc b/.bazelrc index 4858e1d8e..2752d2b8e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -246,8 +246,6 @@ build:fuzz-coverage --config=plain-fuzzer build:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh build:fuzz-coverage --test_tag_filters=-nocoverage -build:cache-local --remote_cache=grpc://localhost:9092 - # Remote execution: https://docs.bazel.build/versions/master/remote-execution.html build:rbe-toolchain --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 diff --git a/ci/do_ci.sh b/ci/do_ci.sh index c843c3200..b8fb9340c 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -222,7 +222,7 @@ function do_benchmark_with_own_binaries() { function do_check_format() { echo "check_format..." cd "${SRCDIR}" - #./tools/check_format.sh check + ./tools/check_format.sh check ./tools/format_python_tools.sh check } diff --git a/requirements.txt b/requirements.txt index 99c79c89d..d1f788cac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,6 @@ pytest-xdist==3.3.1 pytest==7.4.2 pyyaml==6.0.1 requests==2.31.0 -setuptools==68.2.2 six==1.16.0 snowballstemmer==2.2.0 yapf==0.40.2 From 8100d9e95ff2eb2e778713ce712fc45d76e034f5 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sat, 21 Oct 2023 09:18:15 +0000 Subject: [PATCH 15/22] Remove setuptools. Signed-off-by: Jakub Sobon --- tools/BUILD | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/BUILD b/tools/BUILD index cc03a9a0d..9a0c8c027 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -34,7 +34,6 @@ py_binary( name = "flake8", srcs = ["flake8.py"], deps = [ - requirement("setuptools"), requirement("flake8"), requirement("flake8-docstrings"), ], From b4b149e0642ed8b3aa1fe0399908b6fa20a721f9 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Tue, 24 Oct 2023 20:03:21 +0000 Subject: [PATCH 16/22] Switch to hermetic Python. Signed-off-by: Jakub Sobon --- WORKSPACE | 16 +- bazel/python_dependencies.bzl | 10 + source/client/process_impl.cc | 4 +- tools/base/BUILD | 16 ++ .../base/requirements.in | 0 tools/base/requirements.txt | 224 ++++++++++++++++++ 6 files changed, 256 insertions(+), 14 deletions(-) create mode 100644 bazel/python_dependencies.bzl create mode 100644 tools/base/BUILD rename requirements.txt => tools/base/requirements.in (100%) create mode 100644 tools/base/requirements.txt diff --git a/WORKSPACE b/WORKSPACE index 7a6fbd247..c48e240b8 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -33,16 +33,10 @@ load("@envoy//bazel:dependency_imports.bzl", "envoy_dependency_imports") envoy_dependency_imports() -# For PIP support: -load("@rules_python//python:pip.bzl", "pip_parse") - -# This rule translates the specified requirements.txt into -# @my_deps//:requirements.bzl, which itself exposes a pip_parse method. -pip_parse( - name = "python_pip_deps", - requirements = "//:requirements.txt", -) +load("//bazel:python_dependencies.bzl", "nighthawk_python_dependencies") + +nighthawk_python_dependencies() -load("@python_pip_deps//:requirements.bzl", "install_deps") +load("@python_pip_deps//:requirements.bzl", python_pip_deps = "install_deps") -install_deps() +python_pip_deps() diff --git a/bazel/python_dependencies.bzl b/bazel/python_dependencies.bzl new file mode 100644 index 000000000..7aba24a21 --- /dev/null +++ b/bazel/python_dependencies.bzl @@ -0,0 +1,10 @@ +load("@rules_python//python:pip.bzl", "pip_parse") +load("@python3_11//:defs.bzl", "interpreter") + +def nighthawk_python_dependencies(): + pip_parse( + name = "python_pip_deps", + python_interpreter_target = interpreter, + requirements_lock = "//tools/base:requirements.txt", + extra_pip_args = ["--require-hashes"], + ) diff --git a/source/client/process_impl.cc b/source/client/process_impl.cc index 0b0f35e62..164b9220a 100644 --- a/source/client/process_impl.cc +++ b/source/client/process_impl.cc @@ -142,9 +142,7 @@ class NighthawkServerInstance : public Envoy::Server::Instance { local_info_(local_info), validation_context_(validation_context), grpc_context_(grpc_context), router_context_(router_context) {} - void run() override { - PANIC("NighthawkServerInstance::run not implemented"); - } + void run() override { PANIC("NighthawkServerInstance::run not implemented"); } Envoy::OptRef admin() override { return admin_; } Envoy::Api::Api& api() override { return api_; } Envoy::Upstream::ClusterManager& clusterManager() override { diff --git a/tools/base/BUILD b/tools/base/BUILD new file mode 100644 index 000000000..0141beded --- /dev/null +++ b/tools/base/BUILD @@ -0,0 +1,16 @@ +load("@rules_python//python:pip.bzl", "compile_pip_requirements") +load("@envoy//bazel:envoy_build_system.bzl", "envoy_package") + +licenses(["notice"]) # Apache 2 + +envoy_package() + +compile_pip_requirements( + name = "requirements", + extra_args = [ + "--allow-unsafe", + "--generate-hashes", + "--reuse-hashes", + "--resolver=backtracking", + ], +) diff --git a/requirements.txt b/tools/base/requirements.in similarity index 100% rename from requirements.txt rename to tools/base/requirements.in diff --git a/tools/base/requirements.txt b/tools/base/requirements.txt new file mode 100644 index 000000000..99379daba --- /dev/null +++ b/tools/base/requirements.txt @@ -0,0 +1,224 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# bazel run //tools/base:requirements.update +# +apipkg==3.0.2 \ + --hash=sha256:a16984c39de280701f3f6406ed3af658f2a1965011fe7bb5be34fbb48423b411 \ + --hash=sha256:c7aa61a4f82697fdaa667e70af1505acf1f7428b1c27b891d204ba7a8a3c5e0d + # via -r tools/base/requirements.in +attrs==23.1.0 \ + --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ + --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 + # via -r tools/base/requirements.in +certifi==2023.7.22 \ + --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ + --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 + # via + # -r tools/base/requirements.in + # requests +chardet==5.2.0 \ + --hash=sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7 \ + --hash=sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970 + # via -r tools/base/requirements.in +charset-normalizer==2.1.1 \ + --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 \ + --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f + # via + # -r tools/base/requirements.in + # requests +exceptiongroup==1.1.3 \ + --hash=sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9 \ + --hash=sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3 + # via -r tools/base/requirements.in +execnet==2.0.2 \ + --hash=sha256:88256416ae766bc9e8895c76a87928c0012183da3cc4fc18016e6f050e025f41 \ + --hash=sha256:cc59bc4423742fd71ad227122eb0dd44db51efb3dc4095b45ac9a08c770096af + # via + # -r tools/base/requirements.in + # pytest-xdist +flake8==6.1.0 \ + --hash=sha256:d5b3857f07c030bdb5bf41c7f53799571d75c4491748a3adcd47de929e34cd23 \ + --hash=sha256:ffdfce58ea94c6580c77888a86506937f9a1a227dfcd15f245d694ae20a6b6e5 + # via + # -r tools/base/requirements.in + # flake8-docstrings +flake8-docstrings==1.7.0 \ + --hash=sha256:4c8cc748dc16e6869728699e5d0d685da9a10b0ea718e090b1ba088e67a941af \ + --hash=sha256:51f2344026da083fc084166a9353f5082b01f72901df422f74b4d953ae88ac75 + # via -r tools/base/requirements.in +idna==3.4 \ + --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ + --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 + # via + # -r tools/base/requirements.in + # requests +importlib-metadata==6.8.0 \ + --hash=sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb \ + --hash=sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743 + # via + # -r tools/base/requirements.in + # yapf +iniconfig==2.0.0 \ + --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ + --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 + # via + # -r tools/base/requirements.in + # pytest +mccabe==0.7.0 \ + --hash=sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325 \ + --hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e + # via + # -r tools/base/requirements.in + # flake8 +more-itertools==10.1.0 \ + --hash=sha256:626c369fa0eb37bac0291bce8259b332fd59ac792fa5497b59837309cd5b114a \ + --hash=sha256:64e0735fcfdc6f3464ea133afe8ea4483b1c5fe3a3d69852e6503b43a0b222e6 + # via -r tools/base/requirements.in +packaging==23.2 \ + --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ + --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 + # via + # -r tools/base/requirements.in + # pytest +platformdirs==3.11.0 \ + --hash=sha256:cf8ee52a3afdb965072dcc652433e0c7e3e40cf5ea1477cd4b3b1d2eb75495b3 \ + --hash=sha256:e9d171d00af68be50e9202731309c4e658fd8bc76f55c11c7dd760d023bda68e + # via + # -r tools/base/requirements.in + # yapf +pluggy==1.3.0 \ + --hash=sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12 \ + --hash=sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7 + # via + # -r tools/base/requirements.in + # pytest +py==1.11.0 \ + --hash=sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719 \ + --hash=sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378 + # via -r tools/base/requirements.in +pycodestyle==2.11.1 \ + --hash=sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f \ + --hash=sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67 + # via + # -r tools/base/requirements.in + # flake8 +pydocstyle==6.3.0 \ + --hash=sha256:118762d452a49d6b05e194ef344a55822987a462831ade91ec5c06fd2169d019 \ + --hash=sha256:7ce43f0c0ac87b07494eb9c0b462c0b73e6ff276807f204d6b53edc72b7e44e1 + # via + # -r tools/base/requirements.in + # flake8-docstrings +pyflakes==3.1.0 \ + --hash=sha256:4132f6d49cb4dae6819e5379898f2b8cce3c5f23994194c24b77d5da2e36f774 \ + --hash=sha256:a0aae034c444db0071aa077972ba4768d40c830d9539fd45bf4cd3f8f6992efc + # via + # -r tools/base/requirements.in + # flake8 +pyparsing==3.1.1 \ + --hash=sha256:32c7c0b711493c72ff18a981d24f28aaf9c1fb7ed5e9667c9e84e3db623bdbfb \ + --hash=sha256:ede28a1a32462f5a9705e07aea48001a08f7cf81a021585011deba701581a0db + # via -r tools/base/requirements.in +pytest==7.4.2 \ + --hash=sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002 \ + --hash=sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069 + # via + # -r tools/base/requirements.in + # pytest-dependency + # pytest-xdist +pytest-dependency==0.5.1 \ + --hash=sha256:c2a892906192663f85030a6ab91304e508e546cddfe557d692d61ec57a1d946b + # via -r tools/base/requirements.in +pytest-xdist==3.3.1 \ + --hash=sha256:d5ee0520eb1b7bcca50a60a518ab7a7707992812c578198f8b44fdfac78e8c93 \ + --hash=sha256:ff9daa7793569e6a68544850fd3927cd257cc03a7ef76c95e86915355e82b5f2 + # via -r tools/base/requirements.in +pyyaml==6.0.1 \ + --hash=sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5 \ + --hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \ + --hash=sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df \ + --hash=sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741 \ + --hash=sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206 \ + --hash=sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27 \ + --hash=sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595 \ + --hash=sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62 \ + --hash=sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98 \ + --hash=sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696 \ + --hash=sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290 \ + --hash=sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9 \ + --hash=sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d \ + --hash=sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6 \ + --hash=sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867 \ + --hash=sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47 \ + --hash=sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486 \ + --hash=sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6 \ + --hash=sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3 \ + --hash=sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007 \ + --hash=sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938 \ + --hash=sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0 \ + --hash=sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c \ + --hash=sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735 \ + --hash=sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d \ + --hash=sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28 \ + --hash=sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4 \ + --hash=sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba \ + --hash=sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8 \ + --hash=sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5 \ + --hash=sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd \ + --hash=sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3 \ + --hash=sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0 \ + --hash=sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515 \ + --hash=sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c \ + --hash=sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c \ + --hash=sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924 \ + --hash=sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34 \ + --hash=sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43 \ + --hash=sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859 \ + --hash=sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673 \ + --hash=sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54 \ + --hash=sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a \ + --hash=sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b \ + --hash=sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab \ + --hash=sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa \ + --hash=sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c \ + --hash=sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585 \ + --hash=sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d \ + --hash=sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f + # via -r tools/base/requirements.in +requests==2.31.0 \ + --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ + --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 + # via -r tools/base/requirements.in +six==1.16.0 \ + --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ + --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 + # via -r tools/base/requirements.in +snowballstemmer==2.2.0 \ + --hash=sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1 \ + --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a + # via + # -r tools/base/requirements.in + # pydocstyle +tomli==2.0.1 \ + --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ + --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f + # via + # -r tools/base/requirements.in + # yapf +urllib3==2.0.7 \ + --hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \ + --hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e + # via + # -r tools/base/requirements.in + # requests +yapf==0.40.2 \ + --hash=sha256:4dab8a5ed7134e26d57c1647c7483afb3f136878b579062b786c9ba16b94637b \ + --hash=sha256:adc8b5dd02c0143108878c499284205adb258aad6db6634e5b869e7ee2bd548b + # via -r tools/base/requirements.in +zipp==3.17.0 \ + --hash=sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31 \ + --hash=sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0 + # via + # -r tools/base/requirements.in + # importlib-metadata From 3aaee55705ccee548ff193a7559e931d651d6dc7 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Tue, 24 Oct 2023 20:05:57 +0000 Subject: [PATCH 17/22] Unlocking the Docker image. Signed-off-by: Jakub Sobon --- .bazelrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.bazelrc b/.bazelrc index 8d17d3216..9f4b89fd3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -366,8 +366,7 @@ build:compile-time-options --@envoy//source/extensions/filters/http/kill_request # Docker sandbox # NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/main/toolchains/rbe_toolchains_config.bzl#L8 -# TODO(#1032): Change to the latest. Don't update the hash until the bug is fixed. # unique -build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:94e5d873c145ae86f205117e76276161c9af4806@sha256:8d3763e19d5b71fdc95666d75073ce4581e566ce28ca09106607b6a3ef7ba902 +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:fdd65c6270a8507a18d5acd6cf19a18cb695e4fa@sha256:3c8a3ce6f90dcfb5d09dc8f79bb01404d3526d420061f9a176e0a8e91e1e573e build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker @@ -527,8 +526,7 @@ build:rbe-envoy-engflow --grpc_keepalive_time=30s build:rbe-envoy-engflow --remote_timeout=3600s build:rbe-envoy-engflow --bes_timeout=3600s build:rbe-envoy-engflow --bes_upload_mode=fully_async -# TODO(#1032): Change to the latest. Don't update the hash until the bug is fixed. # unique -build:rbe-envoy-engflow --remote_default_exec_properties=container-image=docker://docker.io/envoyproxy/envoy-build-ubuntu:94e5d873c145ae86f205117e76276161c9af4806@sha256:8d3763e19d5b71fdc95666d75073ce4581e566ce28ca09106607b6a3ef7ba902 +build:rbe-envoy-engflow --remote_default_exec_properties=container-image=docker://docker.io/envoyproxy/envoy-build-ubuntu:fdd65c6270a8507a18d5acd6cf19a18cb695e4fa@sha256:3c8a3ce6f90dcfb5d09dc8f79bb01404d3526d420061f9a176e0a8e91e1e573e ############################################################################# # debug: Various Bazel debugging flags From 7a4ba33b9964edf964fa80f57ecb4e96200c30ca Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Wed, 25 Oct 2023 17:37:35 +0000 Subject: [PATCH 18/22] Fixing imports of TextFormat. Signed-off-by: Jakub Sobon --- test/benchmark_http_client_test.cc | 2 +- test/output_collector_test.cc | 2 +- test/output_formatter_test.cc | 21 ++++++++++--------- test/process_test.cc | 2 +- .../fake_user_defined_output_test.cc | 2 +- .../log_response_headers_plugin_test.cc | 2 +- ...user_defined_output_plugin_creator_test.cc | 2 +- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/test/benchmark_http_client_test.cc b/test/benchmark_http_client_test.cc index c4afbbf92..096ae7dad 100644 --- a/test/benchmark_http_client_test.cc +++ b/test/benchmark_http_client_test.cc @@ -34,7 +34,7 @@ namespace Nighthawk { namespace { using ::envoy::config::core::v3::TypedExtensionConfig; -using ::proto2::TextFormat; +using ::Envoy::Protobuf::TextFormat; // Helper function to get headers in a set that should be verified during the test. std::string getPathFromRequest(const Envoy::Http::RequestHeaderMap& header) { diff --git a/test/output_collector_test.cc b/test/output_collector_test.cc index d15af846e..66abe1fd7 100644 --- a/test/output_collector_test.cc +++ b/test/output_collector_test.cc @@ -15,8 +15,8 @@ namespace Nighthawk { namespace Client { namespace { +using ::Envoy::Protobuf::TextFormat; using ::nighthawk::client::UserDefinedOutput; -using ::proto2::TextFormat; class OutputCollectorTest : public Test, public Envoy::Event::TestUsingSimulatedTime { public: diff --git a/test/output_formatter_test.cc b/test/output_formatter_test.cc index 2d024ed33..8ccf845bb 100644 --- a/test/output_formatter_test.cc +++ b/test/output_formatter_test.cc @@ -29,6 +29,7 @@ using namespace testing; namespace Nighthawk { namespace Client { +using ::Envoy::Protobuf::TextFormat; using ::nighthawk::client::Protocol; class OutputCollectorTest : public Test { @@ -116,9 +117,9 @@ TEST_F(OutputCollectorTest, JsonFormatter) { EXPECT_EQ((formatter.formatProto(collector_->toProto())).ok(), true); std::string expected_str = readGoldFile("test/test_data/output_formatter.json.gold"); nighthawk::client::Output expected_output_proto, output_proto; - proto2::TextFormat::ParseFromString(expected_str, &expected_output_proto); - proto2::TextFormat::ParseFromString((formatter.formatProto(collector_->toProto())).value(), - &output_proto); + TextFormat::ParseFromString(expected_str, &expected_output_proto); + TextFormat::ParseFromString((formatter.formatProto(collector_->toProto())).value(), + &output_proto); EXPECT_THAT(output_proto, EqualsProto(expected_output_proto)); } @@ -127,9 +128,9 @@ TEST_F(OutputCollectorTest, YamlFormatter) { EXPECT_EQ((formatter.formatProto(collector_->toProto())).ok(), true); std::string expected_str = readGoldFile("test/test_data/output_formatter.yaml.gold"); nighthawk::client::Output expected_output_proto, output_proto; - proto2::TextFormat::ParseFromString(expected_str, &expected_output_proto); - proto2::TextFormat::ParseFromString((formatter.formatProto(collector_->toProto())).value(), - &output_proto); + TextFormat::ParseFromString(expected_str, &expected_output_proto); + TextFormat::ParseFromString((formatter.formatProto(collector_->toProto())).value(), + &output_proto); EXPECT_THAT(output_proto, EqualsProto(expected_output_proto)); } @@ -226,9 +227,9 @@ TEST_F(MediumOutputCollectorTest, FortioFormatter) { loadProtoFromFile("test/test_data/output_formatter.medium.proto.gold"); std::string expected_str = readGoldFile("test/test_data/output_formatter.medium.fortio.gold"); nighthawk::client::Output expected_output_proto, output_proto; - proto2::TextFormat::ParseFromString(expected_str, &expected_output_proto); + TextFormat::ParseFromString(expected_str, &expected_output_proto); FortioOutputFormatterImpl formatter; - proto2::TextFormat::ParseFromString((formatter.formatProto(input_proto)).value(), &output_proto); + TextFormat::ParseFromString((formatter.formatProto(input_proto)).value(), &output_proto); EXPECT_THAT(output_proto, EqualsProto(expected_output_proto)); } @@ -287,9 +288,9 @@ TEST_F(MediumOutputCollectorTest, FortioPedanticFormatter) { std::string expected_str = readGoldFile("test/test_data/output_formatter.medium.fortio-noquirks.gold"); nighthawk::client::Output expected_output_proto, output_proto; - proto2::TextFormat::ParseFromString(expected_str, &expected_output_proto); + TextFormat::ParseFromString(expected_str, &expected_output_proto); FortioPedanticOutputFormatterImpl formatter; - proto2::TextFormat::ParseFromString((formatter.formatProto(input_proto)).value(), &output_proto); + TextFormat::ParseFromString((formatter.formatProto(input_proto)).value(), &output_proto); EXPECT_THAT(output_proto, EqualsProto(expected_output_proto)); } diff --git a/test/process_test.cc b/test/process_test.cc index e78b16c00..21074c84c 100644 --- a/test/process_test.cc +++ b/test/process_test.cc @@ -30,7 +30,7 @@ namespace Client { namespace { using ::envoy::config::core::v3::TypedExtensionConfig; -using ::proto2::TextFormat; +using ::Envoy::Protobuf::TextFormat; using ::testing::HasSubstr; using ::testing::TestWithParam; using ::testing::ValuesIn; diff --git a/test/user_defined_output/fake_plugin/fake_user_defined_output_test.cc b/test/user_defined_output/fake_plugin/fake_user_defined_output_test.cc index 710c4f279..e231f96a4 100644 --- a/test/user_defined_output/fake_plugin/fake_user_defined_output_test.cc +++ b/test/user_defined_output/fake_plugin/fake_user_defined_output_test.cc @@ -19,9 +19,9 @@ namespace Nighthawk { namespace { using ::Envoy::Http::TestResponseHeaderMapImpl; +using ::Envoy::Protobuf::TextFormat; using ::nighthawk::FakeUserDefinedOutput; using ::nighthawk::FakeUserDefinedOutputConfig; -using ::proto2::TextFormat; using ::testing::HasSubstr; absl::StatusOr CreatePlugin(const std::string& config_textproto, diff --git a/test/user_defined_output/log_response_headers_plugin_test.cc b/test/user_defined_output/log_response_headers_plugin_test.cc index 54344306d..cca349356 100644 --- a/test/user_defined_output/log_response_headers_plugin_test.cc +++ b/test/user_defined_output/log_response_headers_plugin_test.cc @@ -22,9 +22,9 @@ namespace { using ::Envoy::Http::HeaderEntry; using ::Envoy::Http::TestResponseHeaderMapImpl; +using ::Envoy::Protobuf::TextFormat; using ::nighthawk::LogResponseHeadersConfig; using ::nighthawk::LogResponseHeadersOutput; -using ::proto2::TextFormat; using ::testing::HasSubstr; // Fake Header Logger to enable testing of LogResponseHeadersPlugin. Keeps track of logged headers. diff --git a/test/user_defined_output/user_defined_output_plugin_creator_test.cc b/test/user_defined_output/user_defined_output_plugin_creator_test.cc index 0f9695983..5464d694e 100644 --- a/test/user_defined_output/user_defined_output_plugin_creator_test.cc +++ b/test/user_defined_output/user_defined_output_plugin_creator_test.cc @@ -15,9 +15,9 @@ namespace Nighthawk { namespace { using ::envoy::config::core::v3::TypedExtensionConfig; +using ::Envoy::Protobuf::TextFormat; using ::nighthawk::FakeUserDefinedOutputConfig; using ::nighthawk::LogResponseHeadersConfig; -using ::proto2::TextFormat; using ::testing::HasSubstr; UserDefinedOutputConfigFactoryPair From b1d72a461fccb84ab80203e8a6261ae10d36cc09 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Wed, 25 Oct 2023 17:38:59 +0000 Subject: [PATCH 19/22] Remove clang-tidy from CI. Signed-off-by: Jakub Sobon --- .azure-pipelines/pipelines.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.azure-pipelines/pipelines.yml b/.azure-pipelines/pipelines.yml index a0a3bbe62..0e819d825 100644 --- a/.azure-pipelines/pipelines.yml +++ b/.azure-pipelines/pipelines.yml @@ -44,23 +44,6 @@ stages: parameters: ciTarget: $(CI_TARGET) -- stage: clang_tidy - dependsOn: ["check"] - pool: "envoy-x64-large" - jobs: - - job: clang_tidy - displayName: "do_ci.sh" - strategy: - maxParallel: 1 - matrix: - clang_tidy: - CI_TARGET: "clang_tidy" - timeoutInMinutes: 120 - steps: - - template: bazel.yml - parameters: - ciTarget: $(CI_TARGET) - - stage: test_gcc dependsOn: ["check"] pool: "envoy-x64-large" @@ -124,7 +107,6 @@ stages: # reported by https://github.com/envoyproxy/nighthawk/issues/1006 - stage: release dependsOn: - - "clang_tidy" - "test_gcc" - "sanitizers" - "coverage_unit" From 5641a2db4b926c7e18f5d80ce59e0ff596e6c0bb Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Thu, 26 Oct 2023 20:12:13 +0000 Subject: [PATCH 20/22] Make the formatting chwck mandatory again. Signed-off-by: Jakub Sobon --- ci/do_ci.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index a7246f701..b8fb9340c 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -220,8 +220,6 @@ function do_benchmark_with_own_binaries() { } function do_check_format() { - # TODO(1032): Remove this once all files are formatted correctly. - set +eo pipefail echo "check_format..." cd "${SRCDIR}" ./tools/check_format.sh check From abdc5c8bb04706b9be4e051254e4e56d28fc1b24 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Thu, 26 Oct 2023 20:16:27 +0000 Subject: [PATCH 21/22] We don't want to delete this file in this PR. Signed-off-by: Jakub Sobon --- tools/requirements.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tools/requirements.txt diff --git a/tools/requirements.txt b/tools/requirements.txt new file mode 100644 index 000000000..f1d27c321 --- /dev/null +++ b/tools/requirements.txt @@ -0,0 +1,3 @@ +flake8==3.8.3 +yapf==0.30.0 +flake8-docstrings==1.5.0 From 78338dca6de640193a4ea395ed2052c832397ea8 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Fri, 27 Oct 2023 15:53:18 +0000 Subject: [PATCH 22/22] Removed duplicate "#pragma once" entries. Signed-off-by: Jakub Sobon --- include/nighthawk/adaptive_load/input_variable_setter.h | 2 -- include/nighthawk/adaptive_load/metrics_plugin.h | 2 -- include/nighthawk/adaptive_load/scoring_function.h | 2 -- include/nighthawk/adaptive_load/step_controller.h | 2 -- source/adaptive_load/scoring_function_impl.h | 1 - source/client/flush_worker_impl.h | 1 - source/request_source/request_options_list_plugin_impl.h | 1 - test/request_source/stub_plugin_impl.h | 1 - 8 files changed, 12 deletions(-) diff --git a/include/nighthawk/adaptive_load/input_variable_setter.h b/include/nighthawk/adaptive_load/input_variable_setter.h index a090ac403..aec49dfd5 100644 --- a/include/nighthawk/adaptive_load/input_variable_setter.h +++ b/include/nighthawk/adaptive_load/input_variable_setter.h @@ -2,8 +2,6 @@ // Interfaces for InputVariableSetter plugins and plugin factories. -#pragma once - #include "envoy/common/pure.h" #include "envoy/config/typed_config.h" diff --git a/include/nighthawk/adaptive_load/metrics_plugin.h b/include/nighthawk/adaptive_load/metrics_plugin.h index 654e659a6..4e0ba43ed 100644 --- a/include/nighthawk/adaptive_load/metrics_plugin.h +++ b/include/nighthawk/adaptive_load/metrics_plugin.h @@ -2,8 +2,6 @@ // Interfaces for MetricsPlugin plugins and plugin factories. -#pragma once - #include "envoy/common/pure.h" #include "envoy/config/typed_config.h" diff --git a/include/nighthawk/adaptive_load/scoring_function.h b/include/nighthawk/adaptive_load/scoring_function.h index 8e0c6468b..da9f18931 100644 --- a/include/nighthawk/adaptive_load/scoring_function.h +++ b/include/nighthawk/adaptive_load/scoring_function.h @@ -2,8 +2,6 @@ // Interfaces for ScoringFunction plugins and plugin factories. -#pragma once - #include "envoy/common/pure.h" #include "envoy/config/typed_config.h" diff --git a/include/nighthawk/adaptive_load/step_controller.h b/include/nighthawk/adaptive_load/step_controller.h index 8e679126f..1d33b531e 100644 --- a/include/nighthawk/adaptive_load/step_controller.h +++ b/include/nighthawk/adaptive_load/step_controller.h @@ -2,8 +2,6 @@ // Interfaces for StepController plugins and plugin factories. -#pragma once - #include "envoy/common/pure.h" #include "envoy/config/typed_config.h" diff --git a/source/adaptive_load/scoring_function_impl.h b/source/adaptive_load/scoring_function_impl.h index e1fabbfbd..05f69d9db 100644 --- a/source/adaptive_load/scoring_function_impl.h +++ b/source/adaptive_load/scoring_function_impl.h @@ -1,7 +1,6 @@ #pragma once // Implementations of ScoringFunction plugins and corresponding factories. -#pragma once #include "envoy/registry/registry.h" diff --git a/source/client/flush_worker_impl.h b/source/client/flush_worker_impl.h index e40f2b95e..48b08118a 100644 --- a/source/client/flush_worker_impl.h +++ b/source/client/flush_worker_impl.h @@ -2,7 +2,6 @@ // Flush worker implementation. Flush worker periodically flushes metrics // snapshot to all configured stats sinks in Nighthawk. -#pragma once #include diff --git a/source/request_source/request_options_list_plugin_impl.h b/source/request_source/request_options_list_plugin_impl.h index 92a2ff7c2..155e82500 100644 --- a/source/request_source/request_options_list_plugin_impl.h +++ b/source/request_source/request_options_list_plugin_impl.h @@ -1,7 +1,6 @@ #pragma once // Implementations of RequestSourceConfigFactories that make a OptionsListRequestSource. -#pragma once #include "envoy/registry/registry.h" diff --git a/test/request_source/stub_plugin_impl.h b/test/request_source/stub_plugin_impl.h index 6cce371c3..f9cbed71c 100644 --- a/test/request_source/stub_plugin_impl.h +++ b/test/request_source/stub_plugin_impl.h @@ -2,7 +2,6 @@ // Test implementations of RequestSourceConfigFactory and RequestSource that perform minimum // functionality for testing purposes. -#pragma once #include "envoy/registry/registry.h"