Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone billing features, scenarios and tests reorg #4216

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/run-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,24 @@ jobs:
- name: Run APPSEC_STANDALONE scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_STANDALONE"')
run: ./run.sh APPSEC_STANDALONE
- name: Run APPSEC_STANDALONE_V2 scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_STANDALONE_V2"')
run: ./run.sh APPSEC_STANDALONE_V2
- name: Run APPSEC_STANDALONE_EXPERIMENTAL scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_STANDALONE_EXPERIMENTAL"')
run: ./run.sh APPSEC_STANDALONE_EXPERIMENTAL
- name: Run APPSEC_NO_STATS scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"APPSEC_NO_STATS"')
run: ./run.sh APPSEC_NO_STATS
- name: Run IAST_STANDALONE scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IAST_STANDALONE"')
run: ./run.sh IAST_STANDALONE
- name: Run IAST_STANDALONE_V2 scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IAST_STANDALONE_V2"')
run: ./run.sh IAST_STANDALONE_V2
- name: Run IAST_STANDALONE_EXPERIMENTAL scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IAST_STANDALONE_EXPERIMENTAL"')
run: ./run.sh IAST_STANDALONE_EXPERIMENTAL
- name: Run SCA_STANDALONE scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"SCA_STANDALONE"')
run: ./run.sh SCA_STANDALONE
- name: Run SCA_STANDALONE_V2 scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"SCA_STANDALONE_V2"')
run: ./run.sh SCA_STANDALONE_V2
- name: Run SCA_STANDALONE_EXPERIMENTAL scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"SCA_STANDALONE_EXPERIMENTAL"')
run: ./run.sh SCA_STANDALONE_EXPERIMENTAL
- name: Run IAST_DEDUPLICATION scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IAST_DEDUPLICATION"')
run: ./run.sh IAST_DEDUPLICATION
Expand Down
1 change: 1 addition & 0 deletions manifests/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ tests/:
Test_Parametric_DDTrace_Current_Span: incomplete_test_app (current_span endpoint is not implemented)
Test_Parametric_DDTrace_Extract_Headers: v1.0.1.dev
# cpp tracer does not support the OpenTelemetry API, otel parametric endpoints are not implemented

Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one also (./format.sh)

Test_Parametric_OtelSpan_End: missing_feature (otel api is not supported)
Test_Parametric_OtelSpan_Events: missing_feature (otel api is not supported)
Test_Parametric_OtelSpan_Is_Recording: missing_feature (otel api is not supported)
Expand Down
1 change: 1 addition & 0 deletions manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ tests/:
'*': v1.45.0
spring-boot-3-native: missing_feature (GraalVM. Tracing support only)
# SQLi was introduced in v1.38.0 (with RASP disabled by default, but was flaky)

Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's from the linter...

test_sqli.py:
Test_Sqli_BodyJson:
'*': v1.39.0
Expand Down
24 changes: 12 additions & 12 deletions tests/appsec/test_asm_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,8 @@ def test_client_computed_stats_header_is_not_present(self):


@rfc("https://docs.google.com/document/d/12NBx-nD-IoQEMiCRnJXneq4Be7cbtSc6pJLOFUWTpNE/edit")
@features.appsec_standalone
@scenarios.appsec_standalone
@features.appsec_standalone_experimental
@scenarios.appsec_standalone_experimental
@irrelevant(context.library > "[email protected]", reason="V2 is implemented for newer versions")
class Test_AppSecStandalone_UpstreamPropagation(AppSecStandalone_UpstreamPropagation_Base):
"""APPSEC correctly propagates AppSec events in distributing tracing with DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED=true."""
Expand All @@ -781,8 +781,8 @@ def propagated_tag_value(self):


@rfc("https://docs.google.com/document/d/12NBx-nD-IoQEMiCRnJXneq4Be7cbtSc6pJLOFUWTpNE/edit")
@features.appsec_standalone_v2
@scenarios.appsec_standalone_v2
@features.appsec_standalone
@scenarios.appsec_standalone
class Test_AppSecStandalone_UpstreamPropagation_V2(AppSecStandalone_UpstreamPropagation_Base):
"""APPSEC correctly propagates AppSec events in distributing tracing with DD_APM_TRACING_ENABLED=false."""

