Repository navigation
96 lines (87 loc) · 3.72 KB
/
Copy pathsamples-e2e.yml
File metadata and controls
96 lines (87 loc) · 3.72 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
name: Sample E2E
on:
pull_request:
paths:
- "samples/**"
- "tests/samples/**"
- "api/**"
- "task/**"
- "client/**"
- "durabletaskscheduler/**"
- "exporthistory/**"
- "payload/**"
- "internal/**"
- "cmd/orchestratorvet/**"
- "go.mod"
- "go.sum"
- ".github/workflows/samples-e2e.yml"
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
samples:
runs-on: ubuntu-latest
timeout-minutes: 25
env:
DTS_CONNECTION_STRING: "Endpoint=http://127.0.0.1:8080;TaskHub=default;Authentication=None"
DTS_SAMPLES_E2E: "1"
DTS_SAMPLES_RACE: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.25.x"
- name: Start isolated DTS
run: |
docker run -d --name sample-dts \
-p 127.0.0.1:8080:8080 -p 127.0.0.1:8082:8082 \
-e DTS_TASK_HUB_NAMES=default \
mcr.microsoft.com/dts/dts-emulator:latest@sha256:361323065a608d605f9d3ae56b854eb11f1c47fcc16845a37f948f03ca9c5fac
curl --fail --retry 30 --retry-delay 1 --retry-all-errors http://127.0.0.1:8082/ >/dev/null
- name: Start isolated blob storage
shell: bash
run: |
key="$(openssl rand -base64 32)"
echo "::add-mask::$key"
export AZURITE_ACCOUNTS="sampleacct:$key"
docker run -d --name sample-azurite \
-p 127.0.0.1:10000:10000 -e AZURITE_ACCOUNTS \
mcr.microsoft.com/azure-storage/azurite:3.37.0
connection="DefaultEndpointsProtocol=http;AccountName=sampleacct;AccountKey=$key;BlobEndpoint=http://127.0.0.1:10000/sampleacct;"
echo "::add-mask::$connection"
printf 'AZURE_STORAGE_CONNECTION_STRING=%s\n' "$connection" >> "$GITHUB_ENV"
printf 'DTS_SAMPLE_ALLOW_INSECURE_STORAGE=1\nDTS_SAMPLE_ISOLATED_TASKHUB=1\n' >> "$GITHUB_ENV"
timeout 60 bash -c 'until </dev/tcp/127.0.0.1/10000; do sleep 1; done'
- name: Start trace collector
run: |
mkdir -p "$RUNNER_TEMP/sample-traces"
docker run -d --name sample-collector \
--user "$(id -u):$(id -g)" \
-p 127.0.0.1:4318:4318 \
-e OTEL_CAPTURE_FILE=/output/traces.json \
-v "$GITHUB_WORKSPACE/samples/distributedtracing/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml:ro" \
-v "$RUNNER_TEMP/sample-traces:/output" \
otel/opentelemetry-collector-contrib:0.160.0
printf 'OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318\nOTEL_CAPTURE_FILE=%s/sample-traces/traces.json\n' \
"$RUNNER_TEMP" >> "$GITHUB_ENV"
timeout 60 bash -c 'until </dev/tcp/127.0.0.1/4318; do sleep 1; done'
- name: Execute and verify sample entry points
# Azure authentication and hub-wide maintenance run separately on approved targets.
run: >-
go test ./tests/samples -run 'TestSampleCatalogue|TestSamplesE2E'
-skip '^TestSamplesE2E/(authentication|serviceoperations)$'
-count=1 -timeout=20m -v
- name: Service diagnostics
if: failure()
run: |
docker logs sample-dts
if docker inspect sample-azurite >/dev/null 2>&1; then docker logs sample-azurite; fi
if docker inspect sample-collector >/dev/null 2>&1; then docker logs sample-collector; fi
- name: Stop owned services
if: always()
run: |
for service in sample-dts sample-azurite sample-collector; do
if docker inspect "$service" >/dev/null 2>&1; then docker rm -f "$service"; fi
done