Skip to content
Snippets Groups Projects
Commit a25a1c94 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

.haf_app_pattern_tests_template allows to perform HAF-APP setup using a...

.haf_app_pattern_tests_template allows to perform HAF-APP setup using a dedicated setup-container way
parent 18b2a600
No related branches found
No related tags found
1 merge request!38.haf_app_pattern_tests_template allows to perform HAF-APP setup performed by dedicated application container
Pipeline #84629 passed
...@@ -6,26 +6,6 @@ variables: ...@@ -6,26 +6,6 @@ variables:
include: include:
- local: templates/base.gitlab-ci.yml - local: templates/base.gitlab-ci.yml
.jmeter_benchmark_job:
extends: .job-defaults
image: registry.gitlab.syncad.com/hive/common-ci-configuration/benchmark-test-runner:${BENCHMARK_IMAGE_TAG}
.jmeter_benchmark_with_haf_job:
extends: .jmeter_benchmark_job
variables:
HAF_COMMIT: $HAF_COMMIT # dotenv artifacts can be passed to service as long as they appear in section variables
services:
- name: $HAF_IMAGE_NAME
alias: haf-instance
variables:
# Allow access from any network to eliminate CI IP addressing problems
PG_ACCESS: "host haf_block_log haf_app_admin 0.0.0.0/0 trust"
DATA_SOURCE: "${DATA_CACHE_HAF_PREFIX}_${HAF_COMMIT}"
LOG_FILE: $CI_JOB_NAME.log
command: ["--replay-blockchain", "--stop-replay-at-block=5000000"]
- name: $APP_IMAGE
alias: app
.pytest_based_template: .pytest_based_template:
extends: .job-defaults extends: .job-defaults
variables: variables:
...@@ -87,23 +67,56 @@ include: ...@@ -87,23 +67,56 @@ include:
.haf_app_pattern_tests_template: .haf_app_pattern_tests_template:
extends: .pattern_test_executor extends: .pattern_test_executor
variables: variables:
HAF_IMAGE_NAME: "" # Must be overrided at derived job HAF_IMAGE_NAME: "" # Must be overrided at derived job
HAF_APP_IMAGE: "" # Image path name to be used at app testing. App will be instantiated as a service. HAF_APP_IMAGE: "" # Image path name to be used at app testing. App will be instantiated as a service.
HAF_APP_PORT: "" # To be specified by derived job HAF_APP_PORT: "" # To be specified by derived job
HAF_APP_USER: "" # a HAF db role to be used for regular app processing connection. To be specified by derived job
TESTED_ENDPOINT: app:${HAF_APP_PORT} TESTED_ENDPOINT: app:${HAF_APP_PORT}
HAF_COMMIT: $HAF_COMMIT HAF_COMMIT: $HAF_COMMIT
services: services:
- name: ${HAF_IMAGE_NAME} - name: ${HAF_IMAGE_NAME}
alias: haf-instance alias: haf-instance
variables: variables:
# Allow access from any network to eliminate CI IP addressing problems PG_ACCESS: "${HAF_DB_ACCESS}"
PG_ACCESS: "host haf_block_log haf_app_admin 0.0.0.0/0 trust"
DATA_SOURCE: "${DATA_CACHE_HAF_PREFIX}_${HAF_COMMIT}" DATA_SOURCE: "${DATA_CACHE_HAF_PREFIX}_${HAF_COMMIT}"
LOG_FILE: $CI_JOB_NAME.log LOG_FILE: $CI_JOB_NAME.log
command: ["--replay-blockchain", "--stop-replay-at-block=5000000"] command: ["--replay-blockchain", "--stop-replay-at-block=5000000"]
- name: ${HAF_APP_IMAGE}
alias: app-setup
variables:
# intentionally use setup way chosed in haf_api_node compose scripts
POSTGRES_URL: "postgresql://haf_admin@haf-instance/haf_block_log"
command: ["install_app"]
- name: ${HAF_APP_IMAGE} - name: ${HAF_APP_IMAGE}
alias: app alias: app
# intentionally use arg-parser way to verify if it works correctly
command: ["--postgres-url=postgresql://${HAF_APP_USER}@haf-instance/haf_block_log"]
entrypoint:
- '/bin/bash'
- '-c'
- |
set -xeuo pipefail
# since Gitlab services startup order is undefined, we need to wait for app setup completion
[ -s "./app/scripts/wait_for_setup_completed.sh" ] && "./app/scripts/wait_for_setup_completed.sh" "$@"
echo "Application setup finished - continue app-service spawn..."
# pass control to the default image entrypoint
"./docker_entrypoint.sh" "$@"
# arg $0 should be explicitly passed when using 'bash -c' entrypoints
- '/bin/bash'
.jmeter_benchmark_job:
extends: .job-defaults
image: registry.gitlab.syncad.com/hive/common-ci-configuration/benchmark-test-runner:${BENCHMARK_IMAGE_TAG}
.jmeter_benchmark_with_haf_job:
extends: .jmeter_benchmark_job
variables:
HAF_COMMIT: $HAF_COMMIT # dotenv artifacts can be passed to service as long as they appear in section variables
services:
- !reference [.haf_app_pattern_tests_template, services]
.tox_test_job: .tox_test_job:
extends: .job-defaults extends: .job-defaults
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment