Skip to content

Commit 11f47ce

Browse files
committed
Merge branch 'master' into vpellan/meta-struct
2 parents 20d026a + 34bf118 commit 11f47ce

File tree

918 files changed

+14564
-9315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

918 files changed

+14564
-9315
lines changed

.circleci/config.yml

Lines changed: 0 additions & 585 deletions
This file was deleted.

.circleci/images/primary/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

.circleci/images/primary/binary_version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/actions/build-test/action.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: 'Build and Test'
2+
3+
# TODO: Improve description
4+
description: 'Configure test suite in batches'
5+
6+
inputs:
7+
alias:
8+
description: 'Runtime alias'
9+
required: true
10+
container-id:
11+
description: 'Container Identifier'
12+
required: true
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Configure Git
18+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
19+
shell: bash
20+
21+
- run: bundle exec rake github:run_batch_build
22+
shell: bash
23+
24+
- name: Configure RSpec
25+
run: ln -s .rspec-local.example .rspec-local
26+
shell: bash
27+
28+
- run: bundle exec rake github:run_batch_tests
29+
shell: bash
30+
env:
31+
COVERAGE_DIR: coverage/versions/${{ inputs.alias }}/${{ inputs.container-id }}
32+
33+
- name: Debug with SSH connection
34+
if: ${{ failure() && runner.debug == '1' }}
35+
uses: mxschmitt/action-tmate@e5c7151931ca95bad1c6f4190c730ecf8c7dde48 # v3.19.0
36+
with:
37+
limit-access-to-actor: true
38+
# This mode will wait at the end of the job for a user to connect and then to terminate the tmate session.
39+
# If no user has connected within 10 minutes after the post-job step started,
40+
# it will terminate the tmate session and quit gracefully.
41+
detached: true
42+
43+
- name: Validate test agent data
44+
if: ${{ !cancelled() }}
45+
run: ruby .github/scripts/test_agent_check.rb
46+
shell: bash
47+
48+
- name: Upload junit reports
49+
if: ${{ !cancelled() }}
50+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
51+
with:
52+
name: junit-${{ inputs.alias }}-${{ inputs.container-id }}
53+
path: tmp/rspec/*.xml
54+
55+
- name: Upload coverage data
56+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
57+
with:
58+
name: coverage-${{ inputs.alias }}-${{ inputs.container-id }}
59+
path: coverage
60+
include-hidden-files: true # Coverage data generated by SimpleCov are hidden
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Restore Bundle from cache'
2+
3+
# TODO: Improve description
4+
description: 'Restore the bundle from cache'
5+
6+
inputs:
7+
lockfile-name:
8+
description: 'Name of the lockfile artifact to download'
9+
required: true
10+
cache-key:
11+
description: 'Cache key for bundle'
12+
required: true
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- name: Download lockfile
18+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
19+
with:
20+
name: ${{ inputs.lockfile-name }}
21+
22+
- name: Restore cache
23+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
24+
id: restore-cache
25+
with:
26+
key: "${{ inputs.cache-key }}"
27+
path: "/usr/local/bundle"
28+
29+
- run: bundle check
30+
shell: bash

.github/forced-tests-list.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
{
2-
"AGENT_NOT_SUPPORTING_SPAN_EVENTS":
3-
[
4-
"tests/test_span_events.py"
5-
],
6-
"PARAMETRIC":
7-
[
8-
"tests/parametric/test_span_events.py"
9-
],
10-
"DEFAULT": [
11-
"tests/test_graphql.py"
12-
]
2+
133
}

.github/workflows/_unit_test.yml

Lines changed: 100 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
name: batch
2828
outputs:
2929
batches: "${{ steps.set-batches.outputs.batches }}"
30+
misc: "${{ steps.set-batches.outputs.misc }}"
3031
cache-key: "${{ steps.restore-cache.outputs.cache-primary-key }}"
3132
lockfile: "${{ steps.lockfile.outputs.lockfile }}"
3233
container:
@@ -60,18 +61,47 @@ jobs:
6061
- id: set-batches
6162
name: Distribute tasks into batches
6263
run: |
63-
batches_json=$(bundle exec rake github:generate_batches)
64-
echo "$batches_json" | ruby -rjson -e 'puts JSON.pretty_generate(JSON.parse(STDIN.read))'
65-
echo "batches=$batches_json" >> $GITHUB_OUTPUT
64+
data=$(bundle exec rake github:generate_batches)
65+
echo "$data" | ruby -rjson -e 'puts JSON.pretty_generate(JSON.parse(STDIN.read))'
66+
67+
# Extract each key and set it as a separate output
68+
batches_data=$(echo "$data" | ruby -rjson -e 'puts JSON.parse(STDIN.read)["batches"].to_json')
69+
misc_data=$(echo "$data" | ruby -rjson -e 'puts JSON.parse(STDIN.read)["misc"].to_json')
70+
71+
echo "batches=$batches_data" >> $GITHUB_OUTPUT
72+
echo "misc=$misc_data" >> $GITHUB_OUTPUT
6673
- name: Generate batch summary
6774
run: bundle exec rake github:generate_batch_summary
6875
env:
6976
batches_json: "${{ steps.set-batches.outputs.batches }}"
70-
build-test:
77+
78+
# `Initialize containers` step becomes quite heavily when many services are used.
79+
#
80+
# The job can failed with timeout because it takes a long time pulling the image or waiting for the service to be ready).
81+
#
82+
# `build-test-standard` job is used to run most of our tasks and configured with the following services:
83+
# - mysql
84+
# - postgres
85+
# - redis
86+
#
87+
# `build-test-misc` job is extracted to run specific tasks that requires the following services:
88+
# - elasticsearch
89+
# - memcached
90+
# - mongodb
91+
# - opensearch
92+
# - presto
93+
#
94+
# Benefit of this optimization:
95+
# - Unnecessary services are not started
96+
# - Reduce the overhead for pulling images
97+
# - Improve reliability for starting dependent services
98+
#
99+
# In the future, we could consider to extract jobs to run database dependent tasks to optimize the workflow.
100+
build-test-standard:
71101
needs:
72102
- batch
73103
runs-on: ubuntu-24.04
74-
name: build & test [${{ matrix.batch }}]
104+
name: build & test (standard) [${{ matrix.batch }}]
75105
timeout-minutes: 30
76106
env:
77107
BATCHED_TASKS: "${{ toJSON(matrix.tasks) }}"
@@ -86,13 +116,7 @@ jobs:
86116
DD_REMOTE_CONFIGURATION_ENABLED: 'false'
87117
TEST_POSTGRES_HOST: postgres
88118
TEST_REDIS_HOST: redis
89-
TEST_ELASTICSEARCH_HOST: elasticsearch
90-
TEST_MEMCACHED_HOST: memcached
91-
TEST_MONGODB_HOST: mongodb
92119
TEST_MYSQL_HOST: mysql
93-
TEST_OPENSEARCH_HOST: opensearch
94-
TEST_OPENSEARCH_PORT: '9200'
95-
TEST_PRESTO_HOST: presto
96120
DD_AGENT_HOST: agent
97121
DD_TRACE_AGENT_PORT: '9126'
98122
DATADOG_GEM_CI: 'true'
@@ -108,6 +132,12 @@ jobs:
108132
DD_POOL_TRACE_CHECK_FAILURES: 'true'
109133
DD_DISABLE_ERROR_RESPONSES: 'true'
110134
ENABLED_CHECKS: trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
135+
mysql:
136+
image: ghcr.io/datadog/images-rb/services/mysql:8.0
137+
env:
138+
MYSQL_ROOT_PASSWORD: root
139+
MYSQL_PASSWORD: mysql
140+
MYSQL_USER: mysql
111141
postgres:
112142
image: ghcr.io/datadog/images-rb/services/postgres:9.6
113143
env:
@@ -116,6 +146,57 @@ jobs:
116146
POSTGRES_DB: postgres
117147
redis:
118148
image: ghcr.io/datadog/images-rb/services/redis:6.2
149+
steps:
150+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
151+
- name: Restore bundle cache
152+
uses: ./.github/actions/bundle-restore
153+
with:
154+
lockfile-name: ${{ needs.batch.outputs.lockfile }}
155+
cache-key: ${{ needs.batch.outputs.cache-key }}
156+
- name: Build & Test
157+
uses: ./.github/actions/build-test
158+
with:
159+
alias: ${{ inputs.alias }}
160+
container-id: "standard-${{ matrix.batch }}"
161+
162+
build-test-misc:
163+
needs:
164+
- batch
165+
runs-on: ubuntu-24.04
166+
name: build & test (misc) [${{ matrix.batch }}]
167+
timeout-minutes: 30
168+
env:
169+
BATCHED_TASKS: "${{ toJSON(matrix.tasks) }}"
170+
strategy:
171+
fail-fast: false
172+
matrix:
173+
include: "${{ fromJson(needs.batch.outputs.misc).include }}"
174+
container:
175+
image: ghcr.io/datadog/images-rb/engines/${{ inputs.engine }}:${{ inputs.version }}
176+
env:
177+
DD_INSTRUMENTATION_TELEMETRY_ENABLED: 'false'
178+
DD_REMOTE_CONFIGURATION_ENABLED: 'false'
179+
TEST_ELASTICSEARCH_HOST: elasticsearch
180+
TEST_MEMCACHED_HOST: memcached
181+
TEST_MONGODB_HOST: mongodb
182+
TEST_OPENSEARCH_HOST: opensearch
183+
TEST_OPENSEARCH_PORT: '9200'
184+
TEST_PRESTO_HOST: presto
185+
DD_AGENT_HOST: agent
186+
DD_TRACE_AGENT_PORT: '9126'
187+
DATADOG_GEM_CI: 'true'
188+
TEST_DATADOG_INTEGRATION: '1'
189+
JRUBY_OPTS: "--dev" # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
190+
services:
191+
agent:
192+
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.18.0
193+
env:
194+
LOG_LEVEL: DEBUG
195+
TRACE_LANGUAGE: ruby
196+
PORT: '9126'
197+
DD_POOL_TRACE_CHECK_FAILURES: 'true'
198+
DD_DISABLE_ERROR_RESPONSES: 'true'
199+
ENABLED_CHECKS: trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
119200
elasticsearch:
120201
image: ghcr.io/datadog/images-rb/services/elasticsearch:8.1.3
121202
env:
@@ -138,54 +219,15 @@ jobs:
138219
cluster.routing.allocation.disk.threshold_enabled: 'false'
139220
presto:
140221
image: ghcr.io/datadog/images-rb/services/starburstdata/presto:332-e.9
141-
mysql:
142-
image: ghcr.io/datadog/images-rb/services/mysql:8.0
143-
env:
144-
MYSQL_ROOT_PASSWORD: root
145-
MYSQL_PASSWORD: mysql
146-
MYSQL_USER: mysql
147222
steps:
148223
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
149-
- name: Configure Git
150-
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
151-
- name: Download lockfile
152-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
224+
- name: Restore bundle cache
225+
uses: ./.github/actions/bundle-restore
153226
with:
154-
name: lockfile-${{ inputs.alias }}-${{ github.run_id }}
155-
- name: Restore cache
156-
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
157-
id: restore-cache
158-
with:
159-
key: "${{ needs.batch.outputs.cache-key }}"
160-
path: "/usr/local/bundle"
161-
- run: bundle check || bundle install
162-
- run: bundle exec rake github:run_batch_build
163-
- name: Configure RSpec
164-
run: ln -s .rspec-local.example .rspec-local
165-
- run: bundle exec rake github:run_batch_tests
166-
env:
167-
COVERAGE_DIR: coverage/versions/${{ inputs.alias }}/${{ matrix.batch }}
168-
- name: Debug with SSH connection
169-
if: ${{ failure() && runner.debug == '1' }}
170-
uses: mxschmitt/action-tmate@e5c7151931ca95bad1c6f4190c730ecf8c7dde48 # v3.19.0
171-
with:
172-
limit-access-to-actor: true
173-
# This mode will wait at the end of the job for a user to connect and then to terminate the tmate session.
174-
# If no user has connected within 10 minutes after the post-job step started,
175-
# it will terminate the tmate session and quit gracefully.
176-
detached: true
177-
- name: Validate test agent data
178-
if: ${{ !cancelled() }}
179-
run: ruby .github/scripts/test_agent_check.rb
180-
- name: Upload junit reports
181-
if: ${{ !cancelled() }}
182-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
183-
with:
184-
name: junit-${{ inputs.alias }}-${{ matrix.batch }}-${{ github.run_id }}
185-
path: tmp/rspec/*.xml
186-
- name: Upload coverage data
187-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
227+
lockfile-name: ${{ needs.batch.outputs.lockfile }}
228+
cache-key: ${{ needs.batch.outputs.cache-key }}
229+
- name: Build & Test
230+
uses: ./.github/actions/build-test
188231
with:
189-
name: coverage-${{ inputs.alias }}-${{ matrix.batch }}-${{ github.run_id }}
190-
path: coverage
191-
include-hidden-files: true # Coverage data generated by SimpleCov are hidden
232+
alias: ${{ inputs.alias }}
233+
container-id: "misc-${{ matrix.batch }}"

.github/workflows/nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
base: ubuntu-24.04 # always x86_64-linux-gnu
2626
- os: linux
2727
cpu: aarch64
28-
base: arm-4core-linux-ubuntu24.04 # always aarch64-linux-gnu
28+
base: ubuntu-24.04-arm # always aarch64-linux-gnu
2929
nix:
3030
- 24.05
3131

.github/workflows/parametric-tests.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,42 @@ name: Parametric Tests
33
on:
44
push:
55
branches:
6-
- "**"
7-
paths-ignore:
8-
- ".circleci/**"
9-
- ".gitlab/**"
10-
- "appraisal/**"
11-
- "benchmarks/**"
12-
- "docs/**"
13-
- "gemfiles/**"
14-
- "integration/**"
15-
- "sig/**"
16-
- "spec/**"
17-
- "suppressions/**"
18-
- "tools/**"
19-
- "vendor/**"
6+
- master
7+
pull_request:
8+
branches:
9+
- master
2010
workflow_dispatch: {}
2111
schedule:
2212
- cron: "00 04 * * 2-6"
2313

2414
jobs:
15+
changes:
16+
name: Changes
17+
runs-on: ubuntu-24.04
18+
outputs:
19+
changes: ${{ steps.changes.outputs.src }}
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
- name: Changes
24+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
25+
id: changes
26+
with:
27+
filters: |
28+
src:
29+
- '.github/workflows/**'
30+
- 'lib/**'
31+
- 'ext/**'
32+
- '*.gemspec'
33+
- 'Gemfile'
34+
- '*.gemfile'
35+
- 'lib-injection/**'
36+
- 'tasks/**'
37+
2538
build-artifacts:
39+
needs:
40+
- changes
41+
if: ${{ needs.changes.outputs.changes == 'true' }}
2642
runs-on: ubuntu-22.04
2743
permissions:
2844
packages: write
@@ -40,6 +56,8 @@ jobs:
4056
parametric:
4157
needs:
4258
- build-artifacts
59+
- changes
60+
if: ${{ needs.changes.outputs.changes == 'true' }}
4361
uses: DataDog/system-tests/.github/workflows/run-parametric.yml@main
4462
secrets: inherit
4563
with:

0 commit comments

Comments
 (0)