Expand All @@ -794,8 +794,8 @@ def propagated_tag_value(self):


@rfc("https://docs.google.com/document/d/12NBx-nD-IoQEMiCRnJXneq4Be7cbtSc6pJLOFUWTpNE/edit")
@features.iast_standalone
@scenarios.iast_standalone
@features.iast_standalone_experimental
@scenarios.iast_standalone_experimental
@irrelevant(context.library > "[email protected]", reason="V2 is implemented for newer versions")
class Test_IastStandalone_UpstreamPropagation(IastStandalone_UpstreamPropagation_Base):
"""IAST correctly propagates AppSec events in distributing tracing with DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED=true."""
Expand All @@ -808,8 +808,8 @@ def propagated_tag_value(self):


@rfc("https://docs.google.com/document/d/12NBx-nD-IoQEMiCRnJXneq4Be7cbtSc6pJLOFUWTpNE/edit")
@features.iast_standalone_v2
@scenarios.iast_standalone_v2
@features.iast_standalone
@scenarios.iast_standalone
class Test_IastStandalone_UpstreamPropagation_V2(IastStandalone_UpstreamPropagation_Base):
"""IAST correctly propagates AppSec events in distributing tracing with DD_APM_TRACING_ENABLED=false."""

Expand All @@ -821,8 +821,8 @@ def propagated_tag_value(self):


@rfc("https://docs.google.com/document/d/12NBx-nD-IoQEMiCRnJXneq4Be7cbtSc6pJLOFUWTpNE/edit")
@features.sca_standalone
@scenarios.sca_standalone
@features.sca_standalone_experimental
@scenarios.sca_standalone_experimental
@irrelevant(context.library > "[email protected]", reason="V2 is implemented for newer versions")
class Test_SCAStandalone_Telemetry(SCAStandalone_Telemetry_Base):
"""Tracer correctly propagates SCA telemetry in distributing tracing with DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED=true."""
Expand All @@ -835,8 +835,8 @@ def propagated_tag_value(self):


@rfc("https://docs.google.com/document/d/12NBx-nD-IoQEMiCRnJXneq4Be7cbtSc6pJLOFUWTpNE/edit")
@features.sca_standalone_v2
@scenarios.sca_standalone_v2
@features.sca_standalone
@scenarios.sca_standalone
class Test_SCAStandalone_Telemetry_V2(SCAStandalone_Telemetry_Base):
"""Tracer correctly propagates SCA telemetry in distributing tracing with DD_APM_TRACING_ENABLED=false."""

Expand Down
24 changes: 12 additions & 12 deletions utils/_context/_scenarios/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,18 @@ class _Scenarios:
"APPSEC_STANDALONE",
weblog_env={
"DD_APPSEC_ENABLED": "true",
"DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED": "true",
"DD_APM_TRACING_ENABLED": "false",
"DD_IAST_ENABLED": "false",
},
doc="Appsec standalone mode (APM opt out)",
scenario_groups=[ScenarioGroup.APPSEC],
)

