diff --git a/Makefile b/Makefile index 951e8ff..d2310d5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build test benchmark publish +.PHONY: build test benchmark publish conformance build: gem build lightstep.gemspec @@ -22,3 +22,6 @@ bump-version: publish: build test benchmark bump-version gem push lightstep-`ruby scripts/version.rb`.gem + +conformance: cloudbuild.yaml + gcloud builds submit --config cloudbuild.yaml . diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 0000000..94788d2 --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,8 @@ +steps: + - name: 'gcr.io/cloud-builders/git' + args: ['clone', 'https://github.com/lightstep/conformance.git'] + - name: 'gcr.io/cloud-builders/go:debian' + args: ['install', 'github.com/lightstep/conformance/ls_conformance_runner'] + env: ['PROJECT_ROOT=github.com/lightstep'] + - name: 'ruby' + args: ['sh', '-c', 'bundle && gopath/bin/ls_conformance_runner ruby conformance_test/client.rb'] diff --git a/conformance_test/client.rb b/conformance_test/client.rb new file mode 100644 index 0000000..a74540d --- /dev/null +++ b/conformance_test/client.rb @@ -0,0 +1,19 @@ +require 'json' +require 'base64' +require 'opentracing' +require 'bundler/setup' +require 'simplecov' +SimpleCov.start +require 'lightstep' + + +tracer = LightStep::Tracer.new(access_token: "invalid", component_name: "test") + +body = JSON.parse(STDIN.read) +span_context = tracer.extract(OpenTracing::FORMAT_TEXT_MAP, body['text_map']) + +new_text_map = Hash.new +tracer.inject(span_context, OpenTracing::FORMAT_TEXT_MAP, new_text_map) + +STDOUT.write JSON.generate({"text_map"=> new_text_map}) +