Skip to content

Commit c32fa38

Browse files
Copilotfredbi
andauthored
Separate integration tests into standalone workflow with build tag (#166)
* Initial plan * Add build tag and standalone workflow for integration tests - Add //go:build testintegration to all test files in internal/testintegration/ - Create .github/workflows/integration-test.yml as standalone workflow - Matrix: linux + windows, stable Go only (2 jobs) - No -race, no fuzz, no test report - Coverage upload via artifacts Co-authored-by: fredbi <14262513+fredbi@users.noreply.github.com> * Final state: integration test workflow and build tags Co-authored-by: fredbi <14262513+fredbi@users.noreply.github.com> * Add doc.go to internal/testintegration to satisfy linter The build tag on all test files made the linter complain about no Go code in the module. Adding a doc.go with just a package declaration fixes this. Co-authored-by: fredbi <14262513+fredbi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: fredbi <14262513+fredbi@users.noreply.github.com>
1 parent 8af27e3 commit c32fa38

File tree

7 files changed

+67
-3
lines changed

7 files changed

+67
-3
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: integration test
2+
3+
permissions:
4+
pull-requests: read
5+
contents: read
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
12+
pull_request:
13+
14+
jobs:
15+
test:
16+
name: integration (${{ matrix.os }})
17+
runs-on: ${{ matrix.os }}
18+
timeout-minutes: 30
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest, windows-latest]
23+
24+
steps:
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
27+
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
28+
with:
29+
go-version: stable
30+
check-latest: true
31+
cache: true
32+
cache-dependency-path: '**/go.sum'
33+
34+
- name: Run integration tests
35+
working-directory: internal/testintegration
36+
run: >
37+
go test
38+
-v
39+
-tags testintegration
40+
-count 1
41+
-timeout 30m
42+
-coverprofile='integration.coverage.${{ matrix.os }}.out'
43+
-covermode=atomic
44+
-coverpkg=github.com/go-openapi/analysis/...
45+
./...
46+
47+
- name: Upload coverage
48+
if: always()
49+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
50+
with:
51+
path: 'internal/testintegration/*.coverage.*.out'
52+
name: 'integration.coverage.${{ matrix.os }}'
53+
retention-days: 1

internal/testintegration/doc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// Package analysis contains integration tests for the go-openapi/analysis module.
5+
package analysis

internal/testintegration/doc_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//go:build testintegration
5+
46
package analysis_test
57

68
import (

internal/testintegration/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/go-openapi/swag/conv v0.25.5 // indirect
1919
github.com/go-openapi/swag/jsonname v0.25.5 // indirect
2020
github.com/go-openapi/swag/jsonutils v0.25.5 // indirect
21-
github.com/go-openapi/swag/mangling v0.25.4 // indirect
21+
github.com/go-openapi/swag/mangling v0.25.5 // indirect
2222
github.com/go-openapi/swag/stringutils v0.25.5 // indirect
2323
github.com/go-openapi/swag/typeutils v0.25.5 // indirect
2424
github.com/go-openapi/swag/yamlutils v0.25.5 // indirect

internal/testintegration/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5 h1:SX6sE4FrGb4sEnnxbF
2222
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5/go.mod h1:/2KvOTrKWjVA5Xli3DZWdMCZDzz3uV/T7bXwrKWPquo=
2323
github.com/go-openapi/swag/loading v0.25.5 h1:odQ/umlIZ1ZVRteI6ckSrvP6e2w9UTF5qgNdemJHjuU=
2424
github.com/go-openapi/swag/loading v0.25.5/go.mod h1:I8A8RaaQ4DApxhPSWLNYWh9NvmX2YKMoB9nwvv6oW6g=
25-
github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48=
26-
github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg=
25+
github.com/go-openapi/swag/mangling v0.25.5 h1:hyrnvbQRS7vKePQPHHDso+k6CGn5ZBs5232UqWZmJZw=
26+
github.com/go-openapi/swag/mangling v0.25.5/go.mod h1:6hadXM/o312N/h98RwByLg088U61TPGiltQn71Iw0NY=
2727
github.com/go-openapi/swag/stringutils v0.25.5 h1:NVkoDOA8YBgtAR/zvCx5rhJKtZF3IzXcDdwOsYzrB6M=
2828
github.com/go-openapi/swag/stringutils v0.25.5/go.mod h1:PKK8EZdu4QJq8iezt17HM8RXnLAzY7gW0O1KKarrZII=
2929
github.com/go-openapi/swag/typeutils v0.25.5 h1:EFJ+PCga2HfHGdo8s8VJXEVbeXRCYwzzr9u4rJk7L7E=

internal/testintegration/helpers_spec_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//go:build testintegration
5+
46
package analysis_test
57

68
import (

internal/testintegration/spec_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//go:build testintegration
5+
46
package analysis_test
57

68
import (

0 commit comments

Comments
 (0)