forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (135 loc) · 5.69 KB
/
e2e-tests-windows.yml
File metadata and controls
141 lines (135 loc) · 5.69 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
138
139
140
141
name: e2e-tests-windows
on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
paths-ignore:
- "**/README.md"
pull_request:
paths-ignore:
- "**/README.md"
types: [opened, synchronize, reopened, labeled]
merge_group:
permissions:
contents: read
env:
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
jobs:
collector-build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-11-arm]
runs-on: ${{ matrix.os }}
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- run: ./.github/workflows/scripts/free-disk-space.sh
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
id: go-setup
with:
go-version: oldstable
cache-dependency-path: "**/*.sum"
- name: Install dependencies
if: steps.go-setup.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.go-setup.outputs.cache-hit != 'true'
run: make install-tools
- name: Generate otelcontribcol files
run: make genotelcontribcol
- name: Build Collector
run: make otelcontribcol
- name: Upload Collector Binary
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
with:
name: collector-binary-${{ matrix.os == 'windows-11-arm' && 'arm64' || 'amd64' }}
path: ./bin/*
- run: ./.github/workflows/scripts/check-disk-space.sh
supervisor-test:
strategy:
fail-fast: false
matrix:
os: [windows-2025, windows-11-arm]
runs-on: ${{ matrix.os }}
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') }}
env:
# The gcc installed on the Windows arm64 runner doesn't ship native ARM libraries so we need to disable CGO.
CGO_ENABLED: ${{ matrix.os == 'windows-11-arm' && '0' || '' }}
needs: [collector-build]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- run: ./.github/workflows/scripts/free-disk-space.sh
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
id: go-setup
with:
go-version: oldstable
cache-dependency-path: "**/*.sum"
- name: Install dependencies
if: steps.go-setup.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.go-setup.outputs.cache-hit != 'true'
run: make install-tools
- name: Download Collector Binary
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
with:
name: collector-binary-${{ matrix.os == 'windows-11-arm' && 'arm64' || 'amd64' }}
path: bin/
- name: Run opampsupervisor e2e tests
run: |
cd cmd/opampsupervisor
go test -v --tags=e2e
- run: ./.github/workflows/scripts/check-disk-space.sh
windows-supervisor-service-test:
strategy:
fail-fast: false
matrix:
os: [windows-2025, windows-11-arm]
runs-on: ${{ matrix.os }}
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push' || github.event_name == 'merge_group') }}
needs: [collector-build]
steps:
- name: Checkout Repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- run: ./.github/workflows/scripts/free-disk-space.sh
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
id: go-setup
with:
go-version: oldstable
cache-dependency-path: "**/*.sum"
- name: Install dependencies
if: steps.go-setup.outputs.cache-hit != 'true'
run: make -j2 gomoddownload
- name: Install Tools
if: steps.go-setup.outputs.cache-hit != 'true'
run: make install-tools
- name: Ensure required ports in the dynamic range are available
run: |
& ${{ github.workspace }}\.github\workflows\scripts\win-required-ports.ps1
- name: Download Collector Binary
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
with:
name: collector-binary-${{ matrix.os == 'windows-11-arm' && 'arm64' || 'amd64' }}
path: bin/
- name: Build supervisor
run: cd cmd/opampsupervisor; go build
- name: Install supervisor as a service
run: |
New-Service -Name "opampsupervisor" -StartupType "Manual" -BinaryPathName "`"${PWD}\cmd\opampsupervisor`" --config `"${PWD}\cmd\opampsupervisor\supervisor\testdata\supervisor_windows_service_test_config.yaml`""
eventcreate.exe /t information /id 1 /l application /d "Creating event provider for 'opampsupervisor'" /so opampsupervisor
- name: Test supervisor service
working-directory: ${{ github.workspace }}/cmd/opampsupervisor
run: |
go test -timeout 90s -run ^TestSupervisorAsService$ -v -tags=win32service
- name: Remove opampsupervisor service
if: always()
run: |
Remove-Service opampsupervisor
Remove-Item HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Application\opampsupervisor
- run: ./.github/workflows/scripts/check-disk-space.sh