Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 9 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ jobs:
# /bin/bash run.sh ++dry TRACER_RELEASE_SCENARIOS

scenarios:
name: Get scenarios and groups
uses: ./.github/workflows/compute-scenarios.yml

impacted_libraries:
name: Get impacted libraries
uses: ./.github/workflows/compute-impacted-libraries.yml

system_tests:
name: System Tests
needs:
- lint
- test_the_test
Expand All @@ -88,23 +91,15 @@ jobs:
secrets: inherit
with:
library: ${{ matrix.library }}
run_all: ${{ needs.scenarios.outputs.run_all == 'true' }}
run_replay: ${{ needs.scenarios.outputs.run_all == 'true' }}
run_integration: ${{ needs.scenarios.outputs.run_integration == 'true' }}
run_sampling: ${{ needs.scenarios.outputs.run_sampling == 'true' }}
run_profiling: ${{ needs.scenarios.outputs.run_profiling == 'true' }}
run_debugger: ${{ needs.scenarios.outputs.run_debugger == 'true' }}
run_appsec: ${{ needs.scenarios.outputs.run_appsec == 'true' }}
run_open_telemetry: ${{ needs.scenarios.outputs.run_open_telemetry == 'true' }}
run_parametric: ${{ needs.scenarios.outputs.run_parametric == 'true' }}
run_graphql: ${{ needs.scenarios.outputs.run_graphql == 'true' }}
run_libinjection: ${{ needs.scenarios.outputs.run_libinjection == 'true' }}
scenarios: ${{ needs.scenarios.outputs.scenarios }}
scenarios_groups: ${{ needs.scenarios.outputs.scenarios_groups }}
build_python_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-python-base-images') }}
build_buddies_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-buddies-images') }}
build_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-proxy-image') }}
build_lib_injection_app_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-lib-injection-app-images') }}

system_tests_docker_mode:
name: Ruby Docker Mode
needs:
- lint
- test_the_test
Expand All @@ -114,11 +109,13 @@ jobs:
secrets: inherit

exotics:
if: needs.scenarios.outputs.run_all == 'true'
name: Exotics scenarios
if: contains(github.event.pull_request.labels.*.name, 'run-all-scenarios')
uses: ./.github/workflows/run-exotics.yml
secrets: inherit

update-CI-visibility:
name: Update CI Visibility Dashboard
runs-on: ubuntu-latest
needs:
- system_tests
Expand Down
251 changes: 38 additions & 213 deletions .github/workflows/compute-scenarios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,223 +4,48 @@ on:
workflow_call:
# Map the workflow outputs to job outputs
outputs:
run_all:
description: "Shall we run all scenarios"
value: ${{ jobs.main.outputs.run_all }}
run_open_telemetry:
description: "Shall we run open-telemetry scenarios"
value: ${{ jobs.main.outputs.run_open_telemetry }}
run_sampling:
description: "Shall we run sampling scenarios"
value: ${{ jobs.main.outputs.run_sampling }}
run_profiling:
description: "Shall we run profiling scenario"
value: ${{ jobs.main.outputs.run_profiling }}
run_parametric:
description: "Shall we run parametric scenario"
value: ${{ jobs.main.outputs.run_parametric }}
run_libinjection:
description: "Shall we run lib-injection scenarios"
value: ${{ jobs.main.outputs.run_libinjection }}
run_debugger:
description: "Shall we run debugger scenarios"
value: ${{ jobs.main.outputs.run_debugger }}
run_appsec:
description: "Shall we run AppSec scenarios"
value: ${{ jobs.main.outputs.run_appsec }}
run_integration:
description: "Shall we run Integrations scenarios"
value: ${{ jobs.main.outputs.run_integration }}
run_graphql:
description: "Shall we run GraphQL scenarios"
value: ${{ jobs.main.outputs.run_graphql }}
scenarios:
description: "Comma-separated list of scenarios to run"
value: ${{ jobs.main.outputs.scenarios }}
scenarios_groups:
description: "Comma-separated list of scenarios groups to run"
value: ${{ jobs.main.outputs.scenarios_groups }}

jobs:
main:
runs-on: ubuntu-latest
# Map the job outputs to step outputs
outputs:
run_all: ${{ steps.compute_run_all.outputs.result }}
run_open_telemetry: ${{ steps.compute_open_telemetry.outputs.result }}
run_sampling: ${{ steps.compute_sampling.outputs.result }}
run_profiling: ${{ steps.compute_profiling.outputs.result }}
run_parametric: ${{ steps.compute_parametric.outputs.result }}
run_libinjection: ${{ steps.compute_libinjection.outputs.result }}
run_debugger: ${{ steps.compute_debugger.outputs.result }}
run_appsec: ${{ steps.compute_appsec.outputs.result }}
run_integration: ${{ steps.compute_integration.outputs.result }}
run_graphql: ${{ steps.compute_graphql.outputs.result }}
scenarios: ${{ steps.compute_impacted_scenarios.outputs.scenarios }}
scenarios_groups: ${{ steps.compute_impacted_scenarios.outputs.scenarios_groups }}
steps:
- name: Compute run_all
id: compute_run_all
run: |
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-all-scenarios') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_open_telemetry
id: compute_open_telemetry
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-open-telemetry-scenarios') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_sampling
id: compute_sampling
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-sampling-scenario') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_profiling
id: compute_profiling
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-profiling-scenario') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_parametric
id: compute_parametric
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-parametric-scenario') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_libinjection
id: compute_libinjection
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
- name: Checkout main branch
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
ref: 'main'
path: 'original'
- name: Install runner
uses: ./.github/actions/install_runner
- name: Get scenario map
run: ./run.sh MOCK_THE_TEST --collect-only --scenario-report
- name: Get list of modified files
run: |
git fetch origin ${{ github.event.pull_request.base.sha || github.sha }}
git diff --name-only HEAD ${{ github.event.pull_request.base.sha || github.sha }} >> modified_files.txt
cat modified_files.txt
- name: Compute impacted scenario
id: compute_impacted_scenarios
run: |
source venv/bin/activate
python utils/scripts/compute_impacted_scenario.py >> $GITHUB_OUTPUT
env:
PYTHONPATH: "."
GITHUB_REF: ${{ github.ref }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_PULL_REQUEST_LABELS: ${{ toJSON(github.event.pull_request.labels) }}
TEMP_TEST: ${{ toJSON(github.doesntexists) }}

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-libinjection-scenarios') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_debugger
id: compute_debugger
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-debugger-scenarios') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_appsec
id: compute_appsec
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-appsec-scenarios') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_integration
id: compute_integration
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ steps.compute_appsec.outputs.result }}" == "true" ]; then
# Some AppSec tests are in integrations scenario
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-integration-scenarios') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Compute run_graphql
id: compute_graphql
run: |
if [ "${{ steps.compute_run_all.outputs.result }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ steps.compute_appsec.outputs.result }}" == "true" ]; then
# Some AppSec tests are in GraphQL scenario
echo "result=true" >> $GITHUB_OUTPUT

elif [ "${{ contains(github.event.pull_request.labels.*.name, 'run-graphql-scenarios') }}" == "true" ]; then
echo "result=true" >> $GITHUB_OUTPUT

else
echo "result=false" >> $GITHUB_OUTPUT
fi

echo "Result: $GITHUB_OUTPUT"

- name: Print results
run: |
echo "Run all: -> ${{ steps.compute_run_all.outputs.result }}"
echo "Run open telemetry: -> ${{ steps.compute_open_telemetry.outputs.result }}"
echo "Run sampling: -> ${{ steps.compute_sampling.outputs.result }}"
echo "Run profiling: -> ${{ steps.compute_profiling.outputs.result }}"
echo "Run parametric: -> ${{ steps.compute_parametric.outputs.result }}"
echo "Run lib-injection: -> ${{ steps.compute_libinjection.outputs.result }}"
echo "Run debugger: -> ${{ steps.compute_debugger.outputs.result }}"
echo "Run appsec: -> ${{ steps.compute_appsec.outputs.result }}"
echo "Run integration: -> ${{ steps.compute_integration.outputs.result }}"
echo "Run graphql: -> ${{ steps.compute_graphql.outputs.result }}"
Loading