File: open_telemetry_spec.rb

package info (click to toggle)
ruby-mongo 2.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,020 kB
  • sloc: ruby: 110,810; makefile: 5
file content (30 lines) | stat: -rw-r--r-- 779 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true
# rubocop:todo all

require 'opentelemetry-sdk'

require 'spec_helper'

require 'runners/unified'

base = "#{CURRENT_PATH}/spec_tests/data/open_telemetry"
OTEL_UNIFIED_TESTS = Dir.glob("#{base}/**/*.yml").sort
SKIPPED_OTEL_TESTS = [
  'bulk_write.yml', 'map_reduce.yml'
]

TESTS_TO_RUN = OTEL_UNIFIED_TESTS.reject do |path|
  SKIPPED_OTEL_TESTS.include?(File.basename(path))
end

SKIPPED_OTEL_TESTS.each do |filename|
  warn "Skipping OpenTelemetry unified spec test: #{filename}"
end

describe 'OTel unified spec tests' do
  if [ 1, '1', 'yes', 'true' ].include?(ENV['OTEL_SPEC_TESTS'])
    define_unified_spec_tests(base, TESTS_TO_RUN)
  else
    skip 'OTel spec tests are disabled. To enable them set env variable OTEL_SPEC_TESTS to 1'
  end
end