Skip to content

Commit

Permalink
Merge branch 'main' into ida613/nodejs-baggage
Browse files Browse the repository at this point in the history
  • Loading branch information
ida613 authored Nov 25, 2024
2 parents 55421c4 + 9c26730 commit 5469bd8
Show file tree
Hide file tree
Showing 95 changed files with 1,498 additions and 872 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/run-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ jobs:
- name: Run IAST_STANDALONE scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IAST_STANDALONE"')
run: ./run.sh IAST_STANDALONE
- name: Run SCA_STANDALONE scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"SCA_STANDALONE"')
run: ./run.sh SCA_STANDALONE
- name: Run IAST_DEDUPLICATION scenario
if: always() && steps.build.outcome == 'success' && contains(inputs.scenarios, '"IAST_DEDUPLICATION"')
run: ./run.sh IAST_DEDUPLICATION
Expand Down
30 changes: 18 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ onboarding_nodejs:
extends: .base_job_onboarding_system_tests
stage: nodejs_tracer
allow_failure: true
needs: []
dependencies: []
timeout: 90 minutes
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "nodejs")
when: always
Expand Down Expand Up @@ -79,13 +80,14 @@ onboarding_nodejs:
DEFAULT_VMS: ["True", "False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
- timeout 4800s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}

onboarding_java:
extends: .base_job_onboarding_system_tests
stage: java_tracer
allow_failure: true
needs: []
dependencies: []
timeout: 90 minutes
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "java")
when: always
Expand Down Expand Up @@ -118,12 +120,13 @@ onboarding_java:
DEFAULT_VMS: ["True", "False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
- timeout 4800s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
onboarding_python:
extends: .base_job_onboarding_system_tests
stage: python_tracer
allow_failure: true
needs: []
dependencies: []
timeout: 90 minutes
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "python")
when: always
Expand Down Expand Up @@ -156,13 +159,14 @@ onboarding_python:
DEFAULT_VMS: ["True", "False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
- timeout 4800s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}

onboarding_dotnet:
extends: .base_job_onboarding_system_tests
stage: dotnet_tracer
allow_failure: true
needs: []
dependencies: []
timeout: 90 minutes
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "dotnet")
when: always
Expand Down Expand Up @@ -192,13 +196,14 @@ onboarding_dotnet:
DEFAULT_VMS: ["True", "False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
- timeout 4800s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}

onboarding_ruby:
extends: .base_job_onboarding_system_tests
stage: ruby_tracer
allow_failure: true
needs: []
dependencies: []
timeout: 90 minutes
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "ruby")
when: always
Expand All @@ -224,13 +229,14 @@ onboarding_ruby:
DEFAULT_VMS: ["True", "False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
- timeout 4800s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}

onboarding_php:
extends: .base_job_onboarding_system_tests
stage: php_tracer
allow_failure: true
needs: []
dependencies: []
timeout: 90 minutes
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "php")
when: always
Expand Down Expand Up @@ -259,7 +265,7 @@ onboarding_php:
DEFAULT_VMS: ["True", "False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
- timeout 4800s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}


onboarding_stats_results:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Refer to the [edit docs](docs/edit/README.md).

