Skip to content

Adds conformance test #77

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build test benchmark publish
.PHONY: build test benchmark publish conformance

build:
gem build lightstep.gemspec
Expand All @@ -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 .
8 changes: 8 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
steps:
- name: 'gcr.io/cloud-builders/git'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct:
Each client library will copy the first 6 lines of this file into its own.

There's probably some value in standardizing the way this is done to allow re-use of a yaml fragment, but if it's this tiny, probably not very much value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the way to standardize is to essentially bundle these into it's own container so that it runs in one step.

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']
19 changes: 19 additions & 0 deletions conformance_test/client.rb
Original file line number Diff line number Diff line change
@@ -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})