Skip to content

Commit

Permalink
Merge pull request #10 from CoverGo/f/BE-458-integration-tests-should…
Browse files Browse the repository at this point in the history
…-use-candidate-image

Append candidate- to service tags in docker-composes file
Services are tagged with candidate-app_version , this should be reflected to the docker image tag in the docker-compose file so that integration tests that use service images do not encounter to image not found errors
See BE-458
  • Loading branch information
Andrey Leskov authored Mar 4, 2022
2 parents 68c4098 + 10472ed commit 8b9e8e6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .gflows/libs/build_publish_steps.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
#@ return "name=" + getattr(integration_test_component,"diagnostic_filter", "*")
#@ end
---
#@ def _compose_launch_steps(integration_test_definition, images):
#@ def _compose_launch_steps(integration_test_definition, images, service_image):
- name: Prepare compose file
uses: ./.github/actions/set-compose-tags
with:
images: #@ images
target-tag: ${{ needs.version.outputs.app_version }}
compose-file: #@ integration_test_definition.compose_file
- name: Prepare compose file
uses: ./.github/actions/set-compose-tags
with:
images: #@ service_image
target-tag: candidate-${{ needs.version.outputs.app_version }}
compose-file: #@ integration_test_definition.compose_file
- name: #@ "Run {}".format(integration_test_definition.name)
uses: ./.github/actions/run-in-compose
with:
Expand Down
8 changes: 4 additions & 4 deletions .gflows/libs/job_integration_test.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
#@ load("job_dependency_resolution.lib.yml", "dep")
#@ load("configuration.lib.yml", "cfg")
---
#@ def integration_test_run_job_steps(integration_test_definition, repository_built_images, cache_registry, main_registry=None):
#@ def integration_test_run_job_steps(integration_test_definition, repository_built_images, cache_registry, service_image, main_registry=None):
- #@ steps.checkout()
- #@ steps.checkout_private_actions()
#@ if(main_registry != None):
- #@ steps.login_docker(main_registry)
#@ end
#@ for compose_step in bpsteps.compose_launch_steps(integration_test_definition,repository_built_images):
#@ for compose_step in bpsteps.compose_launch_steps(integration_test_definition,repository_built_images,service_image):
- #@ compose_step
#@ end
- #@ bpsteps.collect_results_step(integration_test_definition,tagging.image(cache_registry, integration_test_definition))
Expand Down Expand Up @@ -76,7 +76,7 @@
#@ repository_built_images=dep.get_repository_built_images(sections)
#@ steps_array = []
#@ steps_array.append(steps.login_docker(sections.cache_registry))
#@ steps_array.extend(integration_test_run_job_steps(integration_test_definition, repository_built_images, sections.cache_registry, getattr(sections,"main_registry",None)))
#@ steps_array.extend(integration_test_run_job_steps(integration_test_definition, repository_built_images, sections.cache_registry, sections.service.image_name, getattr(sections,"main_registry",None)))
#@ return common.generate_job(integration_test_definition, steps_array ,{"RESULTS_PATH": cfg.get_host_path_for_docker_extract(integration_test_definition)},sections, needs, job.name.docker_run(integration_test_definition))
#@ end
---
Expand All @@ -101,7 +101,7 @@
#@ repository_built_images=dep.get_repository_built_images(sections)
#@ steps = []
#@ steps.extend(docker.steps.build(integration_test_definition, sections.cache_registry))
#@ steps.extend(integration_test_run_job_steps(integration_test_definition, repository_built_images, sections.cache_registry, getattr(sections,"main_registry",None)))
#@ steps.extend(integration_test_run_job_steps(integration_test_definition, repository_built_images, sections.cache_registry, sections.service.image_name, getattr(sections,"main_registry",None)))
#@ return common.generate_job(integration_test_definition, steps ,{"RESULTS_PATH": "TestResults"},sections, needs, job_name)
#@ end
---
Expand Down
18 changes: 18 additions & 0 deletions github-sample/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,12 @@ jobs:
images: covergo/auth;covergo/auth-test-unit;covergo/cases-mariadb-test-integration;covergo/cases-test-acceptance;covergo/cases-api-test-integration;covergo/auth-mongo
target-tag: ${{ needs.version.outputs.app_version }}
compose-file: docker-compose.yml
- name: Prepare compose file
uses: ./.github/actions/set-compose-tags
with:
images: covergo/auth
target-tag: candidate-${{ needs.version.outputs.app_version }}
compose-file: docker-compose.yml
- name: Run Integration tests
uses: ./.github/actions/run-in-compose
with:
Expand Down Expand Up @@ -531,6 +537,12 @@ jobs:
images: covergo/auth;covergo/auth-test-unit;covergo/cases-mariadb-test-integration;covergo/cases-test-acceptance;covergo/cases-api-test-integration;covergo/auth-mongo
target-tag: ${{ needs.version.outputs.app_version }}
compose-file: docker-compose.yml
- name: Prepare compose file
uses: ./.github/actions/set-compose-tags
with:
images: covergo/auth
target-tag: candidate-${{ needs.version.outputs.app_version }}
compose-file: docker-compose.yml
- name: Run Acceptance tests
uses: ./.github/actions/run-in-compose
with:
Expand Down Expand Up @@ -658,6 +670,12 @@ jobs:
images: covergo/auth;covergo/auth-test-unit;covergo/cases-mariadb-test-integration;covergo/cases-test-acceptance;covergo/cases-api-test-integration;covergo/auth-mongo
target-tag: ${{ needs.version.outputs.app_version }}
compose-file: docker-compose.mariadb.yml
- name: Prepare compose file
uses: ./.github/actions/set-compose-tags
with:
images: covergo/auth
target-tag: candidate-${{ needs.version.outputs.app_version }}
compose-file: docker-compose.mariadb.yml
- name: Run Integration API tests
uses: ./.github/actions/run-in-compose
with:
Expand Down

0 comments on commit 8b9e8e6

Please sign in to comment.