-
Notifications
You must be signed in to change notification settings - Fork 32
Add compose stack name + allow test stack to run in parallel #1093
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 compose stack name + allow test stack to run in parallel #1093
Conversation
Looks like a good idea to me. @ribalba can you test this please? Did only look at time bc sickness |
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.
5 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
TEST_NGINX_PORT_MAPPING = [f"{TEST_NGINX_PORT}:{BASE_NGINX_PORT}"] # only change public port | ||
BASE_DATABASE_PORT = 9573 | ||
TEST_DATABASE_PORT = 9574 | ||
TEST_DATABASE_PORT_MAPPING = [f"{TEST_DATABASE_PORT}:{TEST_DATABASE_PORT}"] # change external and internal port |
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.
logic: Port mapping sets both external and internal ports to TEST_DATABASE_PORT, but comment suggests only external port should change. This could cause connectivity issues.
TEST_DATABASE_PORT_MAPPING = [f"{TEST_DATABASE_PORT}:{TEST_DATABASE_PORT}"] # change external and internal port | |
TEST_DATABASE_PORT_MAPPING = [f"{TEST_DATABASE_PORT}:{BASE_DATABASE_PORT}"] # change only external port |
tests/setup-test-env.py
Outdated
# Edit stack name | ||
compose['name'] = 'green-metrics-tool-test' |
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.
style: Stack name is set inside service loop, causing it to be overwritten multiple times. Move outside the loop to improve clarity and prevent potential issues.
I like the idea of changing the port. The name is also changed in docker desktop. See screenshot. The only thing is I am getting quite a few test errors because of the port change. @davidkopp can you see them? Otherwise I can send them to you. ![]() |
I forgot to check if the frontend tests are still working. Sorry for that. |
My hack with temporarily changing the ports in I have now reverted the hack and instead make a copy of the frontend config file similar how |
LGtM, lets run the tests! |
Test seem to work fine. Did now also a code review. Here my remakrs:
|
Thanks for your remarks.
With the redis related change a re-install of GMT is required so the port is in |
Code looks good and works well on my local box. Running the tests now! One thing that should be considered: It is still not possible to run the tests AND a benchmarking run in parallel as the providers will conflict each other. I however also see no valid reason to do that, other than some next level hyper parallel development. If that is needed we typically outsource the test to GitHub to run in parallel. |
Thanks for the PR ❤️. merged. |
…oding-solutions#1093) * Add compose stack name * Allow test stack to run in parallel * Fix frontend tests * Minor * Fix access of the frontend to the test nginx container * Ensure to revert config change on exit * Duplicate frontend config instead of temporarily changing it * Fix set test compose name out of loop * Fix redis connection
…oding-solutions#1093) * Add compose stack name * Allow test stack to run in parallel * Fix frontend tests * Minor * Fix access of the frontend to the test nginx container * Ensure to revert config change on exit * Duplicate frontend config instead of temporarily changing it * Fix set test compose name out of loop * Fix redis connection
* Add support for entrypoint attribute * Fix entrypoint implementation * Improve test case * Add test case with script as entrypoint * Add test case for entrypoint in conjunction with command * Bump deepdiff from 8.2.0 to 8.3.0 (#1087) Bumps [deepdiff](https://github.com/seperman/deepdiff) from 8.2.0 to 8.3.0. - [Release notes](https://github.com/seperman/deepdiff/releases) - [Changelog](https://github.com/seperman/deepdiff/blob/master/docs/changelog.rst) - [Commits](seperman/deepdiff@8.2.0...8.3.0) --- updated-dependencies: - dependency-name: deepdiff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * E-Mail now made optional * Checking int fields for params and limiting retrieval amount (#1089) * Add compose stack name + allow test stack to run in parallel (#1093) * Add compose stack name * Allow test stack to run in parallel * Fix frontend tests * Minor * Fix access of the frontend to the test nginx container * Ensure to revert config change on exit * Duplicate frontend config instead of temporarily changing it * Fix set test compose name out of loop * Fix redis connection * Allow empty entrypoint -> default entrypoint is ignored * Minor test improvement * Add attribute "clear-entrypoint" * Revert "Add attribute "clear-entrypoint"" This reverts commit 001b3ec. * Remove test entrypoint with single word (not relevant for practice) * Replace usage of 'yes' with 'tail' in test case --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Arne Tarara <[email protected]>
* Add compose stack name * Allow test stack to run in parallel * Fix frontend tests * Minor * Fix access of the frontend to the test nginx container * Ensure to revert config change on exit * Duplicate frontend config instead of temporarily changing it * Fix set test compose name out of loop * Fix redis connection
* Add support for entrypoint attribute * Fix entrypoint implementation * Improve test case * Add test case with script as entrypoint * Add test case for entrypoint in conjunction with command * Bump deepdiff from 8.2.0 to 8.3.0 (#1087) Bumps [deepdiff](https://github.com/seperman/deepdiff) from 8.2.0 to 8.3.0. - [Release notes](https://github.com/seperman/deepdiff/releases) - [Changelog](https://github.com/seperman/deepdiff/blob/master/docs/changelog.rst) - [Commits](seperman/deepdiff@8.2.0...8.3.0) --- updated-dependencies: - dependency-name: deepdiff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * E-Mail now made optional * Checking int fields for params and limiting retrieval amount (#1089) * Add compose stack name + allow test stack to run in parallel (#1093) * Add compose stack name * Allow test stack to run in parallel * Fix frontend tests * Minor * Fix access of the frontend to the test nginx container * Ensure to revert config change on exit * Duplicate frontend config instead of temporarily changing it * Fix set test compose name out of loop * Fix redis connection * Allow empty entrypoint -> default entrypoint is ignored * Minor test improvement * Add attribute "clear-entrypoint" * Revert "Add attribute "clear-entrypoint"" This reverts commit 001b3ec. * Remove test entrypoint with single word (not relevant for practice) * Replace usage of 'yes' with 'tail' in test case --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Arne Tarara <[email protected]>
* main: Reverted XGBoost upgrade as GitHub Actions fails Bump aiohttp from 3.11.13 to 3.11.14 (#1098) Bump deepdiff from 8.3.0 to 8.4.2 (#1102) HealthCheck JSON errors are now scraped (#1103) Updated Cloud Energy Adding client max body size 3M More clear about GMT free version limit Logs previous exception if present (#1097) Moving back to pull_request as we are not getting protetction for synchronize pushes Add support for entrypoint attribute (#1088) Add compose stack name + allow test stack to run in parallel (#1093) Moving to pull_request_target to have secrets available even in external contributed PRs Bump psycopg[binary] from 3.2.5 to 3.2.6 (#1095)
* (Frontend): Energy-ID is now modular frontend component; Home page draft; Refactoring of config.js [skip ci] * Added sample display of cards for connected tools [skip ci] * h1 header change repositories / last 50 runs * Normalized namings; Added /insigts endpoint * Changing name to MetricRunner * Updated meta * Reverted metric-runner URL naming * Modularized install script incl. help; Segmented out MetricRunner API * Making metric runner main item also link to runs * REplace CarbonDB and PowerHOG always * More uniform style * Bugfix for import * Update README.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Removed duplicate statement * Updated EE * Bump psycopg[binary] from 3.2.5 to 3.2.6 (#1095) Bumps [psycopg[binary]](https://github.com/psycopg/psycopg) from 3.2.5 to 3.2.6. - [Changelog](https://github.com/psycopg/psycopg/blob/master/docs/news.rst) - [Commits](psycopg/psycopg@3.2.5...3.2.6) --- updated-dependencies: - dependency-name: psycopg[binary] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Moving to pull_request_target to have secrets available even in external contributed PRs * Add compose stack name + allow test stack to run in parallel (#1093) * Add compose stack name * Allow test stack to run in parallel * Fix frontend tests * Minor * Fix access of the frontend to the test nginx container * Ensure to revert config change on exit * Duplicate frontend config instead of temporarily changing it * Fix set test compose name out of loop * Fix redis connection * Add support for entrypoint attribute (#1088) * Add support for entrypoint attribute * Fix entrypoint implementation * Improve test case * Add test case with script as entrypoint * Add test case for entrypoint in conjunction with command * Bump deepdiff from 8.2.0 to 8.3.0 (#1087) Bumps [deepdiff](https://github.com/seperman/deepdiff) from 8.2.0 to 8.3.0. - [Release notes](https://github.com/seperman/deepdiff/releases) - [Changelog](https://github.com/seperman/deepdiff/blob/master/docs/changelog.rst) - [Commits](seperman/deepdiff@8.2.0...8.3.0) --- updated-dependencies: - dependency-name: deepdiff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * E-Mail now made optional * Checking int fields for params and limiting retrieval amount (#1089) * Add compose stack name + allow test stack to run in parallel (#1093) * Add compose stack name * Allow test stack to run in parallel * Fix frontend tests * Minor * Fix access of the frontend to the test nginx container * Ensure to revert config change on exit * Duplicate frontend config instead of temporarily changing it * Fix set test compose name out of loop * Fix redis connection * Allow empty entrypoint -> default entrypoint is ignored * Minor test improvement * Add attribute "clear-entrypoint" * Revert "Add attribute "clear-entrypoint"" This reverts commit 001b3ec. * Remove test entrypoint with single word (not relevant for practice) * Replace usage of 'yes' with 'tail' in test case --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Arne Tarara <[email protected]> * Unified display of home page blocks * Typos and hardening * Updated EE * Test-Fix * Renamed MetricRunner to ScenarioRunner * Activate scenario runner not on every input, but only empty and Y/y * Typo * Removed additional info * Bugfix: Inverted logic * File renames * Added insights tests * Test fix * Test install routine activates components always. No matter what other local config is * Removing file from repo * Typo --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Kopp <[email protected]>
When running the containers of GMT in Docker Desktop the stack was called "docker" because of the base path. This PR adds a proper stack name:
green-metrics-tool
.Docs:
One use case of having different stacks is to have different environments. So I thought it could make sense to allow to run the test environment in parallel to the production/development environment.
Greptile Summary
This PR adds a proper stack name to Docker Compose configurations and enables parallel execution of test and production environments by modifying port configurations and service names.
/docker/compose.yml.example
for better organization in Docker Desktop/tests/setup-test-env.py
to handle new port mappings for nginx (9143) and postgres (9574)/tests/test_functions.py
to use dynamic database configuration from GlobalConfig instead of hardcoded values💡 (4/5) You can add custom instructions or style guidelines for the bot here!