Conversation
Comment on lines
+321
to
+340
| # def test_collect_helm_values_wrong_dependencies_validate(tmp_path): | ||
| # out_folder = tmp_path / 'test_collect_helm_values_wrong_dependencies_validate' | ||
| # with pytest.raises(ValuesValidationException): | ||
| # create_helm_chart([CLOUDHARNESS_ROOT, f"{RESOURCES}/wrong-dependencies"], output_path=out_folder, domain="my.local", | ||
| # namespace='test', env='prod', local=False, tag='1', include=["wrong-hard"]) | ||
| # try: | ||
| # create_helm_chart([CLOUDHARNESS_ROOT, f"{RESOURCES}/wrong-dependencies"], output_path=out_folder, domain="my.local", | ||
| # namespace='test', env='prod', local=False, tag='1', include=["wrong-soft"]) | ||
| # | ||
| # except ValuesValidationException as e: | ||
| # pytest.fail("Should not error because of wrong soft dependency") | ||
| # | ||
| # with pytest.raises(ValuesValidationException): | ||
| # create_helm_chart([CLOUDHARNESS_ROOT, f"{RESOURCES}/wrong-dependencies"], output_path=out_folder, domain="my.local", | ||
| # namespace='test', env='prod', local=False, tag='1', include=["wrong-build"]) | ||
| # try: | ||
| # create_helm_chart([CLOUDHARNESS_ROOT, f"{RESOURCES}/wrong-dependencies"], output_path=out_folder, domain="my.local", | ||
| # namespace='test', env='prod', local=False, tag='1', include=["wrong-services"]) | ||
| # except ValuesValidationException: | ||
| # pytest.fail("Should not error because of missing use_services dependency") |
Comment on lines
+373
to
+402
| # def test_collect_helm_values_build_dependencies(tmp_path): | ||
| # out_folder = tmp_path / 'test_collect_helm_values_build_dependencies' | ||
| # values = create_helm_chart([CLOUDHARNESS_ROOT, RESOURCES], output_path=out_folder, domain="my.local", | ||
| # namespace='test', env='prod', local=False, tag='1', include=["myapp"]) | ||
| # | ||
| # assert 'cloudharness-flask' in values[KEY_TASK_IMAGES], "Cloudharness-flask is included in the build dependencies" | ||
| # assert 'cloudharness-base' in values[KEY_TASK_IMAGES], "Cloudharness-base is included in cloudharness-flask Dockerfile and it should be guessed" | ||
| # assert 'cloudharness-base-debian' not in values[KEY_TASK_IMAGES], "Cloudharness-base-debian is not included in any dependency" | ||
| # assert 'cloudharness-frontend-build' not in values[KEY_TASK_IMAGES], "cloudharness-frontend-build is not included in any dependency" | ||
| # | ||
| # | ||
| # def test_collect_helm_values_build_dependencies_nodeps(tmp_path): | ||
| # out_folder = tmp_path / 'test_collect_helm_values_build_dependencies_nodeps' | ||
| # values = create_helm_chart([CLOUDHARNESS_ROOT, RESOURCES], output_path=out_folder, domain="my.local", | ||
| # namespace='test', env='prod', local=False, tag='1', include=["events"]) | ||
| # | ||
| # assert 'cloudharness-flask' not in values[KEY_TASK_IMAGES], "Cloudharness-flask is not included in the build dependencies" | ||
| # assert 'cloudharness-base' not in values[KEY_TASK_IMAGES], "Cloudharness-base is not included in the build dependencies" | ||
| # assert 'cloudharness-base-debian' not in values[KEY_TASK_IMAGES], "Cloudharness-base-debian is not included in any dependency" | ||
| # assert 'cloudharness-frontend-build' not in values[KEY_TASK_IMAGES], "cloudharness-frontend-build is not included in any dependency" | ||
| # | ||
| # | ||
| # def test_collect_helm_values_build_dependencies_exclude(tmp_path): | ||
| # out_folder = tmp_path / 'test_collect_helm_values_build_dependencies_exclude' | ||
| # values = create_helm_chart([CLOUDHARNESS_ROOT, RESOURCES], output_path=out_folder, domain="my.local", | ||
| # namespace='test', env='prod', local=False, tag='1', include=["workflows"], exclude=["workflows-extract-download"]) | ||
| # | ||
| # assert 'cloudharness-flask' in values[KEY_TASK_IMAGES], "Cloudharness-flask is included in the build dependencies" | ||
| # assert 'cloudharness-base' in values[KEY_TASK_IMAGES], "Cloudharness-base is included in cloudharness-flask Dockerfile and it should be guessed" | ||
| # assert 'workflows-extract-download' not in values[KEY_TASK_IMAGES], "workflows-extract-download has been explicitly excluded" |
Comment on lines
+447
to
+465
| # def test_cnpg_postgres_parameters_render_only_when_set(tmp_path): | ||
| # out_folder = tmp_path / 'test_cnpg_postgres_parameters_render_only_when_set' | ||
| # create_helm_chart([CLOUDHARNESS_ROOT, RESOURCES], output_path=out_folder, domain="my.local", | ||
| # env='withpostgres', local=False, include=["myapp"], exclude=["legacy"]) | ||
| # | ||
| # helm_path = out_folder / HELM_CHART_PATH | ||
| # shutil.rmtree(helm_path / 'charts') | ||
| # values_path = helm_path / 'values.yaml' | ||
| # with open(values_path, 'r') as values_file: | ||
| # values = yaml.load(values_file) | ||
| # postgres = values['apps']['myapp']['harness']['database']['postgres'] | ||
| # postgres['operator'] = True | ||
| # postgres['parameters'] = { | ||
| # # Simulate generated YAML values where on/off can be parsed as booleans before Helm renders the chart. | ||
| # 'autovacuum': True, | ||
| # 'max_connections': '200', | ||
| # 'shared_buffers': '1GB', | ||
| # 'synchronous_commit': True, | ||
| # 'track_io_timing': False, |
Comment on lines
+467
to
+468
| # with open(values_path, 'w') as values_file: | ||
| # yaml.dump(values, values_file) |
Comment on lines
+482
to
+483
| # with open(values_path, 'w') as values_file: | ||
| # yaml.dump(values, values_file) |
Comment on lines
+490
to
+491
| # with open(values_path, 'w') as values_file: | ||
| # yaml.dump(values, values_file) |
Comment on lines
+499
to
+519
| # def test_statefulset_option(tmp_path): | ||
| # out_folder = tmp_path / 'test_statefulset_option' | ||
| # # nfsserver is included to provide the storage class values needed by the usenfs case | ||
| # create_helm_chart([CLOUDHARNESS_ROOT, RESOURCES], output_path=out_folder, domain="my.local", | ||
| # env='withpostgres', local=False, include=["myapp", "nfsserver"], exclude=["legacy"]) | ||
| # | ||
| # helm_path = out_folder / HELM_CHART_PATH | ||
| # shutil.rmtree(helm_path / 'charts') | ||
| # values_path = helm_path / 'values.yaml' | ||
| # with open(values_path, 'r') as values_file: | ||
| # values = yaml.load(values_file) | ||
| # | ||
| # myapp = values['apps']['myapp'] | ||
| # harness = myapp['harness'] | ||
| # dep_name = harness['deployment']['name'] | ||
| # db_name = harness['database']['name'] | ||
| # service_name = harness['service']['name'] | ||
| # | ||
| # harness['deployment']['auto'] = True | ||
| # harness['deployment']['volume'] = { | ||
| # 'name': 'myapp-data', 'mountpath': '/data', 'size': '1Gi', 'auto': True, |
Comment on lines
+521
to
+524
| # with open(values_path, 'w') as values_file: | ||
| # yaml.dump(values, values_file) | ||
| # | ||
| # # Default: Deployments with the Recreate/affinity workaround and a standalone PVC |
Comment on lines
+541
to
+542
| # with open(values_path, 'w') as values_file: | ||
| # yaml.dump(values, values_file) |
| print(f"unknown: {unknown}") | ||
| sys.exit(2) | ||
|
|
||
| project = CHProject(root_paths[0], cloudharness_path=root_paths[0]) |
Member
Author
|
Closing the PR, I'll reopen a new one later, github code bot is stressing me out spamming so many messages at the moment while I'm still actively thinking/dev about the whole model/architecture |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes CH-X
Implemented solution
...
How to test this PR
...
Sanity checks:
Breaking changes (select one):
breaking-changeand the migration procedure is well described abovePossible deployment updates issues (select one):
alert:deploymentTest coverage (select one):
Documentation (select one):
Nice to have (if relevant):