-
Notifications
You must be signed in to change notification settings - Fork 1.6k
135 lines (120 loc) · 4.49 KB
/
integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Integration Test Suite
#
# This workflow runs the integration tests. If the workflow is triggered in the merge queue, all integration tests
# are run. If the workflow is triggered in a PR commit, then the files changed in the PR are evaluated to determine
# if any integration tests will run.
name: Integration Test Suite
on:
pull_request:
merge_group:
types: [checks_requested]
concurrency:
# `github.event.number` exists for pull requests, otherwise fall back to SHA for merge queue
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.head_sha }}
cancel-in-progress: true
env:
AWS_ACCESS_KEY_ID: "dummy"
AWS_SECRET_ACCESS_KEY: "dummy"
CONTAINER_TOOL: "docker"
DD_ENV: "ci"
DD_API_KEY: ${{ secrets.DD_API_KEY }}
TEST_DATADOG_API_KEY: ${{ secrets.CI_TEST_DATADOG_API_KEY }}
TEST_APPSIGNAL_PUSH_API_KEY: ${{ secrets.TEST_APPSIGNAL_PUSH_API_KEY }}
AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
RUST_BACKTRACE: full
TEST_LOG: vector=debug
VERBOSE: true
CI: true
PROFILE: debug
# observing issues fetching boringssl via HTTPS in the OSX build, seeing if this helps
# can be removed when we switch back to the upstream openssl-sys crate
CARGO_NET_GIT_FETCH_WITH_CLI: true
jobs:
changes:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/changes.yml
with:
base_ref: ${{ github.event.pull_request.base.ref }}
head_ref: ${{ github.event.pull_request.head.ref }}
source: false
int_tests: true
secrets: inherit
setup:
runs-on: ubuntu-latest
needs:
- changes
steps:
- uses: actions/checkout@v4
- run: sudo npm -g install @datadog/datadog-ci
- run: sudo -E bash scripts/ci-free-disk-space.sh
- run: docker image prune -af ; docker container prune -f
- name: Determine if secrets are defined (PR author is team member)
if: github.event_name == 'pull_request'
env:
GH_APP_DATADOG_VECTOR_CI_APP_ID: ${{ secrets.GH_APP_DATADOG_VECTOR_CI_APP_ID }}
run: |
if [[ "$GH_APP_DATADOG_VECTOR_CI_APP_ID" != "" ]] ; then
echo "PR_HAS_ACCESS_TO_SECRETS=true" >> "$GITHUB_ENV"
else
echo "PR_HAS_ACCESS_TO_SECRETS=false" >> "$GITHUB_ENV"
fi
integration-tests:
runs-on: ubuntu-20.04
needs:
- changes
- setup
strategy:
matrix:
# If you modify this list, please also update the `int_tests` job in changes.yml.
service: [
"amqp", "appsignal", "aws", "axiom", "azure", "clickhouse", "databend", "datadog-agent",
"datadog-logs", "datadog-metrics", "datadog-traces", "dnstap", "docker-logs", "elasticsearch",
"eventstoredb", "fluent", "gcp", "greptimedb", "http-client", "influxdb", "kafka", "logstash",
"loki", "mongodb", "nats", "nginx", "opentelemetry", "postgres", "prometheus", "pulsar",
"redis", "splunk", "webhdfs"
]
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- run: docker image prune -af ; docker container prune -f
- name: Download JSON artifact from changes.yml
uses: actions/download-artifact@v4
with:
name: int_tests_changes
- name: Run Integration Tests for ${{ matrix.service }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: |
# Parse the JSON and check if the specific integration test should run.
should_run=$(jq '."${{ matrix.service }}"' int_tests_changes.json)
# Check if any of the three conditions is true
if [[ "${{ github.event_name }}" == "merge_group" || \
"${{ needs.changes.outputs.all-int }}" == "true" || \
"$should_run" == "true" ]]; then
echo "Running test for ${{ matrix.service }}"
bash scripts/ci-int-e2e-test.sh int ${{ matrix.service }}
else
echo "Skipping ${{ matrix.service }} test as the value is false or conditions not met."
fi
integration-test-suite:
name: Integration Test Suite
runs-on: ubuntu-24.04
timeout-minutes: 5
if: always()
needs:
- changes
- integration-tests
env:
FAILED: ${{ contains(needs.*.result, 'failure') }}
steps:
- run: |
echo "failed=${{ env.FAILED }}"
if [[ "$FAILED" == "true" ]] ; then
exit 1
else
exit 0
fi