Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
dc2a7acc
Commit
dc2a7acc
authored
Aug 19, 2021
by
Rajendra Kadam
Committed by
Nick Thomas
Aug 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add snowplow schema spec
parent
55be2245
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
ee/spec/lib/gitlab/tracking/snowplow_schema_validation_spec.rb
...ec/lib/gitlab/tracking/snowplow_schema_validation_spec.rb
+27
-0
spec/lib/gitlab/tracking/snowplow_schema_validation_spec.rb
spec/lib/gitlab/tracking/snowplow_schema_validation_spec.rb
+33
-0
No files found.
ee/spec/lib/gitlab/tracking/snowplow_schema_validation_spec.rb
0 → 100644
View file @
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
spec/lib/gitlab/tracking/snowplow_schema_validation_spec.rb
0 → 100644
View file @
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 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment