Skip to content

Commit

Permalink
tests: Initial Integration Tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
oxzi committed Jan 9, 2024
1 parent 11f3fdd commit e0f4ccf
Show file tree
Hide file tree
Showing 5 changed files with 481 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Integration Tests

on:
push:
branches:
- main
- 'support/*'
- 'init-integration-tests' # TODO: remove as this is the PR branch
pull_request: {}
schedule:
- cron: '42 23 * * *'

jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Run Integration Tests
run: ./test.sh
working-directory: tests/
- name: Compress Debug Log
if: ${{ always() }}
run: xz -9 ./tests/tmp/debug.log
- name: Upload Debug Log
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: debug.log.xz
path: ./tests/tmp/debug.log.xz
retention-days: 1
40 changes: 40 additions & 0 deletions tests/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module github.com/icinga/icinga-notifications/tests

go 1.21

replace github.com/icinga/icinga-testing => github.com/oxzi/icinga-testing v0.0.0-20231220141937-686d5c9faef9

require (
github.com/icinga/icinga-testing v0.0.0-20220516144008-9600081b7a69
github.com/jmoiron/sqlx v1.3.5
github.com/stretchr/testify v1.8.4
)

require (
github.com/Icinga/go-libs v0.0.0-20220420130327-ef58ad52edd8 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/tools v0.16.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit e0f4ccf

Please sign in to comment.