Skip to content

introduce framework tests #31869

introduce framework tests

introduce framework tests #31869

Workflow file for this run

name: Testing the test
on:
workflow_dispatch: {}
pull_request:
branches:
- '**'
types:
- opened
- synchronize
- reopened
# push:
# branches:
# - main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
uses: ./.github/workflows/lint.yml
test_the_test:
name: Test the test
runs-on: ubuntu-latest
permissions:
contents: read # need to read releases
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Install runner
uses: ./.github/actions/install_runner
# force /bin/bash in order to test against bash 3.2 on macOS
- name: Test the test (direct)
run: /bin/bash run.sh TEST_THE_TEST
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test group parsing
run: |
/bin/bash run.sh ++dry APPSEC_SCENARIOS
/bin/bash run.sh ++dry TRACER_RELEASE_SCENARIOS
compute_libraries_and_scenarios:
name: Compute libraries and scenarios
uses: ./.github/workflows/compute_libraries_and_scenarios.yml
fail-if-target-branch:
name: Fail if target branch is specified
needs:
- compute_libraries_and_scenarios
if: needs.compute_libraries_and_scenarios.outputs.target-branch != ''
runs-on: ubuntu-latest
steps:
- name: Fail if PR title contains a target branch
run: |
echo "This PR can't be merged, due to the title specifying a target branch"
exit 1
system_tests:
name: System Tests
needs:
- lint
- test_the_test
- compute_libraries_and_scenarios
strategy:
matrix:
include: ${{ fromJson(needs.compute_libraries_and_scenarios.outputs.library_matrix) }}
fail-fast: false
uses: ./.github/workflows/system-tests.yml
permissions:
contents: read
packages: write
secrets: inherit
with:
library: ${{ matrix.library }}
scenarios: ${{ needs.compute_libraries_and_scenarios.outputs.scenarios }}
scenarios_groups: ${{ needs.compute_libraries_and_scenarios.outputs.scenarios_groups }}
parametric_job_count: ${{ matrix.version == 'dev' && 2 || 1 }} # test both use cases
skip_empty_scenarios: true
display_summary: true
desired_execution_time: ${{ needs.compute_libraries_and_scenarios.outputs.desired_execution_time }}
artifact_retention_days: 3
_build_buddies_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-buddies-images') }}
_build_lambda_proxy_image: ${{ fromJson(needs.compute_libraries_and_scenarios.outputs.rebuild_lambda_proxy) }}
_build_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-proxy-image') }}
_build_python_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-python-base-images') }}
_enable_replay_scenarios: true
_system_tests_dev_mode: ${{ matrix.version == 'dev' }}
_system_tests_library_target_branch: ${{ needs.compute_libraries_and_scenarios.outputs.target-branch }}
exotics:
name: Exotics scenarios
needs:
- compute_libraries_and_scenarios
if: contains(needs.compute_libraries_and_scenarios.outputs.scenarios_groups, 'exotics') || contains(needs.compute_libraries_and_scenarios.outputs.scenarios_groups, 'all')
uses: ./.github/workflows/run-exotics.yml
secrets: inherit
all-jobs-are-green: # if this must be renamed, you need to update utils/scripts/get-workflow-summary.py
# name: All jobs are green # DO NOT SET A NAME
runs-on: ubuntu-latest
permissions:
checks: read
statuses: read
actions: read
needs:
- system_tests
if: '!cancelled()'
steps:
- uses: DataDog/ensure-ci-success@b0d931ac77c810490e61964c321103040eef888e
with:
# initial-delay-seconds: '300' Don't need this, as the job is executed after system tests
polling-interval-seconds: '60'
max-retries: '120'
# Ignore gitlab jobs that are not K8S_LIB* (K8s lib injection) or *DOC (docker ssi) or *DO5A (docker ssi crashtracking)
# https://regex101.com/r/Bo5Kpn/1
# Also ignore the job that waits for the tests to succeed before adding
# to the merge queue.
ignored-name-patterns: |
dd-gitlab/(?!K8S_LIB).*$(?<!DOC)(?<!DO5A)
devflow/merge