**[Complete documentation](https://github.com/DataDog/system-tests/blob/main/docs)**

System-tests supports various scenarios for running tests; read more about the different kinds of tests that this repo covers in [scenarios/README.md](scenarios/README.md).
System-tests supports various scenarios for running tests; read more about the different kinds of tests that this repo covers in [scenarios/README.md](docs/scenarios/README.md).

Understand the test architecture at the [architectural overview](https://github.com/DataDog/system-tests/blob/main/docs/architecture/overview.md).

Expand Down
24 changes: 12 additions & 12 deletions docs/edit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ To make changes, you must be able to run tests locally. Instructions for running
You'll commonly need to run unmerged changes to your library against system tests (e.g. to ensure the feature is up to spec). Instructions for testing against unmerged changes can be found in [enable-test.md](./enable-test.md).

## Index
1. [lifecycle.md](./lifecycle.md): Understand how system tests work
2. [add-new-test.md](./add-new-test.md): Add a new test
3. [scenarios.md](./scenarios.md): Add a new scenario
4. [format.md](./format.md): Use the linter
5. [features.md](./features.md): Mark tests for the feature parity dashboard
6. [enable-test.md](./enable-test.md): Enable a test
7. [skip-tests.md](./skip-tests.md): Disable tests
8. [manifest.md](./manifest.md): How tests are marked as enabled or disabled for libraries
9. [features.md](./features.md): Mark tests for the feature parity dashboard
10. [format.md](./format.md): Use the linter
11. [troubleshooting.md](./troubleshooting.md) Tips for debugging
12. [iast-validations.md](./iast-validations.md): Mark tests with vulnerabilities
1. [add-new-test.md](./add-new-test.md): Add a new test
2. [scenarios.md](./scenarios.md): Add a new scenario
3. [format.md](./format.md): Use the linter
4. [features.md](./features.md): Mark tests for the feature parity dashboard
5. [enable-test.md](./enable-test.md): Enable a test
6. [skip-tests.md](./skip-tests.md): Disable tests
7. [manifest.md](./manifest.md): How tests are marked as enabled or disabled for libraries
8. [troubleshooting.md](./troubleshooting.md) Tips for debugging
9. [iast-validations.md](./iast-validations.md): Mark tests with vulnerabilities
10. [CI-and-scenarios.md](./CI-and-scenarios.md): Understand how scenarios run in CI
11. [update-docker-images.md](./update-docker-images.md): Modify test app docker images
12. [remote-config.md](./remote-config.md): Write remote config tests
2 changes: 1 addition & 1 deletion docs/edit/format.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
System tests code is in python, and is linted/formated using [black](https://black.readthedocs.io/en/stable/) and [pylint](https://pylint.readthedocs.io/en/latest/).
System tests code is in python, and is linted/formated using [mypy](https://mypy.readthedocs.io/en/stable/), [black](https://black.readthedocs.io/en/stable/) and [pylint](https://pylint.readthedocs.io/en/latest/).

Ensure you meet the other pre-reqs in [README.md](../../README.md#requirements)
Then, run the linter with:
Expand Down
6 changes: 3 additions & 3 deletions docs/scenarios/parametric.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ from utils.parametric.spec.trace import find_span, find_trace, find_span_in_trac
@pytest.mark.parametrize("library_env", [{"DD_ENV": "prod"}])
def test_datadog_spans(library_env, test_library, test_agent):
with test_library:
with test_library.start_span("operation") as s1:
with test_library.start_span("operation1", service="hello", parent_id=s1.span_id) as s2:
with test_library.dd_start_span("operation") as s1:
with test_library.dd_start_span("operation1", service="hello", parent_id=s1.span_id) as s2:
pass

with test_library.start_span("otel_rocks") as os1:
with test_library.dd_start_span("otel_rocks") as os1:
pass

# Waits for 2 traces to be captured and avoids sorting the received spans by start time
Expand Down
17 changes: 17 additions & 0 deletions docs/weblog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,23 @@ By default, the generated event has the following specification:

Values can be changed with the query params called `event_name`.

### GET '/inferred-proxy/span-creation'

This endpoint is supposed to be hit with the necessary headers that are used to create inferred proxy
spans for routers such as AWS API Gateway. Not including the headers means a span will not be created by the tracer
if the feature exists.

The endpoint supports the following query parameters:
- `status_code`: str containing status code to used in API response

The headers necessary to create a span with example values:
`x-dd-proxy-request-time-ms`: start time in milliseconds
`x-dd-proxy-path`: "/api/data",
`x-dd-proxy-httpmethod`: "GET",
`x-dd-proxy-domain-name`: "system-tests-api-gateway.com",
`x-dd-proxy-stage`: "staging",
`x-dd-proxy`: "aws-apigateway",

### GET /users

This endpoint calls the appsec blocking SDK functions used for blocking users. If the expected parameter matches one of
Expand Down
15 changes: 13 additions & 2 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,22 @@ source venv/bin/activate

echo "Checking Python files..."
if [ "$COMMAND" == "fix" ]; then
black .
black --quiet .
else
black --check --diff .
fi
pylint utils # pylint does not have a fix mode

echo "Running mypy type checks..."
if ! mypy --config pyproject.toml; then
echo "Mypy type checks failed. Please fix the errors above. 💥 💔 💥"
exit 1
fi

echo "Running pylint checks..."
if ! pylint utils; then
echo "Pylint checks failed. Please fix the errors above. 💥 💔 💥"
exit 1
fi

echo "Checking trailing whitespaces..."
INCLUDE_PATTERN='.*\.(md|yml|yaml|sh|cs|Dockerfile|java|sql|ts|js|php)$'
Expand Down
5 changes: 4 additions & 1 deletion manifests/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ tests/:
Test_DsmSQS: missing_feature
Test_Dsm_Manual_Checkpoint_Inter_Process: missing_feature
Test_Dsm_Manual_Checkpoint_Intra_Process: missing_feature
test_inferred_proxy.py:
Test_AWS_API_Gateway_Inferred_Span_Creation: missing_feature
test_otel_drop_in.py:
Test_Otel_Drop_In: missing_feature
parametric/:
Expand Down Expand Up @@ -181,12 +183,13 @@ tests/:
Test_Parametric_DDTrace_Current_Span: missing_feature (current_span endpoint is not implemented)
Test_Parametric_DDTrace_Extract_Headers: missing_feature (extract_headers endpoint is not implemented)
# cpp tracer does not support the OpenTelemetry API, otel parametric endpoints are not implemented
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)
Test_Parametric_OtelSpan_Set_Attribute: missing_feature (otel api is not supported)
Test_Parametric_OtelSpan_Set_Name: missing_feature (otel api is not supported)
Test_Parametric_OtelSpan_Set_Status: missing_feature (otel api is not supported)
Test_Parametric_OtelSpan_Start_Finish: missing_feature (otel api is not supported)
Test_Parametric_OtelSpan_Start: missing_feature (otel api is not supported)
Test_Parametric_Otel_Baggage: missing_feature (otel api is not supported)
Test_Parametric_Otel_Current_Span: missing_feature (otel api is not supported)
Test_Parametric_Otel_Trace_Flush: missing_feature (otel api is not supported)
Expand Down
3 changes: 3 additions & 0 deletions manifests/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ tests/:
test_asm_standalone.py:
Test_AppSecStandalone_UpstreamPropagation: v2.55.0
Test_IastStandalone_UpstreamPropagation: v2.55.0
Test_SCAStandalone_Telemetry: missing_feature
test_automated_login_events.py:
Test_Login_Events: irrelevant (was v2.53.0 but will be replaced by V2)
Test_Login_Events_Extended: irrelevant (was v2.53.0 but will be replaced by V2)
Expand Down Expand Up @@ -360,6 +361,8 @@ tests/:
Test_DsmSQS: v2.48.0
Test_Dsm_Manual_Checkpoint_Inter_Process: missing_feature
Test_Dsm_Manual_Checkpoint_Intra_Process: missing_feature
test_inferred_proxy.py:
Test_AWS_API_Gateway_Inferred_Span_Creation: missing_feature
test_otel_drop_in.py:
Test_Otel_Drop_In: missing_feature
k8s_lib_injection/:
Expand Down
5 changes: 4 additions & 1 deletion manifests/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ tests/:
test_asm_standalone.py:
Test_AppSecStandalone_UpstreamPropagation: missing_feature
Test_IastStandalone_UpstreamPropagation: missing_feature
Test_SCAStandalone_Telemetry: missing_feature
test_automated_login_events.py:
Test_Login_Events: missing_feature
Test_Login_Events_Extended: missing_feature
Expand Down Expand Up @@ -482,6 +483,8 @@ tests/:
Test_Dsm_Manual_Checkpoint_Intra_Process:
"*": irrelevant
net-http: missing_feature (Endpoint not implemented)
test_inferred_proxy.py:
Test_AWS_API_Gateway_Inferred_Span_Creation: missing_feature
test_otel_drop_in.py:
Test_Otel_Drop_In: missing_feature
parametric/:
Expand Down Expand Up @@ -512,7 +515,7 @@ tests/:
Test_Parametric_DDTrace_Crash: missing_feature (crash endpoint is not implemented)
Test_Parametric_DDTrace_Current_Span: missing_feature (spans are stored in a local context, there is no global current span in the go tracer)
Test_Parametric_OtelSpan_Set_Name: bug (APMAPI-778) # The set_name endpoint should set the resouce name (not the span name)
Test_Parametric_OtelSpan_Start_Finish: bug (APMAPI-778) # String attributes are incorrectly stored/serialized in a list
Test_Parametric_OtelSpan_Start: bug (APMAPI-778) # String attributes are incorrectly stored/serialized in a list
Test_Parametric_Otel_Baggage: missing_feature (otel baggage is not supported)
Test_Parametric_Otel_Current_Span: missing_feature (otel current span endpoint is not defined)
test_span_links.py: missing_feature
Expand Down
3 changes: 3 additions & 0 deletions manifests/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ tests/:
Test_IastStandalone_UpstreamPropagation:
'*': v1.36.0
spring-boot-3-native: missing_feature (GraalVM. Tracing support only)
Test_SCAStandalone_Telemetry: missing_feature
test_automated_login_events.py:
Test_Login_Events: irrelevant (was v1.36.0 but will be replaced by V2)
Test_Login_Events_Extended: irrelevant (was v1.36.0 but will be replaced by V2)
Expand Down Expand Up @@ -1426,6 +1427,8 @@ tests/:
Test_Dsm_Manual_Checkpoint_Intra_Process:
"*": irrelevant
spring-boot: bug (AIDM-325)
test_inferred_proxy.py:
Test_AWS_API_Gateway_Inferred_Span_Creation: missing_feature
test_mongo.py:
Test_Mongo: bug (APMAPI-729)
test_otel_drop_in.py:
Expand Down
13 changes: 11 additions & 2 deletions manifests/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ refs:
- &ref_5_24_0 '>=5.24.0 || ^4.48.0'
- &ref_5_25_0 '>=5.25.0 || ^4.49.0'
- &ref_5_26_0 '>=5.26.0 || ^4.50.0'
- &ref_5_27_0 '>=5.27.0 || ^4.51.0'

tests/:
apm_tracing_e2e/:
Expand Down Expand Up @@ -427,6 +428,9 @@ tests/:
test_asm_standalone.py:
Test_AppSecStandalone_UpstreamPropagation: *ref_5_18_0
Test_IastStandalone_UpstreamPropagation: missing_feature # was supposed to be released in 5.18.0
Test_SCAStandalone_Telemetry:
'*': *ref_5_18_0
nextjs: missing_feature
test_automated_login_events.py:
Test_Login_Events:
'*': *ref_4_4_0
Expand Down Expand Up @@ -628,6 +632,10 @@ tests/:
Test_Dsm_Manual_Checkpoint_Intra_Process:
'*': irrelevant
express4: *ref_5_20_0
test_inferred_proxy.py:
Test_AWS_API_Gateway_Inferred_Span_Creation:
'*': irrelevant
express4: *ref_5_26_0
test_otel_drop_in.py:
Test_Otel_Drop_In: missing_feature
k8s_lib_injection/:
Expand All @@ -640,7 +648,8 @@ tests/:
Test_Config_TraceEnabled: *ref_4_3_0
Test_Config_TraceLogDirectory: missing_feature
Test_Config_UnifiedServiceTagging: *ref_5_25_0
test_crashtracking.py: missing_feature
test_crashtracking.py:
Test_Crashtracking: *ref_5_27_0
test_dynamic_configuration.py:
TestDynamicConfigSamplingRules: *ref_5_16_0
TestDynamicConfigTracingEnabled: *ref_5_4_0
Expand All @@ -661,7 +670,7 @@ tests/:
Test_Parametric_DDTrace_Crash: missing_feature (crash endpoint is not implemented)
Test_Parametric_DDTrace_Current_Span: missing_feature (otel current_span endpoint is not supported)
Test_Parametric_OtelSpan_Set_Name: bug (APMAPI-778) # set_name endpoint should set the resource name on a span (not the operation name)
Test_Parametric_OtelSpan_Start_Finish: bug (APMAPI-778) # The expected span.kind tag is not set
Test_Parametric_OtelSpan_Start: bug (APMAPI-778) # The expected span.kind tag is not set
Test_Parametric_Otel_Baggage: missing_feature (baggage is not supported)
Test_Parametric_Otel_Current_Span: missing_feature (otel baggage endpoints are not implemented)
test_partial_flushing.py:
Expand Down
Loading

0 comments on commit 5469bd8

Please sign in to comment.