Skip to content

Commit a646c7d

Browse files
Fix OATS workflow (#137)
- Upgrade Go to 1.24. - Remove permissions from all jobs. - Avoid warning if no error logs found. - Allow manual dispatch. - Install OATS directly instead of cloning. - Remove obsolete `version` property. - Fix port mappings - Update commands to run OATS tests. - Add a PowerShell script to run the OATS tests locally cross-platform. - Remove references to non-existent compose file. - Fix (and simplify) the ASP.NET Core dockerfile. - Fix timeout no longer being consumed from `TESTCASE_TIMEOUT` env var and instead use `--timeout` flag. - Fix collector address - Fix trace queries - Expose MSSQL port - Run for PRs - Combine the OATS tests into a single file to speed up the execution time by avoiding spinning containers up and down so much. - Pin OATS to v0.3.2 and configure renovate.
1 parent 10ad08e commit a646c7d

20 files changed

+150
-209
lines changed

.github/workflows/oats.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,49 @@ name: OATS
22

33
on:
44
push:
5-
branches: [ 'main*' ]
5+
branches: [ main ]
66
paths-ignore:
7-
- '**.md'
7+
- '**/*.gitattributes'
8+
- '**/*.gitignore'
9+
- '**/*.md'
10+
pull_request:
11+
branches: [ main ]
12+
workflow_dispatch:
13+
14+
permissions: {}
815

916
jobs:
1017
acceptance-tests:
1118
runs-on: ubuntu-latest
12-
permissions: {}
19+
timeout-minutes: 20
1320

1421
steps:
15-
- name: Check out
16-
uses: actions/checkout@v4
17-
with:
18-
persist-credentials: false
19-
- name: Check out oats
20-
uses: actions/checkout@v4
22+
23+
- name: Checkout code
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2125
with:
22-
repository: grafana/oats
23-
path: oats
26+
filter: 'tree:0'
2427
persist-credentials: false
28+
show-progress: false
29+
2530
- name: Set up Go
26-
uses: actions/setup-go@v5
31+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
2732
with:
28-
go-version: '1.22'
29-
cache-dependency-path: oats/go.sum
33+
go-version: '1.24'
34+
35+
- name: Install OATS
36+
env:
37+
# renovate: datasource=github-releases depName=oats packageName=grafana/oats
38+
OATS_VERSION: v0.3.2
39+
run: go install "github.com/grafana/oats@${OATS_VERSION}"
40+
3041
- name: Run acceptance tests
31-
run: ./scripts/run-oats-tests.sh
32-
- name: upload log file
33-
uses: actions/upload-artifact@v4
42+
run: oats --timeout=5m ./docker/docker-compose-aspnetcore
43+
44+
- name: Upload log file
45+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3446
if: failure()
3547
with:
3648
name: docker-compose.log
3749
path: oats/yaml/build/**/output.log
50+
if-no-files-found: ignore

docker/docker-compose-aspnetcore/attributes/oats-template.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

docker/docker-compose-aspnetcore/attributes/oats.default-resource-attributes.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

docker/docker-compose-aspnetcore/docker-compose.oats.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
version: '3.4'
2-
31
services:
42
aspnetcore:
53
image: ${DOCKER_REGISTRY-}aspnetcore
64
build:
75
context: ../..
86
dockerfile: examples/net8.0/aspnetcore/Dockerfile
97
environment:
10-
- OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
8+
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
119
ports:
12-
- "5000:80"
13-
- "8080:80" # for OATs
10+
- "5000:8080"
11+
- "8080:8080" # for OATs
1412
depends_on:
1513
- redis
1614
- mssql
@@ -25,6 +23,8 @@ services:
2523
retries: 5
2624
mssql:
2725
image: mcr.microsoft.com/mssql/server:2022-latest
26+
ports:
27+
- "1433:1433"
2828
environment:
2929
- ACCEPT_EULA=Y
3030
- MSSQL_SA_PASSWORD=Password12345%%
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
version: '3.4'
2-
31
services:
42
aspnetcore:
53
environment:
64
- ASPNETCORE_ENVIRONMENT=Development
75
ports:
8-
- "80"
6+
- "8080"

docker/docker-compose-aspnetcore/docker-compose.self-contained.oats.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
version: '3.4'
2-
31
services:
42
aspnetcore:
53
image: ${DOCKER_REGISTRY-}aspnetcore
64
build:
75
context: ../..
8-
dockerfile: examples/net6.0/aspnetcore/Dockerfile
6+
dockerfile: examples/net8.0/aspnetcore/Dockerfile
97
args:
108
DOTNET_PUBLISH_ARGS: "--self-contained true /p:PublishSingleFile=true"
119
entrypoint: ./aspnetcore
1210
environment:
13-
- OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
11+
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
1412
ports:
15-
- "5000:80"
16-
- "8080:80" # for OATs
13+
- "5000:8080"
14+
- "8080:8080" # for OATs
1715
depends_on:
1816
- redis
1917
- mssql
@@ -28,6 +26,8 @@ services:
2826
retries: 5
2927
mssql:
3028
image: mcr.microsoft.com/mssql/server:2022-latest
29+
ports:
30+
- "1433:1433"
3131
environment:
3232
- ACCEPT_EULA=Y
3333
- MSSQL_SA_PASSWORD=Password12345%%
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.4'
2-
31
services:
42
aspnetcore:
53
image: ${DOCKER_REGISTRY-}aspnetcore
@@ -9,12 +7,16 @@ services:
97
depends_on:
108
- redis
119
- mssql
10+
ports:
11+
- "8080:8080" # for OATs
1212
redis:
1313
image: redis:7.2
1414
ports:
1515
- "6379:6379"
1616
mssql:
1717
image: mcr.microsoft.com/mssql/server:2022-latest
18+
ports:
19+
- "1433:1433"
1820
environment:
1921
- ACCEPT_EULA=Y
2022
- MSSQL_SA_PASSWORD=Password12345%%

docker/docker-compose-aspnetcore/http/oats-template.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

docker/docker-compose-aspnetcore/http/oats.http-get.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

docker/docker-compose-aspnetcore/http/oats.http-geterror.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)