Skip to content
Snippets Groups Projects

Unify API returns to sql composite types, add pattern tests for REST API

Merged Michal Zander requested to merge mzander/add-pattern-tests into develop
Compare and Show latest version
1 file
+ 62
19
Compare changes
  • Side-by-side
  • Inline
+ 62
19
@@ -479,49 +479,92 @@ prepare_haf_image_testnet:
HAF_APP_PORT: ${APP_PORT}
DIRECT_CALLS: 0
POSTGRES_URL: $DB_URL
script:
- echo "HAfAH image name $HAF_APP_IMAGE"
- echo "HAF image name $HAF_IMAGE_NAME"
# run tests
- cd $CI_PROJECT_DIR/tests/integration/functional
- pytest --junitxml report.xml --postgrest-hafah-adress=app:$APP_PORT --postgres-db-url=$DB_URL
-m $PYTEST_MARK
tags:
- public-runner-docker
hafah_pytest_rest_api_pattern_tests:
extends: .hafah_pytest_fuctional_tests_base
extends: .pytest_based_template
stage: test
needs:
- job: prepare_haf_data
artifacts: true
- job: prepare_postgrest_hafah_image
artifacts: true
services:
- *hfm-only-service
- name: ${HAF_APP_IMAGE}
alias: app-setup
variables:
# intentionally use setup way chosed in haf_api_node compose scripts
POSTGRES_URL: "postgresql://haf_admin@hfm-only-instance/haf_block_log"
command: ["install_app"]
entrypoint:
- '/bin/bash'
- '-c'
- |
set -xeuo pipefail
echo "Attempting to perform application setup..."
# pass control to the default image entrypoint
"./docker_entrypoint.sh" "$@"
echo "Application setup completed, starting to listed app port to satisfy Gitlab health checker..."
# Once setup completed, just listen on container/app port to satisfy GitlabCI HealthChecker
nc -v -l -p $(echo "${HAF_APP_PORT}")
# arg $0 should be explicitly passed when using 'bash -c' entrypoints
- '/bin/bash'
- name: ${HAF_APP_IMAGE}
alias: app
command: ["--postgres-url=postgresql://hafah_user@hfm-only-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
"/home/hafah_user/app/scripts/wait_for_setup_completed.sh" "$@"
echo "Application setup finished - continue app-service spawn..."
# pass control to the default image entrypoint
/home/hafah_user/docker_entrypoint.sh "$@"
# arg $0 should be explicitly passed when using 'bash -c' entrypoints
- '/bin/bash'
variables:
HAF_APP_HOST: app
JUNIT_REPORT: $CI_PROJECT_DIR/tests/tavern/report.xml
PYTEST_BASED_IMAGE_NAME: $BUILDER_IMAGE_PATH
POETRY_INSTALL_ROOT_DIR: $CI_PROJECT_DIR/haf/hive/tests/python/hive-local-tools
TAVERN_DIR: $CI_PROJECT_DIR/tests/tavern
DB_NAME: haf_block_log
DB_URL: "postgresql://haf_admin@hfm-only-instance:5432/$DB_NAME"
HAF_APP_IMAGE: $HAFAH_IMAGE_NAME
HAF_APP_PORT: ${APP_PORT}
HAF_APP_HOST: app
DIRECT_CALLS: 0
POSTGRES_URL: $DB_URL
script:
- |
echo "HAfAH image name $HAF_APP_IMAGE"
echo "HAF image name $HAF_IMAGE_NAME"
cd $CI_PROJECT_DIR/tests/tavern
pytest -n $PYTEST_NUMBER_OF_PROCESSES --junitxml report.xml .
artifacts:
paths:
- "**/*.out.json"
tags:
- data-cache-storage
hafah_pytest_fuctional_tests_part1:
extends: .hafah_pytest_fuctional_tests_base
variables:
PYTEST_MARK: "enum_virtual_ops_and_get_ops_in_block"
script:
- echo "HAfAH image name $HAF_APP_IMAGE"
- echo "HAF image name $HAF_IMAGE_NAME"
# run tests
- cd $CI_PROJECT_DIR/tests/integration/functional
- pytest --junitxml report.xml --postgrest-hafah-adress=app:$APP_PORT --postgres-db-url=$DB_URL
-m $PYTEST_MARK
hafah_pytest_fuctional_tests_part2:
extends: .hafah_pytest_fuctional_tests_base
variables:
PYTEST_MARK: "get_account_history_and_get_transaction"
script:
- echo "HAfAH image name $HAF_APP_IMAGE"
- echo "HAF image name $HAF_IMAGE_NAME"
# run tests
- cd $CI_PROJECT_DIR/tests/integration/functional
- pytest --junitxml report.xml --postgrest-hafah-adress=app:$APP_PORT --postgres-db-url=$DB_URL
-m $PYTEST_MARK
deploy-wax-spec-dev-package:
extends: .npm_deploy_package_template
Loading