Commit f38e31c9 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'snowplow-events-schema-spec' into 'master'

Add snowplow schema spec

See merge request gitlab-org/gitlab!68352
parents 82fb4e0c dc2a7acc
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Snowplow Schema Validation' do
context 'snowplow events definition' do
shared_examples 'matches schema' do
it 'conforms schema json' do
paths = Dir[Rails.root.join(yaml_path)]
events = paths.each_with_object([]) do |path, metrics|
metrics.push(
YAML.safe_load(File.read(path), aliases: true)
)
end
expect(events).to all match_schema(Rails.root.join('config/events/schema.json'))
end
end
describe 'matches the schema for EE' do
let(:yaml_path) { 'ee/config/events/*.yml' }
it_behaves_like 'matches schema'
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Snowplow Schema Validation' do
context 'snowplow events definition' do
shared_examples 'matches schema' do
it 'conforms schema json' do
paths = Dir[Rails.root.join(yaml_path)]
events = paths.each_with_object([]) do |path, metrics|
metrics.push(
YAML.safe_load(File.read(path), aliases: true)
)
end
expect(events).to all match_schema(Rails.root.join('config/events/schema.json'))
end
end
describe 'matches the schema for CE' do
let(:yaml_path) { 'config/events/*.yml' }
it_behaves_like 'matches schema'
end
describe 'matches the schema for EE' do
let(:yaml_path) { 'ee/config/events/*.yml' }
it_behaves_like 'matches schema'
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment