Skip to content

Commit e0f4ccf

Browse files
committed
tests: Initial Integration Tests
Heavily inspired by the already existing integration tests from Icinga DB, the icinga-testing project was extended to support Icinga Notifications[0]. Based on those changes, an initial integration test was implemented for Icinga Notifications, currently just launching PostgreSQL, Icinga 2, and Icinga Notifications, waiting for Icinga Notifications to scan the available channels and write them into the database. [0] Icinga/icinga-testing#25
1 parent 11f3fdd commit e0f4ccf

File tree

5 files changed

+481
-0
lines changed

5 files changed

+481
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Integration Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'support/*'
8+
- 'init-integration-tests' # TODO: remove as this is the PR branch
9+
pull_request: {}
10+
schedule:
11+
- cron: '42 23 * * *'
12+
13+
jobs:
14+
integration-tests:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version: stable
21+
- name: Run Integration Tests
22+
run: ./test.sh
23+
working-directory: tests/
24+
- name: Compress Debug Log
25+
if: ${{ always() }}
26+
run: xz -9 ./tests/tmp/debug.log
27+
- name: Upload Debug Log
28+
if: ${{ always() }}
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: debug.log.xz
32+
path: ./tests/tmp/debug.log.xz
33+
retention-days: 1

tests/go.mod

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module github.com/icinga/icinga-notifications/tests
2+
3+
go 1.21
4+
5+
replace github.com/icinga/icinga-testing => github.com/oxzi/icinga-testing v0.0.0-20231220141937-686d5c9faef9
6+
7+
require (
8+
github.com/icinga/icinga-testing v0.0.0-20220516144008-9600081b7a69
9+
github.com/jmoiron/sqlx v1.3.5
10+
github.com/stretchr/testify v1.8.4
11+
)
12+
13+
require (
14+
github.com/Icinga/go-libs v0.0.0-20220420130327-ef58ad52edd8 // indirect
15+
github.com/Microsoft/go-winio v0.6.1 // indirect
16+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
17+
github.com/davecgh/go-spew v1.1.1 // indirect
18+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
19+
github.com/distribution/reference v0.5.0 // indirect
20+
github.com/docker/distribution v2.8.3+incompatible // indirect
21+
github.com/docker/docker v24.0.7+incompatible // indirect
22+
github.com/docker/go-connections v0.4.0 // indirect
23+
github.com/docker/go-units v0.5.0 // indirect
24+
github.com/go-redis/redis/v8 v8.11.5 // indirect
25+
github.com/go-sql-driver/mysql v1.7.1 // indirect
26+
github.com/gogo/protobuf v1.3.2 // indirect
27+
github.com/lib/pq v1.10.9 // indirect
28+
github.com/opencontainers/go-digest v1.0.0 // indirect
29+
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
30+
github.com/pkg/errors v0.9.1 // indirect
31+
github.com/pmezard/go-difflib v1.0.0 // indirect
32+
go.uber.org/multierr v1.11.0 // indirect
33+
go.uber.org/zap v1.26.0 // indirect
34+
golang.org/x/mod v0.14.0 // indirect
35+
golang.org/x/net v0.19.0 // indirect
36+
golang.org/x/sync v0.5.0 // indirect
37+
golang.org/x/sys v0.15.0 // indirect
38+
golang.org/x/tools v0.16.1 // indirect
39+
gopkg.in/yaml.v3 v3.0.1 // indirect
40+
)

0 commit comments

Comments
 (0)