diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f1d5b7b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release gems +on: + workflow_dispatch: + push: + tags: + - v* + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + - name: Configure RubyGems Credentials + uses: rubygems/configure-rubygems-credentials@main + - name: Publish to RubyGems + run: | + gem install gem-release + gem release diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 981702f..468f791 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -17,13 +17,9 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["2.7", "3.0", "3.1"] - coverage: ["false"] - include: - - ruby: "3.2" - coverage: "true" + ruby: ["3.0", "3.1", "3.2", "3.3"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} @@ -31,8 +27,3 @@ jobs: - name: Run RSpec run: | bundle exec rspec - - name: Coveralls - if: false # ${{ matrix.coverage == 'true' }} - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.github_token }} diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index bf026ca..7b8fb76 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -9,13 +9,14 @@ on: jobs: rubocop: runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: gemfiles/rubocop.gemfile steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.0 + ruby-version: 3.2 + bundler-cache: true - name: Lint Ruby code with RuboCop run: | - gem install bundler - bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3 - bundle exec --gemfile gemfiles/rubocop.gemfile rubocop + bundle exec rubocop diff --git a/CHANGELOG.md b/CHANGELOG.md index a9312e0..3bcde3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +- Add FactoryDefault profiler support. ([@palkan][]) + ## 0.1.0 (2023-11-21) - Initial public release. ([@palkan][]) diff --git a/Gemfile b/Gemfile index efd3d42..da9f48a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,7 @@ source "https://rubygems.org" gem "debug", platform: :mri gem "factory_bot" +gem "test-prof" gemspec diff --git a/README.md b/README.md index 112f804..d96b150 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ Currently, Autopilot supports the following Test Prof profilers: - [TagProf](https://test-prof.evilmartians.io/profilers/tag_prof) (as `:tag_prof`) - [StackProf](https://test-prof.evilmartians.io/profilers/stack_prof) (as `:stack_prof`) - [FactoryProf](https://test-prof.evilmartians.io/profilers/factory_prof) (as `:factory_prof`) +- [FactoryDefault profiler](https://test-prof.evilmartians.io/recipes/factory_default) (as `:factory_default_prof`) ## Installation diff --git a/lib/test_prof/autopilot.rb b/lib/test_prof/autopilot.rb index 24bce85..7ea3470 100644 --- a/lib/test_prof/autopilot.rb +++ b/lib/test_prof/autopilot.rb @@ -9,5 +9,6 @@ require "test_prof/autopilot/patches/event_prof_patch" require "test_prof/autopilot/patches/tag_prof_patch" require "test_prof/autopilot/patches/factory_prof_patch" + require "test_prof/autopilot/patches/factory_default_patch" require "test_prof/autopilot/patches/stack_prof_patch" end diff --git a/lib/test_prof/autopilot/dsl.rb b/lib/test_prof/autopilot/dsl.rb index be441a2..83635a3 100644 --- a/lib/test_prof/autopilot/dsl.rb +++ b/lib/test_prof/autopilot/dsl.rb @@ -16,6 +16,10 @@ require "test_prof/autopilot/stack_prof/writer" require "test_prof/autopilot/stack_prof/profiling_executor" +require "test_prof/autopilot/factory_default/printer" +require "test_prof/autopilot/factory_default/writer" +require "test_prof/autopilot/factory_default/profiling_executor" + module TestProf module Autopilot # Module contains all available DSL instructions diff --git a/lib/test_prof/autopilot/factory_default/printer.rb b/lib/test_prof/autopilot/factory_default/printer.rb new file mode 100644 index 0000000..1f48223 --- /dev/null +++ b/lib/test_prof/autopilot/factory_default/printer.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module TestProf + module Autopilot + module FactoryDefault + # Module is used for printing :factory_prof report + module Printer + Registry.register(:factory_default_prof_printer, self) + + class PrinterError < StandardError; end + + def print_report(report) + result = report.result + + require "test_prof/factory_default" + profiler = TestProf::FactoryDefault::Profiler.new + profiler.data.merge!(result) + profiler.print_report + end + + module_function :print_report + end + end + end +end diff --git a/lib/test_prof/autopilot/factory_default/profiling_executor.rb b/lib/test_prof/autopilot/factory_default/profiling_executor.rb new file mode 100644 index 0000000..d5d39fe --- /dev/null +++ b/lib/test_prof/autopilot/factory_default/profiling_executor.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require "test_prof/autopilot/profiling_executor/base" + +module TestProf + module Autopilot + module FactoryDefault + # Provides :factory_default_prof specific validations, env and command building. + class ProfilingExecutor < ProfilingExecutor::Base + Registry.register(:factory_default_prof_executor, self) + + def initialize(options) + super + @profiler = :factory_default_prof + end + + private + + def build_env + super.tap do |env| + env["FACTORY_DEFAULT_ENABLED"] = "true" + env["FACTORY_DEFAULT_PROF"] = "1" + end + end + end + end + end +end diff --git a/lib/test_prof/autopilot/factory_default/report.rb b/lib/test_prof/autopilot/factory_default/report.rb new file mode 100644 index 0000000..99bdc7d --- /dev/null +++ b/lib/test_prof/autopilot/factory_default/report.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +require "json" +require "test_prof/autopilot/report_builder" + +module TestProf + module Autopilot + module FactoryDefault + class Report + Registry.register(:factory_default_prof_report, self) + + extend ReportBuilder + + ARTIFACT_FILE = "factory_default_prof_report.json" + + attr_reader :type, :raw_report + + def initialize(raw_report) + @type = :factory_default_prof + @raw_report = raw_report + end + + def result + @result ||= raw_report.tap { |r| r.transform_values! { |v| v.transform_keys!(&:to_sym) } } + end + + def factories + result.dup + end + + def merge(other) + report = result.dup + + other.result.each do |name, stats| + if result.key?(name) + report[name][:count] += stats[:count] + report[name][:time] += stats[:time] + else + report[name] = stats + end + end + + Report.new(report) + end + end + end + end +end diff --git a/lib/test_prof/autopilot/factory_default/writer.rb b/lib/test_prof/autopilot/factory_default/writer.rb new file mode 100644 index 0000000..cfb32b2 --- /dev/null +++ b/lib/test_prof/autopilot/factory_default/writer.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module TestProf + module Autopilot + module FactoryDefault + # Class is used for writing :factory_prof report in different formats + class Writer < ReportWriter + Registry.register(:factory_default_prof_writer, self) + + ARTIFACT_FILE = "factory_default_prof_report" + + def generate_json + report.result.to_json + end + end + end + end +end diff --git a/lib/test_prof/autopilot/factory_prof/printer.rb b/lib/test_prof/autopilot/factory_prof/printer.rb index bcf8a52..ea9c057 100644 --- a/lib/test_prof/autopilot/factory_prof/printer.rb +++ b/lib/test_prof/autopilot/factory_prof/printer.rb @@ -13,7 +13,7 @@ def print_report(report) result = report.result # TODO: Move total_time to the report - TestProf::FactoryProf::Printers::Simple.dump(result, start_time: TestProf.now) + TestProf::FactoryProf::Printers::Simple.dump(result, start_time: TestProf.now, threshold: 0) end module_function :print_report diff --git a/lib/test_prof/autopilot/patches/factory_default_patch.rb b/lib/test_prof/autopilot/patches/factory_default_patch.rb new file mode 100644 index 0000000..c891f42 --- /dev/null +++ b/lib/test_prof/autopilot/patches/factory_default_patch.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module TestProf + module Autopilot + module Patches + module FactoryDefaultPatch + ARTIFACT_FILE = "factory_default_prof_report.json" + + module ProfilerExt + def print_report + # TODO: extract it into a method in TestProf + data = self.data.each_with_object({}) do |(name, stats), acc| + name = name.gsub(/\$id\$.+\$di\$/, "") + if acc.key?(name) + acc[name][:count] += stats[:count] + acc[name][:time] += stats[:time] + else + acc[name] = stats + end + end + + dir_path = FileUtils.mkdir_p(Autopilot.config.tmp_dir)[0] + file_path = File.join(dir_path, ARTIFACT_FILE) + + File.write(file_path, data.to_json) + end + end + + def patch + ::TestProf::FactoryDefault::Profiler.prepend(ProfilerExt) + end + + module_function :patch + end + end + end +end + +if ENV["FACTORY_DEFAULT_ENABLED"] == "true" + require "test_prof/factory_default" + require "test_prof/recipes/rspec/factory_default" + TestProf::Autopilot::Patches::FactoryDefaultPatch.patch +end diff --git a/lib/test_prof/autopilot/profiling_executor/base.rb b/lib/test_prof/autopilot/profiling_executor/base.rb index 6897e57..0b3b30d 100644 --- a/lib/test_prof/autopilot/profiling_executor/base.rb +++ b/lib/test_prof/autopilot/profiling_executor/base.rb @@ -4,6 +4,7 @@ require "test_prof/autopilot/event_prof/report" require "test_prof/autopilot/tag_prof/report" require "test_prof/autopilot/factory_prof/report" +require "test_prof/autopilot/factory_default/report" require "test_prof/autopilot/stack_prof/report" module TestProf diff --git a/spec/fixtures/factory_prof_flamegraph_report.json b/spec/fixtures/factory_prof_flamegraph_report.json index 7fbe34e..bd40252 100644 --- a/spec/fixtures/factory_prof_flamegraph_report.json +++ b/spec/fixtures/factory_prof_flamegraph_report.json @@ -14,14 +14,16 @@ "total_count": 5, "top_level_count": 5, "total_time": 0.0022159996442496777, - "top_level_time": 0.0022159996442496777 + "top_level_time": 0.0022159996442496777, + "variations": {} }, "account": { "name": "account", "total_count": 4, "top_level_count": 2, "total_time": 0.02294999547302723, - "top_level_time": 0.02294999547302723 + "top_level_time": 0.02294999547302723, + "variations": {} } } } diff --git a/spec/fixtures/factory_prof_flamegraph_report_2.json b/spec/fixtures/factory_prof_flamegraph_report_2.json index b1ebedb..1c7bd6d 100644 --- a/spec/fixtures/factory_prof_flamegraph_report_2.json +++ b/spec/fixtures/factory_prof_flamegraph_report_2.json @@ -13,21 +13,24 @@ "total_count": 3, "top_level_count": 0, "total_time": 0.0022159996442496777, - "top_level_time": 0.0022159996442496777 + "top_level_time": 0.0022159996442496777, + "variations": {} }, "post": { "name": "post", "total_count": 6, "top_level_count": 6, "total_time": 0.0022159996442496777, - "top_level_time": 0.0022159996442496777 + "top_level_time": 0.0022159996442496777, + "variations": {} }, "account": { "name": "account", "total_count": 1, "top_level_count": 0, "total_time": 0.02294999547302723, - "top_level_time": 0.02294999547302723 + "top_level_time": 0.02294999547302723, + "variations": {} } } } diff --git a/spec/fixtures/factory_prof_report.json b/spec/fixtures/factory_prof_report.json index 647230d..d076e08 100644 --- a/spec/fixtures/factory_prof_report.json +++ b/spec/fixtures/factory_prof_report.json @@ -6,14 +6,16 @@ "total_count": 5, "top_level_count": 5, "total_time": 0.002294999547302723, - "top_level_time": 0.002294999547302723 + "top_level_time": 0.002294999547302723, + "variations": {} }, "account": { "name": "account", "total_count": 4, "top_level_count": 2, "total_time": 0.02294999547302723, - "top_level_time": 0.02294999547302723 + "top_level_time": 0.02294999547302723, + "variations": {} } } } diff --git a/spec/fixtures/plans/factory_default_prof_plan.rb b/spec/fixtures/plans/factory_default_prof_plan.rb new file mode 100644 index 0000000..b91369e --- /dev/null +++ b/spec/fixtures/plans/factory_default_prof_plan.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +run :factory_default_prof + +info report + +report.factories.select { |_, v| v[:count] > 1 }.each do |name, stats| + puts "#{name} - #{stats[:count]} times, #{stats[:time]}s" +end diff --git a/spec/fixtures/tests.rb b/spec/fixtures/tests.rb index a29690d..091c031 100755 --- a/spec/fixtures/tests.rb +++ b/spec/fixtures/tests.rb @@ -7,7 +7,7 @@ class User end class Job - attr_accessor :title + attr_accessor :title, :user end FactoryBot.define do @@ -41,7 +41,7 @@ class Job end describe "Another something", type: :any do - before { FactoryBot.create(:user) } + before { FactoryBot.create(:job) } it "do something" do expect(true).to eq true diff --git a/spec/integration/event_prof_and_factory_prof_spec.rb b/spec/integration/event_prof_and_factory_prof_spec.rb index c1cc775..9be27f1 100644 --- a/spec/integration/event_prof_and_factory_prof_spec.rb +++ b/spec/integration/event_prof_and_factory_prof_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe "event prof + factory prof scenario" do let(:command) { "'bundle exec rspec --require support/patches_load_helper.rb spec/fixtures/tests.rb'" } @@ -15,13 +17,14 @@ expect(output).to include "[TEST PROF INFO] FactoryProf enabled (simple mode)" expect(output).to include "Factories usage" - expect(output).to include "Total: 5" + expect(output).to include "Total: 7" expect(output).to include "Total top-level: 5" expect(output).to include "Total time: " - expect(output).to include "Total uniq factories: 1" + expect(output).to include "Total uniq factories: 2" - expect(output).to match(/total\s+top-level\s+total time\s+time per call\s+top-level time\s+name/) - expect(output).to match(/\s+5\s+5\s+(\d+\.\d{4}s\s+){3}user/) + expect(output).to match(/name\s+total\s+top-level\s+total time\s+time per call\s+top-level time/) + expect(output).to match(/user\s+5\s+3\s+(\d+\.\d{4}s\s+){3}/) + expect(output).to match(/job\s+2\s+2\s+(\d+\.\d{4}s\s+){3}/) end end diff --git a/spec/integration/event_prof_spec.rb b/spec/integration/event_prof_spec.rb index a87d27d..0375d86 100644 --- a/spec/integration/event_prof_spec.rb +++ b/spec/integration/event_prof_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe "event prof scenario" do let(:command) { "'bundle exec rspec --require support/patches_load_helper.rb spec/fixtures/tests.rb'" } diff --git a/spec/integration/factory_default_prof_spec.rb b/spec/integration/factory_default_prof_spec.rb new file mode 100644 index 0000000..50c2337 --- /dev/null +++ b/spec/integration/factory_default_prof_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe "factory default prof scenario" do + let(:command) { "'bundle exec rspec --require support/patches_load_helper.rb spec/fixtures/tests.rb'" } + + specify "run and print" do + plan = "spec/fixtures/plans/factory_default_prof_plan.rb" + + run_command("bin/auto-test-prof --plan #{plan} --command #{command}") do |output| + expect(output).to include "Reading spec/fixtures/plans/factory_default_prof_plan.rb..." + expect(output).to include "Executing 'run' with profiler:factory_default_prof and options:{}" + + expect(output).to include "Factory associations usage" + expect(output).to match(/\s+user\s+2\s+\d{2}:\d{2}\.\d{3}/) + + # Custom output + expect(output).to include "user - 2 times" + end + end +end diff --git a/spec/integration/factory_prof_spec.rb b/spec/integration/factory_prof_spec.rb index 8f07890..e67a3e2 100644 --- a/spec/integration/factory_prof_spec.rb +++ b/spec/integration/factory_prof_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe "factory prof scenario" do let(:command) { "'bundle exec rspec --require support/patches_load_helper.rb spec/fixtures/tests.rb'" } @@ -12,13 +14,14 @@ expect(output).to include "[TEST PROF INFO] FactoryProf enabled (simple mode)" expect(output).to include "Factories usage" - expect(output).to include "Total: 5" + expect(output).to include "Total: 7" expect(output).to include "Total top-level: 5" expect(output).to include("Total time: ") - expect(output).to include "Total uniq factories: 1" + expect(output).to include "Total uniq factories: 2" - expect(output).to match(/total\s+top-level\s+total time\s+time per call\s+top-level time\s+name/) - expect(output).to match(/\s+5\s+5\s+(\d+\.\d{4}s\s+){3}user/) + expect(output).to match(/name\s+total\s+top-level\s+total time\s+time per call\s+top-level time/) + expect(output).to match(/user\s+5\s+3\s+(\d+\.\d{4}s\s+){3}/) + expect(output).to match(/job\s+2\s+2\s+(\d+\.\d{4}s\s+){3}/) end end @@ -51,13 +54,13 @@ expect(output).to include "1 example, 0 failures" expect(output).to include "Factories usage" - expect(output).to include "Total: 1" + expect(output).to include "Total: " expect(output).to include "Total top-level: 1" expect(output).to include "Total time: " - expect(output).to include "Total uniq factories: 1" + expect(output).to include "Total uniq factories: " - expect(output).to match(/total\s+top-level\s+total time\s+time per call\s+top-level time\s+name/) - expect(output).to match(/\s+1\s+1\s+(\d+\.\d{4}s\s+){3}user/) + expect(output).to match(/name\s+total\s+top-level\s+total time\s+time per call\s+top-level time/) + expect(output).to match(/user\s+1\s+1\s+(\d+\.\d{4}s\s+){3}/) end end diff --git a/spec/integration/merge_spec.rb b/spec/integration/merge_spec.rb index 491e0d4..102a8ea 100644 --- a/spec/integration/merge_spec.rb +++ b/spec/integration/merge_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe "merge reports" do specify "run and print" do reports_glob = "spec/fixtures/event_prof_report*.json" diff --git a/spec/integration/stack_prof_spec.rb b/spec/integration/stack_prof_spec.rb index 01919d8..e45fa60 100644 --- a/spec/integration/stack_prof_spec.rb +++ b/spec/integration/stack_prof_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe "stack prof scenario" do let(:command) { "'bundle exec rspec --require support/patches_load_helper.rb spec/fixtures/tests.rb'" } diff --git a/spec/integration/tag_prof_spec.rb b/spec/integration/tag_prof_spec.rb index 333b034..4dce5c5 100644 --- a/spec/integration/tag_prof_spec.rb +++ b/spec/integration/tag_prof_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe "tag prof scenario" do let(:command) { "'bundle exec rspec --require support/patches_load_helper.rb spec/fixtures/tests.rb'" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a83c9f9..bde80d3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,7 +41,7 @@ TestProf::Autopilot::Registry.instance_variable_defined?(:@items) end - config.after(:all) do + config.after(:suite) do FileUtils.rm_rf("test_prof_autopilot") FileUtils.rm_rf("tmp/test_prof_autopilot") end diff --git a/spec/test_prof/autopilot/command_executor_spec.rb b/spec/test_prof/autopilot/command_executor_spec.rb index ca31167..2d768c6 100644 --- a/spec/test_prof/autopilot/command_executor_spec.rb +++ b/spec/test_prof/autopilot/command_executor_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + require "test_prof/autopilot/command_executor" describe TestProf::Autopilot::CommandExecutor do diff --git a/spec/test_prof/autopilot/configuration_spec.rb b/spec/test_prof/autopilot/configuration_spec.rb index dfb6ff6..8608b88 100644 --- a/spec/test_prof/autopilot/configuration_spec.rb +++ b/spec/test_prof/autopilot/configuration_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe TestProf::Autopilot::Configuration do subject { described_class.new } diff --git a/spec/test_prof/autopilot/dsl_spec.rb b/spec/test_prof/autopilot/dsl_spec.rb index bfa0fac..0747e03 100644 --- a/spec/test_prof/autopilot/dsl_spec.rb +++ b/spec/test_prof/autopilot/dsl_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + require "test_prof/autopilot/runner" class DummyExecutor < TestProf::Autopilot::ProfilingExecutor::Base diff --git a/spec/test_prof/autopilot/event_prof/printer_spec.rb b/spec/test_prof/autopilot/event_prof/printer_spec.rb index 0ae09a5..8f2d47a 100644 --- a/spec/test_prof/autopilot/event_prof/printer_spec.rb +++ b/spec/test_prof/autopilot/event_prof/printer_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe TestProf::Autopilot::EventProf::Printer do subject { described_class } diff --git a/spec/test_prof/autopilot/event_prof/profiling_executor_spec.rb b/spec/test_prof/autopilot/event_prof/profiling_executor_spec.rb index cbb8eae..a4f4a8c 100644 --- a/spec/test_prof/autopilot/event_prof/profiling_executor_spec.rb +++ b/spec/test_prof/autopilot/event_prof/profiling_executor_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + require "test_prof/autopilot/event_prof/profiling_executor" describe TestProf::Autopilot::EventProf::ProfilingExecutor do diff --git a/spec/test_prof/autopilot/event_prof/report_spec.rb b/spec/test_prof/autopilot/event_prof/report_spec.rb index 6e43199..35f069c 100644 --- a/spec/test_prof/autopilot/event_prof/report_spec.rb +++ b/spec/test_prof/autopilot/event_prof/report_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe TestProf::Autopilot::EventProf::Report do subject { described_class } diff --git a/spec/test_prof/autopilot/factory_prof/profiling_executor_spec.rb b/spec/test_prof/autopilot/factory_prof/profiling_executor_spec.rb index 1892833..60ca3bc 100644 --- a/spec/test_prof/autopilot/factory_prof/profiling_executor_spec.rb +++ b/spec/test_prof/autopilot/factory_prof/profiling_executor_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + require "test_prof/autopilot/factory_prof/profiling_executor" describe TestProf::Autopilot::FactoryProf::ProfilingExecutor do diff --git a/spec/test_prof/autopilot/factory_prof/report_spec.rb b/spec/test_prof/autopilot/factory_prof/report_spec.rb index 6593834..75d26bf 100644 --- a/spec/test_prof/autopilot/factory_prof/report_spec.rb +++ b/spec/test_prof/autopilot/factory_prof/report_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe TestProf::Autopilot::FactoryProf::Report do subject { described_class } diff --git a/spec/test_prof/autopilot/registry_spec.rb b/spec/test_prof/autopilot/registry_spec.rb index 42bdc86..c334696 100644 --- a/spec/test_prof/autopilot/registry_spec.rb +++ b/spec/test_prof/autopilot/registry_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + require "test_prof/autopilot/registry" class DummyClass; end diff --git a/spec/test_prof/autopilot/runner_spec.rb b/spec/test_prof/autopilot/runner_spec.rb index 683ee0e..26622b1 100644 --- a/spec/test_prof/autopilot/runner_spec.rb +++ b/spec/test_prof/autopilot/runner_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + require "test_prof/autopilot/runner" describe TestProf::Autopilot::Runner do diff --git a/spec/test_prof/autopilot/stack_prof/profiling_executor_spec.rb b/spec/test_prof/autopilot/stack_prof/profiling_executor_spec.rb index ae587a0..b76567f 100644 --- a/spec/test_prof/autopilot/stack_prof/profiling_executor_spec.rb +++ b/spec/test_prof/autopilot/stack_prof/profiling_executor_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + require "test_prof/autopilot/stack_prof/profiling_executor" describe TestProf::Autopilot::StackProf::ProfilingExecutor do diff --git a/spec/test_prof/autopilot/tag_prof/report_spec.rb b/spec/test_prof/autopilot/tag_prof/report_spec.rb index f822e87..d348f70 100644 --- a/spec/test_prof/autopilot/tag_prof/report_spec.rb +++ b/spec/test_prof/autopilot/tag_prof/report_spec.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "spec_helper" + describe TestProf::Autopilot::TagProf::Report do subject { described_class } diff --git a/test-prof-autopilot.gemspec b/test-prof-autopilot.gemspec index b4c3300..4f3deed 100644 --- a/test-prof-autopilot.gemspec +++ b/test-prof-autopilot.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |s| "funding_uri" => "https://github.com/sponsors/test-prof" } - s.add_runtime_dependency "test-prof", "~> 1.0" + s.add_runtime_dependency "test-prof", "> 1.3.100", "< 1.5.0" s.add_development_dependency "bundler", ">= 1.15" s.add_development_dependency "rake", ">= 13.0"