-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add integration test framework #492
base: master
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.
Very interesting PR. Just my just pass. I'll come back.
./optional-components/local-dev-test | ||
./optional-components/prometheus-log-parser | ||
./optional-components/secure-data-proxy | ||
./optional-components/wps-healthchecks |
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.
Do we still need this ./optional-components/wps-healthchecks
? Should it be deleted given you added health check to all containers by default (good call).
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.
I left the WPS healthchecks in their own optional component. I'm happy to move them into the main docker compose files so that they're enabled by default but I left them as they were initially.
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.
Not for this PR if you prefer separate, but I really like your idea to have all healthcheck on by default instead of optionally. I do not see any good reasons for someone to disable it so why make it optional.
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.
Yeah I think I agree. I'll see if @fmigneault has an opinion but otherwise I can merge the WPS healthchecks in as part of this PR
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.
I'm fine with making them defined by default.
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.
one more minor comment
@@ -1,6 +1,10 @@ | |||
#!/bin/sh | |||
|
|||
BIRDHOUSE_COLOR=${BIRDHOUSE_COLOR:-1} | |||
# support NO_COLOR flag (https://no-color.org/) | |||
if [ -z "${BIRDHOUSE_COLOR}" ] && [ "${NO_COLOR}" != '1' ]; then |
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.
if [ -z "${BIRDHOUSE_COLOR}" ] && [ "${NO_COLOR}" != '1' ]; then | |
if [ -z "${BIRDHOUSE_COLOR}" ] && [ -z "${NO_COLOR}" ]; then |
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.
https://no-color.og/ says "NO_COLOR environment variable that, when present and not an empty string (regardless of its value), prevents the addition of ANSI color." so I think we should not just check for NO_COLOR == 1
.
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 PR!
if [ "${option}" = "no-suffix" ]; then | ||
configs_cmd_suffix= | ||
fi |
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.
If $(print_config_command)
was used, wouldn't if [ -z "$1" ]; then
work the same?
Just curious. no-suffix
is fine, but seems like a roundabout way with unnecessary hardcoded values.
@@ -22,3 +22,10 @@ services: | |||
REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt | |||
restart: always | |||
logging: *default-logging | |||
healthcheck: | |||
test: ["CMD", "curl", "--fail", "${BIRDHOUSE_FQDN_PUBLIC}"] |
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.
Ideally we should use an internal endpoint/port to avoid loop-back requests.
Also, consider using another endpoint such as the /version
, since the root path gets redirected to whichever "frontend" entrypoint is defined, which might be inconsistent or pinging another redirected service from the stack.
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.
Can this be renamed to test.env
so highlights are properly done on GitHub?
This will help read and review changes.
We can add a top-level comment to be explicit that this corresponds to env.local
corresponding to https://github.com/bird-house/birdhouse-deploy/blob/master/birdhouse/env.local.example.
./optional-components/local-dev-test | ||
./optional-components/prometheus-log-parser | ||
./optional-components/secure-data-proxy | ||
./optional-components/wps-healthchecks |
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.
I'm fine with making them defined by default.
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.
Other than the minor NO_COLOR left, great PR !
|
||
|
||
@pytest.fixture(scope="module", autouse=True) | ||
def start_stack(request, cli_path, local_env_file, tmp_data_persist_root, stack_info, pytestconfig): |
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.
I haven't seen usage of this new fixture. In fact, same for most of the new fixtures here.
I am guessing you are simply setting up for the future?
Overview
This update adds a framework for testing the deployed stack using pytest. This will allow developers to check
that their changes are consistent with the existing stack and to add additionally tests when new functionality
is introduced.
Changes to implement this include:
tests/unit/
directorytests/integration/
directory. More tests will be added in thefuture!
conftest.py
scripts updated to bring the stack up/down in a consistent way for the integration tests.birdhouse
interface script updated to support testing infrastructure (this should not change anything forother end-users).
birdhouse
interface to improve user experience.without the use of the
canarie-api
component.Next steps:
Changes
Non-breaking changes
Breaking changes
Related Issue / Discussion
Additional Information
CI Operations
birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false