diff --git a/.github/workflows/run-end-to-end.yml b/.github/workflows/run-end-to-end.yml index 2996367bd00..54cbfb12948 100644 --- a/.github/workflows/run-end-to-end.yml +++ b/.github/workflows/run-end-to-end.yml @@ -113,6 +113,9 @@ jobs: - 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_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 diff --git a/manifests/php.yml b/manifests/php.yml index 0120cffa176..fd45bc8f330 100644 --- a/manifests/php.yml +++ b/manifests/php.yml @@ -263,6 +263,7 @@ tests/: test_telemetry.py: Test_TelemetryMetrics: missing_feature test_asm_standalone.py: + Test_AppSecStandalone_NotEnabled: v1.6.2 Test_AppSecStandalone_UpstreamPropagation: v1.6.0 Test_AppSecStandalone_UpstreamPropagation_V2: missing_feature Test_IastStandalone_UpstreamPropagation: missing_feature diff --git a/tests/appsec/test_asm_standalone.py b/tests/appsec/test_asm_standalone.py index ed4558533f2..cc00b04c3ad 100644 --- a/tests/appsec/test_asm_standalone.py +++ b/tests/appsec/test_asm_standalone.py @@ -740,6 +740,32 @@ def test_app_dependencies_loaded(self): raise Exception(dependency + " not received in app-dependencies-loaded message") +@rfc("https://docs.google.com/document/d/12NBx-nD-IoQEMiCRnJXneq4Be7cbtSc6pJLOFUWTpNE/edit") +@features.appsec_standalone +@scenarios.appsec_no_stats +class Test_AppSecStandalone_NotEnabled: + """Test expected behaviour when standalone is not enabled.""" + + def setup_client_computed_stats_header_is_not_present(self): + trace_id = 1212121212121212122 + parent_id = 34343434 + self.r = weblog.get( + "/", + headers={ + "x-datadog-trace-id": str(trace_id), + "x-datadog-parent-id": str(parent_id), + }, + ) + + def test_client_computed_stats_header_is_not_present(self): + spans_checked = 0 + for data, _, span in interfaces.library.get_spans(request=self.r): + assert span["trace_id"] == 1212121212121212122 + assert "datadog-client-computed-stats" not in [x.lower() for x, y in data["request"]["headers"]] + spans_checked += 1 + assert spans_checked == 1 + + @rfc("https://docs.google.com/document/d/12NBx-nD-IoQEMiCRnJXneq4Be7cbtSc6pJLOFUWTpNE/edit") @features.appsec_standalone @scenarios.appsec_standalone diff --git a/utils/_context/_scenarios/__init__.py b/utils/_context/_scenarios/__init__.py index e1a86243b8a..7c0911e1219 100644 --- a/utils/_context/_scenarios/__init__.py +++ b/utils/_context/_scenarios/__init__.py @@ -64,6 +64,15 @@ class _Scenarios: profiling = ProfilingScenario("PROFILING") + appsec_no_stats = EndToEndScenario( + "End to end tests with default value of DD_TRACE_COMPUTE_STATS", + doc=( + "End to end testing with default values. Default scenario has DD_TRACE_COMPUTE_STATS=true." + "This scenario let that env to use its default" + ), + scenario_groups=[ScenarioGroup.APPSEC], + ) + sampling = EndToEndScenario( "SAMPLING", tracer_sampling_rate=0.5,