Skip to content

Adds dependencies test#17

Merged
codefromthecrypt merged 2 commits intomasterfrom
test-dependencies
Feb 21, 2024
Merged

Adds dependencies test#17
codefromthecrypt merged 2 commits intomasterfrom
test-dependencies

Conversation

@codefromthecrypt
Copy link
Copy Markdown
Member

This adds a dependencies test, which will need further refactoring to support storage types that require dependency-aggregation. However, this works and keeps the first pass small.

This adds a dependencies test, which will need further refactoring to
support storage types that require dependency-aggregation. However, this
works and keeps the first pass small.

Signed-off-by: Adrian Cole <[email protected]>
- >
while ! wget -q --spider http://{{ include "zipkin.fullname" . }}:8081/health;do sleep 1; done &&
for i in 1 2 3;do wget -q --spider http://{{ include "zipkin.fullname" . }}:8081; done
- name: get-dependencies
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The follow-up is.. we'll need a conditional here to invoke the dependencies cron job synchronously, when elasticsearch.

# Make sure zipkin registered in Eureka at startup
args: [ 'wget -q --spider http://{{ include "zipkin.fullname" . }}:8761/eureka/v2/apps/ZIPKIN' ]
{{- end }}
{{ if .Values.global.testDependencies }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used a global here as cycling through a list of objects to pick if "frontend" is there, is quite complicated in helm. maps are easier than lists

echo '[{"parent":"frontend","child":"backend","callCount":3}]' > want.json &&
sleep 3 &&
wget -qO have.json --header "b3: 0" http://{{ include "zipkin.fullname" . }}:{{ .Values.service.port }}/api/v2/dependencies?endTs=$(( $(date +%s) * 1000 )) &&
diff -b want.json have.json
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I code go ;)

echo '[{"parent":"frontend","child":"backend","callCount":3}]' > want.json &&
sleep 3 &&
wget -qO have.json --header "b3: 0" http://{{ include "zipkin.fullname" . }}:{{ .Values.service.port }}/api/v2/dependencies?endTs=$(( $(date +%s) * 1000 )) &&
diff -b want.json have.json
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
diff -b want.json have.json
diff -b want.json got.json

Just kidding

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha true.. I'm not that go ;)

@codefromthecrypt codefromthecrypt merged commit 4be630b into master Feb 21, 2024
@codefromthecrypt codefromthecrypt deleted the test-dependencies branch February 21, 2024 06:41
@codefromthecrypt
Copy link
Copy Markdown
Member Author

thanks for the look @anuraaga!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants