Skip to content

Commit e0277ef

Browse files
mat-rumianpmalek
authored andcommitted
Add tracing-tests into pipeline (#1302)
1 parent fa429b8 commit e0277ef

File tree

1 file changed

+95
-25
lines changed

1 file changed

+95
-25
lines changed

.circleci/config.yml

Lines changed: 95 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ parameters:
1414
orbs:
1515
win: circleci/[email protected]
1616
aws-cli: circleci/[email protected]
17+
kubernetes: circleci/[email protected]
1718

1819
executors:
1920
golang:
@@ -102,25 +103,6 @@ commands:
102103
keys:
103104
- cimg-go-pkg-mod-{{ arch }}-{{ checksum "go.sum" }}-v4
104105

105-
install_fluentbit:
106-
steps:
107-
- run: |
108-
sudo chmod 0777 -R /opt
109-
- restore_cache: # restores saved cache if no changes are detected since last run
110-
keys:
111-
- "cimg-fluentbit-{{ arch }}-1.5.3"
112-
- run: |
113-
sudo ln -s /opt/td-agent-bit/bin/td-agent-bit /usr/local/bin/fluent-bit
114-
if [[ -f /opt/td-agent-bit/bin/td-agent-bit ]]; then
115-
exit 0
116-
fi
117-
wget https://packages.fluentbit.io/ubuntu/bionic/pool/main/t/td-agent-bit/td-agent-bit_1.5.3_amd64.deb
118-
sudo dpkg -i ./td-agent-bit*.deb
119-
- save_cache:
120-
key: cimg-fluentbit-{{ arch }}-1.5.3
121-
paths:
122-
- /opt/td-agent-bit
123-
124106
publish_docker_images:
125107
parameters:
126108
repo:
@@ -169,6 +151,20 @@ workflows:
169151
- publish-dev:
170152
requires:
171153
- run-stability-tests
154+
- run-tracing-tests:
155+
repo: opentelemetry-collector-dev
156+
tag: ${CIRCLE_SHA1}
157+
requires:
158+
- publish-dev
159+
- publish-stable:
160+
requires:
161+
- run-tracing-tests
162+
filters:
163+
branches:
164+
ignore: /.*/
165+
tags:
166+
only: /.*/
167+
172168

173169
build-publish:
174170
when: << pipeline.parameters.run-build-publish >>
@@ -243,20 +239,31 @@ workflows:
243239
branches:
244240
ignore: /.*/
245241
tags:
246-
only: /.*/
247-
- spawn-stability-tests-job:
242+
ignore: /.*/
243+
- publish-dev:
248244
requires:
249245
- lint
250246
- unit-tests
251-
- loadtest
252-
- windows-test
253247
- integration-tests
254248
- cross-compile
249+
- loadtest
250+
- windows-test
251+
- windows-msi
252+
- deb-package
253+
- rpm-package
255254
filters:
256255
branches:
257-
only: /main|release\/.+/
256+
ignore: /.*/
258257
tags:
259258
ignore: /.*/
259+
- spawn-stability-tests-job:
260+
requires:
261+
- publish-check
262+
filters:
263+
branches:
264+
only: /.*/
265+
tags:
266+
only: /.*/
260267
- integration-tests:
261268
filters:
262269
tags:
@@ -340,7 +347,6 @@ jobs:
340347
TEST_RESULTS: testbed/tests/results/junit/results.xml
341348
steps:
342349
- restore_workspace
343-
- install_fluentbit
344350
- run:
345351
name: Loadtest
346352
command: make e2e-test
@@ -569,3 +575,67 @@ jobs:
569575
- persist_to_workspace:
570576
root: ~/
571577
paths: project/dist/*.<< parameters.package_type >>
578+
579+
run-tracing-tests:
580+
parameters:
581+
repo:
582+
type: string
583+
tag:
584+
type: string
585+
docker:
586+
- image: ${INFRASTRUCTURE_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/tracing-tests/tests:latest
587+
aws_auth:
588+
aws_access_key_id: ${TRACING_TESTS_AWS_ACCESS_KEY_ID}
589+
aws_secret_access_key: ${TRACING_TESTS_AWS_SECRET_ACCESS_KEY}
590+
steps:
591+
- run:
592+
name: "Configure environment variables"
593+
command: |
594+
echo "export SUMO_API_ENDPOINT=${TRACING_TESTS_SUMO_API_ENDPOINT}" >> $BASH_ENV
595+
echo "export OTELCOL_HEALTHCHECK_URL=${TRACING_TESTS_OTELCOL_URL}" >> $BASH_ENV
596+
echo "export SUMO_ACCESS_ID=${TRACING_TESTS_SUMO_ACCESS_ID}" >> $BASH_ENV
597+
echo "export SUMO_ACCESS_KEY=${TRACING_TESTS_SUMO_ACCESS_KEY}" >> $BASH_ENV
598+
echo "export PYTHONWARNINGS=ignore:Unverified HTTPS request" >> $BASH_ENV
599+
echo "export AWS_ACCESS_KEY_ID=${TRACING_TESTS_CLUSTER_AWS_ACCESS_ID}" >> $BASH_ENV
600+
echo "export AWS_SECRET_ACCESS_KEY=${TRACING_TESTS_CLUSTER_AWS_ACCESS_KEY}" >> $BASH_ENV
601+
- kubernetes/install-kubeconfig:
602+
kubeconfig: TRACING_TESTS_CLUSTER_KUBECONFIG_DATA
603+
- kubernetes/install-kubectl
604+
- aws-cli/install
605+
- run:
606+
name: "Clean up environment"
607+
command: /opt/tracing-tests/deployment_scripts/clean-up-env.sh
608+
- run:
609+
name: "Deploy Sumologic OpenTelemetry Collector"
610+
command: /opt/tracing-tests/deployment_scripts/deploy-otelcol.sh << parameters.repo >> << parameters.tag >>
611+
- run:
612+
name: "Wait for Sumologic OpenTelemetry Collector to be available"
613+
command: kubectl -n java-app wait --for=condition=ready --timeout=120s pod -l app=otelcol
614+
- run:
615+
name: "Deploy ECR Registry Secret"
616+
command: /opt/tracing-tests/deployment_scripts/deploy-ecr-registry-secret.sh
617+
- run:
618+
name: "Deploy Kubernetes Metadata Provider application"
619+
command: /opt/tracing-tests/deployment_scripts/deploy-k8sfeeder.sh
620+
- run:
621+
name: "Wait for Kubernetes Metadata Provider"
622+
command: kubectl -n java-app wait --for=condition=ready --timeout=60s pod -l app=k8s-feeder
623+
- run:
624+
name: "Get Kubernetes Metadata provider URL"
625+
command: echo "export KUBERNETES_METADATA_URL=$(kubectl -n java-app get svc k8s-feeder-svc-pub -o json | jq .status.loadBalancer.ingress[0].hostname)" >> $BASH_ENV
626+
- run:
627+
name: "Deploy Java App application"
628+
command: /opt/tracing-tests/deployment_scripts/deploy-javaapp.sh
629+
- run:
630+
name: "Wait for Kubernetes Metadata Provider"
631+
command: kubectl -n java-app wait --for=condition=ready --timeout=60s pod -l app=server
632+
- run:
633+
name: "Wait for data..."
634+
command: sleep 180
635+
- run:
636+
name: "Execute Tracing Tests"
637+
command: "pytest --rootdir=/opt/tracing-tests --junitxml=/opt/tracing-tests/test-results/junit.xml --html=/opt/tracing-tests/test-results/report.html --self-contained-html -vvv /opt/tracing-tests/tests"
638+
- store_test_results:
639+
path: /opt/tracing-tests/test-results
640+
- store_artifacts:
641+
path: /opt/tracing-tests/test-results

0 commit comments

Comments
 (0)