-
Notifications
You must be signed in to change notification settings - Fork 1
697 lines (606 loc) · 23.5 KB
/
ci.yaml
File metadata and controls
697 lines (606 loc) · 23.5 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
name: CI
on:
push:
branches: [main]
paths-ignore:
- "CHANGELOG.md"
- "docs/observability.md"
- "charts/loki-vl-proxy/Chart.yaml"
- "README.md"
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify dashboard and alerting assets are synced to chart
run: ./scripts/ci/sync_observability_assets.sh --check
- name: Unit tests (quality gate policy)
run: python3 -m unittest scripts.ci.tests.test_check_quality_gate scripts.ci.tests.test_check_changelog_pr
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Govulncheck
run: go run golang.org/x/vuln/cmd/govulncheck@latest ./...
- name: Unit tests
run: go test ./... -count=1 -race -coverprofile=coverage.out
- name: Coverage report
run: go tool cover -func=coverage.out | tail -1
- name: Cache package coverage guard
run: |
set -euo pipefail
go test ./internal/cache -coverprofile=coverage-cache.out -count=1 >/dev/null
cache_cov="$(go tool cover -func=coverage-cache.out | awk 'END {gsub("%","",$3); print $3}')"
echo "internal/cache coverage: ${cache_cov}%"
awk -v cov="${cache_cov}" 'BEGIN {
min=79.0
if (cov+0 < min) {
printf "FAIL: internal/cache coverage %.2f%% is below guard %.1f%%\n", cov+0, min
exit 1
}
}'
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
coverage.out
coverage-cache.out
tuple-contract:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- name: Tuple contract gate (default 2-tuple + categorize-labels 3-tuple)
run: go test ./internal/proxy -run '^TestTupleContract_' -count=1
fuzz-smoke:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- name: Fuzz smoke (structured metadata normalization)
run: go test ./internal/proxy -run '^$' -fuzz=FuzzNormalizeMetadataPairsFromJSON -fuzztime=5s
- name: Fuzz smoke (merged categorized stream contract)
run: go test ./internal/proxy -run '^$' -fuzz=FuzzMergeLokiQueryResponsesStructuredMetadataContract -fuzztime=5s
tuple-smoke:
runs-on: ubuntu-latest
needs: [test]
env:
PROXY_IMAGE: loki-vl-proxy:tuple-smoke
PROXY_URL: http://127.0.0.1:3100
PROXY_URL_CATEGORIZED: http://127.0.0.1:3102
SMOKE_QUERY: '{app="e2e-test"}'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
tags: ${{ env.PROXY_IMAGE }}
load: true
cache-from: type=gha,scope=e2e-proxy
cache-to: type=gha,mode=max,scope=e2e-proxy
- name: Start e2e stack
working-directory: test/e2e-compat
run: |
for attempt in 1 2 3; do
if docker compose up -d --no-build; then
break
fi
if [ "$attempt" -eq 3 ]; then
echo "docker compose up failed after ${attempt} attempts"
exit 1
fi
echo "docker compose up failed (attempt ${attempt}), retrying in 10s..."
sleep 10
done
../../scripts/ci/wait_e2e_stack.sh 180
- name: Seed smoke data
run: go test -v -tags=e2e -run '^TestSetup_IngestLogs$' ./test/e2e-compat/
- name: Run tuple smoke script
run: ./scripts/smoke-test.sh
- name: Tear down e2e stack
if: always()
working-directory: test/e2e-compat
run: docker compose down -v
bench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- name: Run benchmarks
run: |
go test ./internal/proxy/ -bench . -benchmem -run "^$" -count=3 -timeout=120s \
| tee bench-results.txt
- name: Run label/field scale benchmarks (regression guard)
run: |
go test ./internal/proxy/ -run "^$" -bench 'BenchmarkProxy_Label(Keys|Values)_Scale_' -benchmem -count=1 -benchtime=200ms \
| tee bench-label-fields.txt
awk '
/^BenchmarkProxy_Label(Keys|Values)_Scale_.*ns\/op/ {
bench=$1
sub(/-[0-9]+$/, "", bench)
# go test benchmark line format:
# BenchmarkXxx-4 12345 999.9 ns/op 321 B/op 7 allocs/op
printf "%s\t%s\t%s\t%s\n", bench, $3, $5, $7
}
' bench-label-fields.txt > bench-label-fields.tsv
expected=12
actual=$(wc -l < bench-label-fields.tsv | tr -d " ")
if [ "$actual" -ne "$expected" ]; then
echo "FAIL: expected ${expected} parsed benchmark rows, got ${actual}"
cat bench-label-fields.tsv
exit 1
fi
awk -F'\t' '
BEGIN { fail=0 }
{
name=$1
ns=$2+0
size=0
tmp=name
sub(/^.*_/, "", tmp)
if (tmp ~ /^[0-9]+$/) {
size=tmp+0
}
# Scale-aware catastrophic bounds:
# smaller sets should stay tighter, large sets get wider headroom.
# LabelKeys cache-bypass at 10k keys may run in the low single-digit ms
# range on noisy shared runners due to large slice materialization/sort;
# keep this guard catastrophic (regression detection), not flaky.
limit=100000
if (size <= 10) {
limit=50000
} else if (size <= 100) {
limit=100000
} else if (size <= 1000) {
limit=250000
} else if (size > 1000) {
limit=600000
}
if (name ~ /BenchmarkProxy_LabelKeys_Scale_CacheBypass\/keys_10000$/) {
limit=3000000
}
if (ns > limit) {
printf "FAIL: %s exceeded ns/op threshold %.0f (got %.2f)\n", name, limit, ns
fail=1
}
}
END { exit fail }
' bench-label-fields.tsv
- name: Publish label/field benchmark summary
run: |
{
echo "### Label/Field Scale Benchmarks"
echo ""
echo "| Benchmark | ns/op | B/op | allocs/op |"
echo "|---|---:|---:|---:|"
awk -F'\t' '{printf "| `%s` | %s | %s | %s |\n", $1, $2, $3, $4}' bench-label-fields.tsv
} >> "$GITHUB_STEP_SUMMARY"
- name: Run patterns scale benchmarks (regression guard)
run: |
go test ./internal/proxy/ -run "^$" -bench 'BenchmarkProxy_Patterns_Scale_' -benchmem -count=1 -benchtime=200ms \
| tee bench-patterns.txt
awk '
/^BenchmarkProxy_Patterns_Scale_.*ns\/op/ {
bench=$1
sub(/-[0-9]+$/, "", bench)
printf "%s\t%s\t%s\t%s\n", bench, $3, $5, $7
}
' bench-patterns.txt > bench-patterns.tsv
expected=6
actual=$(wc -l < bench-patterns.tsv | tr -d " ")
if [ "$actual" -ne "$expected" ]; then
echo "FAIL: expected ${expected} parsed pattern benchmark rows, got ${actual}"
cat bench-patterns.tsv
exit 1
fi
awk -F'\t' '
BEGIN {
fail=0
# Small synthetic scales can invert by a few percent on shared runners.
# Keep the guard strict for real regressions, but tolerate minor noise.
slowdown_tolerance=1.10
}
{
name=$1
ns=$2+0
scale=name
sub(/^.*\/lines_/, "", scale)
if (name ~ /CacheBypass/) {
bypass[scale]=ns
} else if (name ~ /CacheHit/) {
hit[scale]=ns
}
}
END {
for (s in bypass) {
if (!(s in hit)) {
printf "FAIL: missing cache-hit benchmark for lines_%s\n", s
fail=1
continue
}
ratio=hit[s] / bypass[s]
if (ratio > slowdown_tolerance) {
printf "FAIL: cache hit is materially slower than bypass for lines_%s (hit=%.2f ns/op bypass=%.2f ns/op ratio=%.3f tolerance=%.2f)\n", s, hit[s], bypass[s], ratio, slowdown_tolerance
fail=1
} else if (ratio >= 1) {
printf "WARN: cache hit is slightly slower than bypass for lines_%s but within runner-noise tolerance (hit=%.2f ns/op bypass=%.2f ns/op ratio=%.3f)\n", s, hit[s], bypass[s], ratio
}
}
exit fail
}
' bench-patterns.tsv
- name: Publish patterns benchmark summary
run: |
{
echo "### Patterns Scale Benchmarks"
echo ""
echo "| Benchmark | ns/op | B/op | allocs/op |"
echo "|---|---:|---:|---:|"
awk -F'\t' '{printf "| `%s` | %s | %s | %s |\n", $1, $2, $3, $4}' bench-patterns.tsv
} >> "$GITHUB_STEP_SUMMARY"
- name: Run cache benchmarks (regression guard)
run: |
go test ./internal/cache -run "^$" -bench 'BenchmarkCache_(Get_Hit|SetWithTTL|TopHotKeys)$|BenchmarkPeerCache_(ThreePeers_ShadowCopyHit|ReadAheadCycle_Bounded)$' -benchmem -count=1 -benchtime=200ms \
| tee bench-cache.txt
awk '
/^Benchmark(Cache_Get_Hit|Cache_SetWithTTL|Cache_TopHotKeys|PeerCache_ThreePeers_ShadowCopyHit|PeerCache_ReadAheadCycle_Bounded)-[0-9]+/ {
bench=$1
sub(/-[0-9]+$/, "", bench)
printf "%s\t%s\t%s\t%s\n", bench, $3, $5, $7
}
' bench-cache.txt > bench-cache.tsv
expected=5
actual=$(wc -l < bench-cache.tsv | tr -d " ")
if [ "$actual" -ne "$expected" ]; then
echo "FAIL: expected ${expected} parsed cache benchmark rows, got ${actual}"
cat bench-cache.tsv
exit 1
fi
awk -F'\t' '
BEGIN {
fail=0
}
{
name=$1
ns=$2+0
b=$3+0
a=$4+0
if (name ~ /BenchmarkCache_Get_Hit$/ && ns > 2000) {
printf "FAIL: %s exceeded ns/op threshold 2000 (got %.2f)\n", name, ns
fail=1
}
if (name ~ /BenchmarkCache_SetWithTTL$/ && ns > 3000) {
printf "FAIL: %s exceeded ns/op threshold 3000 (got %.2f)\n", name, ns
fail=1
}
if (name ~ /BenchmarkPeerCache_ThreePeers_ShadowCopyHit$/ && ns > 3000) {
printf "FAIL: %s exceeded ns/op threshold 3000 (got %.2f)\n", name, ns
fail=1
}
if (name ~ /BenchmarkCache_TopHotKeys$/) {
if (ns > 15000000) {
printf "FAIL: %s exceeded ns/op threshold 15000000 (got %.2f)\n", name, ns
fail=1
}
if (b > 10000000) {
printf "FAIL: %s exceeded B/op threshold 10000000 (got %.0f)\n", name, b
fail=1
}
if (a > 200) {
printf "FAIL: %s exceeded allocs/op threshold 200 (got %.0f)\n", name, a
fail=1
}
}
if (name ~ /BenchmarkPeerCache_ReadAheadCycle_Bounded$/) {
if (ns > 25000000) {
printf "FAIL: %s exceeded ns/op threshold 25000000 (got %.2f)\n", name, ns
fail=1
}
if (b > 12000000) {
printf "FAIL: %s exceeded B/op threshold 12000000 (got %.0f)\n", name, b
fail=1
}
if (a > 5000) {
printf "FAIL: %s exceeded allocs/op threshold 5000 (got %.0f)\n", name, a
fail=1
}
}
}
END { exit fail }
' bench-cache.tsv
- name: Publish cache benchmark summary
run: |
{
echo "### Cache Benchmarks"
echo ""
echo "| Benchmark | ns/op | B/op | allocs/op |"
echo "|---|---:|---:|---:|"
awk -F'\t' '{printf "| `%s` | %s | %s | %s |\n", $1, $2, $3, $4}' bench-cache.tsv
} >> "$GITHUB_STEP_SUMMARY"
- name: Run load tests
run: |
go test ./internal/proxy/ -run "TestLoad" -v -timeout=120s -count=1 \
| tee load-results.txt
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmarks
path: |
bench-results.txt
bench-label-fields.txt
bench-label-fields.tsv
bench-patterns.txt
bench-patterns.tsv
bench-cache.txt
bench-cache.tsv
load-results.txt
- name: Check for performance regressions
run: |
# Extract key metrics and fail if below thresholds
echo "=== Benchmark Summary ==="
grep "Benchmark" bench-results.txt | head -10
echo ""
echo "=== Load Test Summary ==="
grep -E "Throughput|Errors|Live heap" load-results.txt
# Fail if high-concurrency test has errors
if grep -q "Errors: [1-9]" load-results.txt; then
echo "FAIL: Load test had errors"
exit 1
fi
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.11.4
args: --timeout=5m
docker:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t loki-vl-proxy:test .
- name: Verify binary runs
run: |
docker run --rm loki-vl-proxy:test -help 2>&1 || true
e2e-compat-group:
runs-on: ubuntu-latest
needs: [test]
env:
PROXY_IMAGE: loki-vl-proxy:e2e-ci
strategy:
fail-fast: false
matrix:
group:
- name: core
pattern: '^(TestSetup_IngestLogs|TestCompat_.*|TestExtended_.*|TestChaining_.*|TestAlertingCompat_.*|TestExplore_HTTPQueryRangeContracts|TestLokiFunctions_.*|TestGrafanaDatasourceCatalogAndHealth|TestProxyCompatibilitySurface|TestPinnedCompatibilityMatrixMatchesCompose)$'
- name: drilldown
pattern: '^(TestSetup_IngestLogs|TestDrilldown_.*|TestFeature_(IndexStats|IndexVolume|IndexVolumeRange|DrilldownClusterLevelOrFilters|MultitenantDrilldownClusterLevelOrFilters)|TestDrilldownTrackScore|TestLokiTrackScore|TestVLTrackScore)$'
- name: otel-edge
pattern: '^(TestSetup_IngestEdgeCaseData|TestSetup_IngestRichData|TestOTel.*|TestStructuredMetadata_.*|TestQueryDirection_UnderscoreProxy|TestDetectedFields_UnderscoreProxy|TestSeries_UnderscoreProxy|TestMixedLabels_UnderscoreProxy|TestLokiVsProxy_LabelParity|TestGrafanaDrilldown_UnderscoreProxy|TestLabelDeduplication|TestLabelTranslation_EdgeCases|TestOTelCompatibilityScore|TestEdge_.*|TestComplex_.*)$'
- name: tail-multitenancy
pattern: '^(TestSetup_IngestLogs|TestFeature_Multitenancy_.*|TestFeature_AdminDebugEndpoints_DefaultClosed|TestFeature_Tail_.*|TestFeature_QueryAnalytics_Endpoint|TestFeature_SecurityHeaders|TestFeature_MetricsEndpoint|TestFeature_GzipCompression|TestFeature_NoGzipWithoutAccept|TestFeature_DerivedFields_TraceIDInJSON|TestFeature_ResponseStructureConsistency|TestFeature_QueryRange_vs_Query_Consistency|TestFeature_InstantVectorExpression_Compatibility|TestEdge_ConcurrentIdenticalQueries|TestEdge_LongQueryString|TestEdge_CombinedFilterTypes|TestEdge_EmptyResults|TestEdge_RapidSequentialQueries|TestEdge_InstantQuery)$'
name: e2e-compat (${{ matrix.group.name }})
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
tags: ${{ env.PROXY_IMAGE }}
load: true
cache-from: type=gha,scope=e2e-proxy
cache-to: type=gha,mode=max,scope=e2e-proxy
- name: Start e2e stack
working-directory: test/e2e-compat
run: |
docker compose up -d --no-build
../../scripts/ci/wait_e2e_stack.sh 180
- name: Run compatibility tests
id: compat
run: |
set -euo pipefail
OUTPUT="$(go test -v -tags=e2e -timeout=150s -count=1 -run '${{ matrix.group.pattern }}' ./test/e2e-compat/ 2>&1)" || status=$?
status="${status:-0}"
echo "$OUTPUT"
# Extract all compatibility scores and compute overall
SCORES=$(echo "$OUTPUT" | grep -oP 'Score: \K\d+/\d+ \(\d+\.\d+%\)' || true)
TOTAL_PASS=0
TOTAL_ALL=0
while IFS= read -r line; do
PASS=$(echo "$line" | grep -oP '^\d+')
ALL=$(echo "$line" | grep -oP '/\K\d+')
TOTAL_PASS=$((TOTAL_PASS + PASS))
TOTAL_ALL=$((TOTAL_ALL + ALL))
done <<< "$SCORES"
if [ "$TOTAL_ALL" -gt 0 ]; then
PCT=$(echo "scale=1; $TOTAL_PASS * 100 / $TOTAL_ALL" | bc)
echo "COMPAT_PCT=${PCT}%" >> "$GITHUB_OUTPUT"
echo "COMPAT_DETAIL=${TOTAL_PASS}/${TOTAL_ALL}" >> "$GITHUB_OUTPUT"
echo "Compatibility: ${TOTAL_PASS}/${TOTAL_ALL} (${PCT}%)"
else
echo "COMPAT_PCT=N/A" >> "$GITHUB_OUTPUT"
echo "COMPAT_DETAIL=no tests ran" >> "$GITHUB_OUTPUT"
fi
exit "$status"
- name: Tear down e2e stack
if: always()
working-directory: test/e2e-compat
run: docker compose down -v
e2e-compat:
runs-on: ubuntu-latest
needs: [e2e-compat-group]
if: always()
steps:
- name: Aggregate grouped compat result
run: |
if [ "${{ needs.e2e-compat-group.result }}" != "success" ]; then
echo "One or more grouped e2e-compat checks failed"
exit 1
fi
e2e-fleet:
runs-on: ubuntu-latest
needs: [test]
env:
PROXY_IMAGE: loki-vl-proxy:fleet-ci
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
tags: ${{ env.PROXY_IMAGE }}
load: true
cache-from: type=gha,scope=fleet-proxy
cache-to: type=gha,mode=max,scope=fleet-proxy
- name: Start 3-proxy fleet
working-directory: test/e2e-fleet
run: |
docker compose up -d --no-build --wait --wait-timeout 180
docker compose ps
- name: Run fleet cache smoke tests
run: go test -v -tags=e2e -timeout=120s -run '^TestFleetSmoke_QueryRangeWarmHitIncrementsCacheMetrics$' ./test/e2e-fleet/
- name: Tear down fleet
if: always()
working-directory: test/e2e-fleet
run: docker compose down -v
e2e-ui:
runs-on: ubuntu-latest
needs: [test]
env:
PROXY_IMAGE: loki-vl-proxy:e2e-ui
strategy:
fail-fast: false
matrix:
shard:
- name: datasource
command: tests/datasource.spec.ts
- name: explore-core
command: --grep @explore-core
- name: explore-tail
command: --grep @explore-tail
- name: drilldown-core
command: --grep @drilldown-core
- name: drilldown-multitenant
command: --grep @drilldown-mt
name: e2e-ui (${{ matrix.shard.name }})
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.2"
cache: true
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: test/e2e-ui/package-lock.json
- uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-ms-playwright-${{ hashFiles('test/e2e-ui/package-lock.json') }}
restore-keys: |
${{ runner.os }}-ms-playwright-
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
tags: ${{ env.PROXY_IMAGE }}
load: true
cache-from: type=gha,scope=e2e-proxy
cache-to: type=gha,mode=max,scope=e2e-proxy
- name: Start e2e stack
working-directory: test/e2e-compat
run: |
docker compose up -d --no-build
../../scripts/ci/wait_e2e_stack.sh 180
- name: Resolve UI browser
run: |
CHROME_BIN="$(command -v google-chrome || command -v google-chrome-stable || command -v chromium || command -v chromium-browser || true)"
if [ -n "$CHROME_BIN" ]; then
echo "PLAYWRIGHT_EXECUTABLE_PATH=$CHROME_BIN" >> "$GITHUB_ENV"
echo "Using runner browser at $CHROME_BIN"
else
echo "No system Chrome/Chromium binary found; falling back to Playwright browser download"
fi
- name: Install UI test dependencies
working-directory: test/e2e-ui
run: |
npm ci
if [ -z "${PLAYWRIGHT_EXECUTABLE_PATH:-}" ]; then
npx playwright install chromium
fi
- name: Run Grafana UI e2e tests
working-directory: test/e2e-ui
env:
GRAFANA_URL: http://127.0.0.1:3002
PROXY_URL: http://127.0.0.1:3100
run: npx playwright test ${{ matrix.shard.command }}
- name: Upload Playwright artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.shard.name }}
path: |
test/e2e-ui/playwright-report
test/e2e-ui/test-results
if-no-files-found: ignore
- name: Tear down e2e stack
if: always()
working-directory: test/e2e-compat
run: docker compose down -v
helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
- name: Helm lint
run: helm lint charts/loki-vl-proxy/
- name: Helm template quoted args regression
run: helm template loki-vl-proxy charts/loki-vl-proxy -f scripts/ci/helm-quoted-args-values.yaml >/dev/null
- name: Helm template env alias regression
run: helm template loki-vl-proxy charts/loki-vl-proxy -f scripts/ci/helm-env-alias-values.yaml >/dev/null