Skip to content
Snippets Groups Projects
Verified Commit 23ca9134 authored by Konrad Botor's avatar Konrad Botor
Browse files

Added Tox image, job templates and test job - ref. hive#406

parent 6bee84bd
No related branches found
No related tags found
1 merge request!2Templates based on HAfAH test jobs
Pipeline #58554 passed
...@@ -3,6 +3,7 @@ variables: ...@@ -3,6 +3,7 @@ variables:
DOCKER_BUILDER_TAG: "$CI_COMMIT_SHA" DOCKER_BUILDER_TAG: "$CI_COMMIT_SHA"
DOCKER_DIND_TAG: "$CI_COMMIT_SHA" DOCKER_DIND_TAG: "$CI_COMMIT_SHA"
IMAGE_REMOVER_TAG: "$CI_COMMIT_SHA" IMAGE_REMOVER_TAG: "$CI_COMMIT_SHA"
TOX_IMAGE_TAG: "$CI_COMMIT_SHA"
stages: stages:
- validation - validation
...@@ -151,6 +152,16 @@ build_benchmark_test_runner_image: ...@@ -151,6 +152,16 @@ build_benchmark_test_runner_image:
exists: exists:
- Dockerfile.benchmark-test-runner - Dockerfile.benchmark-test-runner
build_tox_test_runner_image:
extends: .build_docker_image
stage: build
variables:
BUILD_TARGET: "tox-test-runner"
rules:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile.tox-test-runner
prepare_example_hived_data_5m_image: prepare_example_hived_data_5m_image:
extends: .prepare_hived_data_5m_image extends: .prepare_hived_data_5m_image
stage: example-build stage: example-build
...@@ -191,7 +202,6 @@ example_jmeter_benchmark_job: ...@@ -191,7 +202,6 @@ example_jmeter_benchmark_job:
jmeter -n -t misc/example-jmeter-test.jmx -l jmeter_report.jtl -e -o web_jmeter_report jmeter -n -t misc/example-jmeter-test.jmx -l jmeter_report.jtl -e -o web_jmeter_report
m2u --input jmeter_report.xml --output jmeter_junit_report.xml m2u --input jmeter_report.xml --output jmeter_junit_report.xml
artifacts: artifacts:
expire_in: "30 days"
paths: paths:
- web_jmeter_report/**/* - web_jmeter_report/**/*
- jmeter.log - jmeter.log
...@@ -203,6 +213,22 @@ example_jmeter_benchmark_job: ...@@ -203,6 +213,22 @@ example_jmeter_benchmark_job:
tags: tags:
- public-runner-docker - public-runner-docker
example_tox_test_job:
extends: .tox_test_job
stage: example-test
script:
- |
git clone https://github.com/pypa/sampleproject.git
cd sampleproject
sed -i s/py\{37,38,39,310\}/py311/ tox.ini
tox --result-json tox-result.json
artifacts:
paths:
- sampleproject/tox-result.json
when: manual
tags:
- public-runner-docker
example_hived_data_image_cleanup: example_hived_data_image_cleanup:
extends: .docker_image_cleanup_job extends: .docker_image_cleanup_job
stage: example-cleanup stage: example-cleanup
......
# syntax=docker/dockerfile:1.4
FROM python:3.11.0-alpine3.17
RUN <<-EOF
# Install system dependencies
apk add --no-cache bash git curl
# Install Python dependencies
pip3 install tox
EOF
CMD ["/bin/bash"]
\ No newline at end of file
...@@ -35,4 +35,9 @@ target "docker-dind" { ...@@ -35,4 +35,9 @@ target "docker-dind" {
target "image-remover" { target "image-remover" {
dockerfile = "Dockerfile.image-remover" dockerfile = "Dockerfile.image-remover"
tags = generate-tags("image-remover") tags = generate-tags("image-remover")
}
target "tox-test-runner" {
dockerfile = "Dockerfile.tox-test-runner"
tags = generate-tags("tox-test-runner")
} }
\ No newline at end of file
variables: variables:
BENCHMARK_IMAGE_TAG: "latest" BENCHMARK_IMAGE_TAG: "latest"
TOX_IMAGE_TAG: "latest"
.artifact_config:
artifacts:
when: always
expire_in: 6 hours
.jmeter_benchmark_job: .jmeter_benchmark_job:
image: registry.gitlab.syncad.com/hive/common-ci-configuration/benchmark-test-runner:${BENCHMARK_IMAGE_TAG} image: registry.gitlab.syncad.com/hive/common-ci-configuration/benchmark-test-runner:${BENCHMARK_IMAGE_TAG}
artifacts: !reference [.artifact_config, artifacts]
.jmeter_benchmark_with_haf_job: .jmeter_benchmark_with_haf_job:
extends: .jmeter_benchmark_job extends: .jmeter_benchmark_job
...@@ -14,3 +21,20 @@ variables: ...@@ -14,3 +21,20 @@ variables:
PG_ACCESS: "host haf_block_log haf_app_admin 0.0.0.0/0 trust" PG_ACCESS: "host haf_block_log haf_app_admin 0.0.0.0/0 trust"
- name: $APP_IMAGE - name: $APP_IMAGE
alias: app alias: app
.tox_test_job:
image: registry.gitlab.syncad.com/hive/common-ci-configuration/tox-test-runner:${TOX_IMAGE_TAG}
artifacts: !reference [.artifact_config, artifacts]
.pattern_tests:
extends: .tox_test_job
variables:
ENDPOINT: app:$APP_PORT
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"
- name: $APP_IMAGE
alias: app
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