Commit b6e39590 authored by Denis Karpenok (EPAM)'s avatar Denis Karpenok (EPAM)
Browse files

Perf test

parent f6176b20
Pipeline #61984 failed
workflow:
stages:
- generate
- test
- transfer
- extract
- publish
# --------------------------------------------------------------------------------
# Child pipeline generation
generate-pipeline:
image: python
tags: ['osdu-small']
stage: generate
artifacts:
paths:
- 'test-execution.gitlab-ci.yml'
script:
- ./generate-pipeline.py
- cat test-execution.gitlab-ci.yml
# --------------------------------------------------------------------------------
# Child pipeline execution
execute-tests:
trigger:
strategy: depend
include:
- artifact: test-execution.gitlab-ci.yml
job: generate-pipeline
allow_failure: true
# --------------------------------------------------------------------------------
# Transfer the artifacts from the child pipeline to the parent, through direct copy
copy-artifacts:
stage: transfer
image: everpeace/curl-jq
tags: ['osdu-small']
artifacts:
paths:
- child-artifacts.zip
- parent-pipeline.json
when: always
loadtest:
stage: build
image:
name: justb4/jmeter:latest
entrypoint: [""]
script:
- curl --output parent-pipeline.json "$CI_SERVER_URL/$CI_PROJECT_PATH/-/pipelines/$CI_PIPELINE_ID.json"
- CHILD_ID=$(jq .triggered[].id < parent-pipeline.json); echo "$CHILD_ID"
- SUMMARIZE_JOB_ID=$(curl "$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CHILD_ID/jobs" | jq '.[] | select(.name=="summarize").id'); echo "$SUMMARIZE_JOB_ID"
- curl --output child-artifacts.zip "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/$SUMMARIZE_JOB_ID/artifacts"
# --------------------------------------------------------------------------------
# Extract the archive zip
# Seems a bit redundant, since the artifacts will be zipped again in the parent, but it is the most straightforward
# way to get the artifacts from the child to the parent. Cleverer folks can combine this with the transfer stage
# in a single command later.
results:
stage: extract
image: kubeless/unzip
tags: ['osdu-small']
needs: ['copy-artifacts']
- jmeter -n -t "JMeter Collection\05_JMeter_Policy_test\Policy_performance.jmx"
artifacts:
paths:
- public
script:
- unzip child-artifacts.zip
# --------------------------------------------------------------------------------
# Publish the results on the Pages server, for the default branch only
pages:
image: alpine
stage: publish
tags: ['osdu-small']
needs: ['results']
artifacts:
paths:
- public
script:
- mkdir -p public
- echo "<html><head><title>${CI_PROJECT_NAME}</title></head><body>" > public/index.html
- echo "<h1>Output of latest newman runs:</h1><ul>" >> public/index.html
- find public -type f -not -name index.html | sort | sed \'s|public/\(.*\)|<li><a href="\\1">\\1</a>|\' >> public/index.html
- echo "</ul></body></html>" >> public/index.html
rules:
- if: $CI_COMMIT_REF == $CI_DEFAULT_BRANCH
- test_result.xml
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment