Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves E2E testing with two cases. #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 51 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
version: 2

jobs:
build:
docker:
# node-browsers come with java pre-installed
- image: circleci/node:6.14-browsers
working_directory: ~/openzipkin/web
aliases:
# install latest versions of packages
- &install-latest-dependencies
|
npm install && \
npm install --save zipkin@latest \
zipkin-context-cls@latest \
zipkin-instrumentation-cujojs-rest@latest \
zipkin-instrumentation-express@latest \
zipkin-instrumentation-fetch@latest \
zipkin-transport-http@latest

defaults: &defaults
working_directory: ~/openzipkin/web
docker:
- image: circleci/node:6.14-browsers

jobs:
build-sampled:
<<: *defaults
steps:
- checkout:
path: ~/openzipkin
- run: npm install
# install latest versions of packages
- run: |
npm install --save zipkin@latest \
zipkin-context-cls@latest \
zipkin-instrumentation-cujojs-rest@latest \
zipkin-instrumentation-express@latest \
zipkin-instrumentation-fetch@latest \
zipkin-transport-http@latest
- run: *install-latest-dependencies
- run: curl -sSL https://zipkin.io/quickstart.sh | bash -s
- run:
background: true
command: java -jar zipkin.jar
# block until zipkin is available
- run: wget --retry-connrefused -T 60 -O /dev/null http://127.0.0.1:9411/health
- run: wget --retry-connrefused -T 60 -O /dev/null --header="X-B3-TraceId: a2fb4a1d1a96d312" --header="X-B3-SpanId: a2fb4a1d1a96d312" --header="X-B3-Sampled: 1" http://127.0.0.1:9411/health
# start both processes in the background, but don't use composer as it dies
- run:
background: true
Expand All @@ -34,17 +39,45 @@ jobs:
- run: |
# wait just in case
sleep 1
traces="$(curl -s 127.0.0.1:9411/api/v2/traces)"
traces="$(curl -s 127.0.0.1:9411/api/v2/trace/a2fb4a1d1a96d312)"
echo "queried traces: $traces"
count=$(echo "$traces" | jq '.[0] | length')
echo "count: $count"
test $count -ge 2

build-unsampled:
<<: *defaults
steps:
- checkout:
path: ~/openzipkin
- run: *install-latest-dependencies
- run: curl -sSL https://zipkin.io/quickstart.sh | bash -s
- run:
background: true
command: java -jar zipkin.jar
# block until zipkin is available
- run: wget --retry-connrefused -T 60 -O /dev/null --header="X-B3-TraceId: a2fb4a1d1a96d313" --header="X-B3-SpanId: a2fb4a1d1a96d313" --header="X-B3-Sampled: 0" http://127.0.0.1:9411/health
# start both processes in the background, but don't use composer as it dies
- run:
background: true
command: npm start
# hit the frontend which calls the backend
- run: wget -v --retry-connrefused -T 5 -O /dev/null 127.0.0.1:8081
- run: |
# wait just in case
sleep 1
traces="$(curl -s 127.0.0.1:9411/api/v2/trace/a2fb4a1d1a96d312)"
echo "queried traces: $traces"
count=$(echo "$traces" | jq '.[0] | length')
echo "count: $count"
test $count -ge 0

workflows:
version: 2
commit:
jobs:
- build
- build-sampled
- build-unsampled
nightly:
triggers:
- schedule:
Expand Down