-
Notifications
You must be signed in to change notification settings - Fork 2k
137 lines (123 loc) · 5.08 KB
/
integration.yml
File metadata and controls
137 lines (123 loc) · 5.08 KB
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
136
137
# 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:
workflow_dispatch:
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:
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' || github.event_name == 'merge_group'
uses: ./.github/workflows/changes.yml
with:
source: true
int_tests: true
secrets: inherit
check-secrets:
runs-on: ubuntu-latest
outputs:
can_access_secrets: ${{ steps.secret_check.outputs.can_access_secrets }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Determine if secrets are defined (PR author is team member)
id: secret_check
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 "can_access_secrets=true" >> $GITHUB_OUTPUT
else
echo "can_access_secrets=false" >> $GITHUB_OUTPUT
fi
integration-tests:
runs-on: ubuntu-24.04
needs:
- changes
- check-secrets
if: ${{ !failure() && !cancelled() && (needs.check-secrets.outputs.can_access_secrets == 'true' || github.event_name == 'merge_group') }}
strategy:
matrix:
# TODO: Add "splunk" back once https://github.com/vectordotdev/vector/issues/23474 is fixed.
# If you modify this list, please also update the `int_tests` job in changes.yml.
service: [
"amqp", "appsignal", "axiom", "aws", "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", "webhdfs"
]
timeout-minutes: 90
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: "recursive"
- name: Download JSON artifact from changes.yml
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
with:
name: int_tests_changes
- name: Run Integration Tests for ${{ matrix.service }}
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 30
max_attempts: 3
command: |
if [[ -f int_tests_changes.json ]]; then
# Parse the JSON and check if the specific integration test should run.
should_run=$(jq -r '."${{ matrix.service }}" // false' int_tests_changes.json)
else
# The `changes` job did not run (manual run) or the file is missing, default to false.
should_run=false
fi
# Check if any of the three conditions is true
if [[ "${{ github.event_name }}" == "merge_group" || \
"${{ github.event_name }}" == "workflow_dispatch" || \
"${{ needs.changes.outputs.dependencies }}" == "true" || \
"$should_run" == "true" ]]; then
# Only install dep if test runs
bash scripts/environment/prepare.sh --modules=datadog-ci
echo "Running test for ${{ matrix.service }}"
bash scripts/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:
- integration-tests
env:
FAILED: ${{ contains(needs.*.result, 'failure') }}
steps:
- run: |
echo "failed=${{ env.FAILED }}"
if [[ "$FAILED" == "true" ]] ; then
exit 1
else
exit 0
fi