Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Qin Qin <qqin@google.com>
  • Loading branch information
qqustc committed Nov 30, 2020
1 parent 7ca49c2 commit d3e0546
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/extensions/all_extensions.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@bazel_skylib//lib:dicts.bzl", "dicts")
load("@envoy_build_config//:extensions_build_config.bzl", "DISABLED_BY_DEFAULT_EXTENSIONS", "EXTENSIONS")

GLOBAL_DENYLIST = [k for k, v in DISABLED_BY_DEFAULT_EXTENSIONS.items()]
GLOBAL_DENYLIST = [k for k in DISABLED_BY_DEFAULT_EXTENSIONS.keys()]

# These extensions are registered using the extension system but are required for the core Envoy build.
# The map may be overridden by extensions specified in envoy_build_config.
Expand Down
15 changes: 9 additions & 6 deletions test/extensions/extensions_build_system.bzl
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
load("//bazel:envoy_build_system.bzl", "envoy_benchmark_test", "envoy_cc_benchmark_binary", "envoy_cc_mock", "envoy_cc_test", "envoy_cc_test_binary", "envoy_cc_test_library")
load("@envoy_build_config//:extensions_build_config.bzl", "DISABLED_BY_DEFAULT_EXTENSIONS", "EXTENSIONS")

def extension_allowed_for_test(extension_name):
return extension_name in EXTENSIONS or extension_name in DISABLED_BY_DEFAULT_EXTENSIONS

# All extension tests should use this version of envoy_cc_test(). It allows compiling out
# tests for extensions that the user does not wish to include in their build.
# @param extension_name should match an extension listed in EXTENSIONS or DISABLED_BY_DEFAULT_EXTENSIONS.
def envoy_extension_cc_test(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
if not extension_allowed_for_test(extension_name):
return

envoy_cc_test(name, **kwargs)
Expand All @@ -17,7 +20,7 @@ def envoy_extension_cc_test_library(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
if not extension_allowed_for_test(extension_name):
return

envoy_cc_test_library(name, **kwargs)
Expand All @@ -26,7 +29,7 @@ def envoy_extension_cc_mock(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
if not extension_allowed_for_test(extension_name):
return

envoy_cc_mock(name, **kwargs)
Expand All @@ -35,7 +38,7 @@ def envoy_extension_cc_test_binary(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
if not extension_allowed_for_test(extension_name):
return

envoy_cc_test_binary(name, **kwargs)
Expand All @@ -44,7 +47,7 @@ def envoy_extension_cc_benchmark_binary(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
if not extension_allowed_for_test(extension_name):
return

envoy_cc_benchmark_binary(name, **kwargs)
Expand All @@ -53,7 +56,7 @@ def envoy_extension_benchmark_test(
name,
extension_name,
**kwargs):
if not extension_name in EXTENSIONS and not extension_name in DISABLED_BY_DEFAULT_EXTENSIONS:
if not extension_allowed_for_test(extension_name):
return

envoy_benchmark_test(name, **kwargs)

0 comments on commit d3e0546

Please sign in to comment.