Integration tests: don't hard-code MySQL in some tests #709
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some test cases always used a MySQL database as they didn't use the proper function which would respect the
ICINGADB_TESTS_DATABASE_TYPE=pgsql
environment variable. This commit fixes this and updates a similarly left-over error message as well.Tests
Excerpts from the GitHub Actions job artifacts (
xzgrep -E 'created (mysql|postgresql) container'
):Current
main
branchhttps://github.com/Icinga/icingadb/actions/runs/8324491540
mysql-debug.log.xz
✔️ No problem, creates only a MySQL container as expected:
pgsql-debug.log.xz
❌ Unexpectedly creates a MySQL container in addition to the expected PostgreSQL container:
This PR
https://github.com/Icinga/icingadb/actions/runs/8329451180?pr=709
mysql-debug.log.xz
✔️ Still only a MySQL container, so still no problem:
pgsql-debug.log.xz
✔️ Now fixed, no longer creates a MySQL container but just the expected PostgreSQL container:
Benchmarks
The benchmark doesn't run automatically in GitHub Actions. When running locally, it currently fails with the following error:
That's an error from the Redis client library we use as it fails to parse a protocol message. I believe this happens due to the following change to
XINFO STREAM
command in Redis 7.0:When running with
ICINGA_TESTING_REDIS_IMAGE=redis:6
, this error doesn't happen, the benchmark still doesn't work though, now it just stays at all entries pending in the stream, but that's doesn't seem to be a PostgreSQL-specific problem as it happens on MySQL as well. So the PR should fix the hard-coded MySQL problem, but a different problem remains.We currently use an outdated version of
go-redis
as the new version wasn't picked up by depandabot. I've created #708 for that.