Skip to content
Merged
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
34 changes: 1 addition & 33 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,7 @@
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

require 'rubygems'
require 'fileutils'
require 'net/http'
require 'optparse'
require 'digest'
require 'open-uri'
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rake/testtask'

Rake::TestTask.new do |t|
t.verbose = false
t.warning = false
t.ruby_opts = []
t.libs << 'test'

gem_file = ENV['BUNDLE_GEMFILE']&.split('/')&.last

case gem_file
when 'unit.gemfile'
t.test_files = FileList['test/api/*_test.rb'] +
FileList['test/solarwinds_apm/*_test.rb'] +
FileList['test/opentelemetry/*_test.rb'] +
FileList['test/noop/*_test.rb'] +
FileList['test/support/*_test.rb'] +
FileList['test/sampling/*_test.rb'] -
FileList['test/opentelemetry/otlp_processor_*_test.rb']
end
end

################ Docker Task ################

desc "Run an official docker ruby image with the specified tag. The test suite is launched if
runtests is set to true, else a shell session is started for interactive test runs. The platform
Expand Down Expand Up @@ -121,9 +91,7 @@ task :rubocop do
_arg1, arg2 = ARGV

rubocop_file = "#{__dir__}/rubocop_result.txt"
FileUtils.rm_f(rubocop_file)
new_file = File.new(rubocop_file, 'w')
new_file.close
File.write(rubocop_file, '')

`bundle exec rubocop --auto-correct` if arg2 == 'auto-safe'
`bundle exec rubocop --auto-correct-all` if arg2 == 'auto-all'
Expand Down