appsec_standalone_v2 = EndToEndScenario(
"APPSEC_STANDALONE_V2",
appsec_standalone_experimental = EndToEndScenario(
"APPSEC_STANDALONE_EXPERIMENTAL",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Renaming scenario is dangerous, you need to crawl all CI to verify that they do not refer to it, and update them if needed.

Two good enough solution for that issue :

  • do not rename scenarios : it's just names
  • rename, but handle in run.sh legacy names , see line 378

weblog_env={
"DD_APPSEC_ENABLED": "true",
"DD_APM_TRACING_ENABLED": "false",
"DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED": "true",
"DD_IAST_ENABLED": "false",
},
doc="Appsec standalone mode (APM opt out) V2",
Expand All @@ -359,7 +359,7 @@ class _Scenarios:
"IAST_STANDALONE",
weblog_env={
"DD_APPSEC_ENABLED": "false",
"DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED": "true",
"DD_APM_TRACING_ENABLED": "false",
"DD_IAST_ENABLED": "true",
"DD_IAST_DETECTION_MODE": "FULL",
"DD_IAST_DEDUPLICATION_ENABLED": "false",
Expand All @@ -369,11 +369,11 @@ class _Scenarios:
scenario_groups=[ScenarioGroup.APPSEC],
)

iast_standalone_v2 = EndToEndScenario(
"IAST_STANDALONE_V2",
iast_standalone_experimental = EndToEndScenario(
"IAST_STANDALONE_EXPERIMENTAL",
weblog_env={
"DD_APPSEC_ENABLED": "false",
"DD_APM_TRACING_ENABLED": "false",
"DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED": "true",
"DD_IAST_ENABLED": "true",
"DD_IAST_DETECTION_MODE": "FULL",
"DD_IAST_DEDUPLICATION_ENABLED": "false",
Expand All @@ -388,20 +388,20 @@ class _Scenarios:
weblog_env={
"DD_APPSEC_ENABLED": "false",
"DD_APPSEC_SCA_ENABLED": "true",
"DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED": "true",
"DD_APM_TRACING_ENABLED": "false",
"DD_IAST_ENABLED": "false",
"DD_TELEMETRY_DEPENDENCY_RESOLUTION_PERIOD_MILLIS": "1",
},
doc="SCA standalone mode (APM opt out)",
scenario_groups=[ScenarioGroup.APPSEC],
)

sca_standalone_v2 = EndToEndScenario(
"SCA_STANDALONE_V2",
sca_standalone_experimental = EndToEndScenario(
"SCA_STANDALONE_EXPERIMENTAL",
weblog_env={
"DD_APPSEC_ENABLED": "false",
"DD_APPSEC_SCA_ENABLED": "true",
"DD_APM_TRACING_ENABLED": "false",
"DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED": "true",
"DD_IAST_ENABLED": "false",
"DD_TELEMETRY_DEPENDENCY_RESOLUTION_PERIOD_MILLIS": "1",
},
Expand Down
20 changes: 10 additions & 10 deletions utils/_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -2020,34 +2020,34 @@ def auto_instrumentation_profiling(test_object):
return test_object

@staticmethod
def appsec_standalone(test_object):
"""Appsec Standalone Billing
def appsec_standalone_experimental(test_object):
"""Experimental Appsec Standalone Billing

https://feature-parity.us1.prod.dog/#/?feature=305
"""
pytest.mark.features(feature_id=305)(test_object)
return test_object

@staticmethod
def appsec_standalone_v2(test_object):
"""Appsec Standalone Billing V2
def appsec_standalone(test_object):
"""Appsec Standalone Billing

https://feature-parity.us1.prod.dog/#/?feature=355
"""
pytest.mark.features(feature_id=355)(test_object)
return test_object

@staticmethod
def iast_standalone(test_object):
"""Iast Standalone Billing
def iast_standalone_experimental(test_object):
"""Experimental Iast Standalone Billing

https://feature-parity.us1.prod.dog/#/?feature=319
"""
pytest.mark.features(feature_id=319)(test_object)
return test_object

@staticmethod
def iast_standalone_v2(test_object):
def iast_standalone(test_object):
"""Iast Standalone Billing V2

https://feature-parity.us1.prod.dog/#/?feature=356
Expand All @@ -2056,16 +2056,16 @@ def iast_standalone_v2(test_object):
return test_object

@staticmethod
def sca_standalone(test_object):
"""SCA Standalone Billing
def sca_standalone_experimental(test_object):
"""Experimental SCA Standalone Billing

https://feature-parity.us1.prod.dog/#/?feature=320
"""
pytest.mark.features(feature_id=320)(test_object)
return test_object

@staticmethod
def sca_standalone_v2(test_object):
def sca_standalone(test_object):
"""SCA Standalone Billing V2

https://feature-parity.us1.prod.dog/#/?feature=357
Expand Down