-
Notifications
You must be signed in to change notification settings - Fork 15
Added e2e tests for alerting #3570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, @skrech!
CI changes are expected in this PR or a different one?
211b572
to
742d238
Compare
50324c2
to
c29c9d5
Compare
Added the CI changes. Instead of creating a new Job, though, I went for re-using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, @skrech!
As mentioned privately I was confused by the fact that from the test setup it looks like the default behaviour is env var driven alerting settings, which I understand being the case for development.
However, if I recall correctly, for the user the default behaviour is database driven, right?
9d7a75c
to
15afa77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks nice @skrech !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
@@ -242,6 +242,6 @@ defmodule Trento.MixProject do | |||
end | |||
|
|||
defp get_version_from_file do | |||
File.cwd!() |> Path.join("VERSION") |> File.read!() |> String.trim() | |||
__DIR__ |> Path.join("VERSION") |> File.read!() |> String.trim() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What issues was the previous function usage causing?
Not that I am against the change, just to understand 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good catch :) I even intend to leave this into its own commit when merging this.
It can't be seen from the diff of the PR but I tried very hard to actually start the Mix task from different current working directory (because Cypress doesn't run in the project root). And when specifying custom path to mix.exs
, reading the file won't succeed because it can't find VERSION file in what happens to be the current directory. __DIR__
would work because it's bound to the location of the file being read, so very robust.
Unfortunately, specifying MIX_EXS and MIX_DEPS_PATH wasn't enough to make mix running from non-project-root succeed because it couldn't find mix.lock
. That seems to be a bug, so I gave up.
Description
This PR adds E2E tests for the alerting configuration. Since alerting configuration supports setting it from either environment variables or from the DB different setup is required for running the backend. This necessitates splitting the tests into two groups -- one for the case where environment variables are in place and no dynamic configuration is possible and the second one is when the config is read from the DB and can be modified by the user in real time using the Web API.
The former case can be considered as the default behavior and its tests are run along the rest of the parallel test suite.
The later case is protected by an env var
ALERTING_DB_TESTS
and has its own custom GitHub Actions job.Added is a new dependency --
pg
package which allows to directly interact with the Postgres DB in some of the alerting configuration tests since there is no other way to control the fixture by solely using the API.Updated is the developer documentation on how to enable setting alerting configuration via the web API during development.